You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Leon <le...@hotmail.com> on 2003/05/26 05:15:11 UTC

OJB, Eclipse and Weblogic

Hi,

I set OJB up on Weblogic with OjbPbStartup class posted on the OJB web site.
I got following errors when my DAO access to repository.xml.

<May 25, 2003 11:02:27 PM EDT> <Error> <HTTP> <101017>
<[ServletContext(id=8931423,name=WebContent,context-path=/WebContent)] Root
cause of ServletException

java.lang.ExceptionInInitializerError

at
org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.buildDefaultK
ey(PersistenceBrokerFactoryDefaultImpl.java:139)

at
org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.<init>(Persis
tenceBrokerFactoryDefaultImpl.java:110)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAcces
sorImpl.java:39)

at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstruc
torAccessorImpl.java:27)

at java.lang.reflect.Constructor.newInstance(Constructor.java:274)

at java.lang.Class.newInstance0(Class.java:306)

at java.lang.Class.newInstance(Class.java:259)

at
org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.init(PersistenceB
rokerFactoryFactory.java:94)

at
org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.<clinit>(Persiste
nceBrokerFactoryFactory.java:71)

at org.apache.ojb.weblogic.OjbPbStartup.getInstance(OjbPbStartup.java:42)

at com.xegle.systems.registry.dao.RegistryDAO.insert(RegistryDAO.java:52)

at
com.xegle.systems.registry.RegistryManagerBD.addRegistryInfo(RegistryManager
BD.java:29)

at
com.xegle.systems.struts.registry.RegistryAction.execute(RegistryAction.java
:48)

at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProces
sor.java:480)

at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)

at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1420)

at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:520)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at
weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(Servle
tStubImpl.java:1058)

at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:401)

at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:306)

at
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(W
ebAppServletContext.java:5445)

at
weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManage
r.java:780)

at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
ntext.java:3105)

at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
:2588)

at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)

at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)

Caused by: org.apache.ojb.broker.metadata.MetadataException: Could not read
jdbc-connection-descriptor data, using repository: repository.xml

at
org.apache.ojb.broker.metadata.MetadataManager.init(MetadataManager.java:98)

at
org.apache.ojb.broker.metadata.MetadataManager.<init>(MetadataManager.java:7
6)

at
org.apache.ojb.broker.metadata.MetadataManager.<clinit>(MetadataManager.java
:67)

... 29 more

Caused by: java.lang.NullPointerException

at weblogic.apache.xerces.framework.XMLParser.parse(XMLParser.java:1151)

at weblogic.xml.jaxp.WebLogicXMLReader.parse(WebLogicXMLReader.java:135)

at weblogic.xml.jaxp.RegistryXMLReader.parse(RegistryXMLReader.java:133)

at weblogic.xml.jaxp.RegistryXMLReader.parse(RegistryXMLReader.java:145)

at
org.apache.ojb.broker.metadata.RepositoryPersistor.buildRepository(Repositor
yPersistor.java:307)

at
org.apache.ojb.broker.metadata.RepositoryPersistor.readConnectionRepository(
RepositoryPersistor.java:220)

at
org.apache.ojb.broker.metadata.MetadataManager.init(MetadataManager.java:94)

... 31 more

>

My repository.xml is

<!-- defining entities for include-files -->

<!DOCTYPE descriptor-repository SYSTEM "repository.dtd" [

<!ENTITY database SYSTEM "repository_database.xml">

<!ENTITY internal SYSTEM "repository_internal.xml">

<!ENTITY user SYSTEM "repository_user.xml">

]>

<descriptor-repository version="1.0" isolation-level="read-uncommitted">

<!-- include all used database connections -->

&database;

<!-- include ojb internal mappings here -->

&internal;

<!-- include mappings for JUnit tests -->

<!-- This could be removed (with <!ENTITY entry), if junit test suite was
not used -->

<!-- &junit; -->

<!-- include user defined mappings here -->

&user;

<!-- include mappings for the EJB-examples -->

<!-- &ejb; -->

<!-- include mappings for the JDO tutorials -->

<!-- &jdo; -->

</descriptor-repository>

My repository_database.xml is

<!-- Datasource example -->

<jdbc-connection-descriptor

platform="MySQL"

jdbc-level="2.0"

driver="org.gjt.mm.mysql.Driver"

protocol="jdbc"

subprotocol="mysql://localhost:3306/xegledb"

dbalias="xegledb"

username="admin"

password="adminwu"

useAutoCommit="0" >

<sequence-manager
className="org.apache.ojb.broker.util.sequence.SequenceManagerNextValImpl">

<attribute attribute-name="grabSize" attribute-value="20"/>

</sequence-manager>

</jdbc-connection-descriptor >

Anyone could help me to fix it?

Thanks.



Leon


Re: OJB, Eclipse and Weblogic

Posted by Leon <le...@hotmail.com>.
Oops, I did not put jcd-alias in the jdbc-connection-descriptor.

----- Original Message -----
From: "Leon" <le...@hotmail.com>
To: "OJB Users List" <oj...@db.apache.org>; "Armin Waibel"
<ar...@code-au-lait.de>
Sent: Monday, May 26, 2003 9:01 AM
Subject: Re: OJB, Eclipse and Weblogic


> Hi Armin,
>
> I am new to OJB. I did a test by making an error in my
> repository_database.xml artificially. It looks like this
> <jdbc-connection-descriptor
>
> platform="MySQL"
>
> jdbc-level="2.0"
>
> driver="org.gjt.mm.mysql.Driver"
>
> protocol="jdbc"
>
> subprotocol="mysql://localhost:3306/xegledb"
>
> dbalias="xegledb"
>
> username="admin"
>
> password="adminwu"
>
> useAutoCommit="0" -- >
>
> I put --> in the end of jdbc-connection-descriptor tag instead of > and I
> run my app. Then, I got errors as
> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)
>
> Caused by: org.apache.ojb.broker.metadata.MetadataException: Could not
read
> repository class descriptor data, using repository: repository.xml:
Element
> type "jdbc-connection-descriptor" must be followed by either attribute
> specifications, ">" or "/>".
>
> at
>
org.apache.ojb.broker.metadata.MetadataManager.init(MetadataManager.java:89)
>
> at
>
org.apache.ojb.broker.metadata.MetadataManager.<init>(MetadataManager.java:7
> 6)
>
> at
>
org.apache.ojb.broker.metadata.MetadataManager.<clinit>(MetadataManager.java
> :67)
>
> ... 29 more
>
> Caused by: org.xml.sax.SAXParseException: Element type
> "jdbc-connection-descriptor" must be followed by either attribute
> specifications, ">" or "/>".
>
> at
>
weblogic.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1292)
>
> at
>
weblogic.apache.xerces.framework.XMLDocumentScanner.reportFatalXMLError(XMLD
> ocumentScanner.java:604)
>
> at
>
weblogic.apache.xerces.framework.XMLDocumentScanner.abortMarkup(XMLDocumentS
> canner.java:653)
>
> at
>
weblogic.apache.xerces.framework.XMLDocumentScanner.scanElement(XMLDocumentS
> canner.java:1832)
>
> at
>
weblogic.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispat
> ch(XMLDocumentScanner.java:1207)
>
> at
>
weblogic.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentSca
> nner.java:399)
>
> at weblogic.apache.xerces.framework.XMLParser.parse(XMLParser.java:1138)
>
> at weblogic.xml.jaxp.WebLogicXMLReader.parse(WebLogicXMLReader.java:135)
>
> at weblogic.xml.jaxp.RegistryXMLReader.parse(RegistryXMLReader.java:133)
>
> at weblogic.xml.jaxp.RegistryXMLReader.parse(RegistryXMLReader.java:145)
>
> at
>
org.apache.ojb.broker.metadata.RepositoryPersistor.buildRepository(Repositor
> yPersistor.java:296)
>
> at
>
org.apache.ojb.broker.metadata.RepositoryPersistor.readDescriptorRepository(
> RepositoryPersistor.java:207)
>
> at
>
org.apache.ojb.broker.metadata.MetadataManager.init(MetadataManager.java:85)
>
> ... 31 more
>
> It says "jdbc-connection-descriptor must be followed by either attribute
> specifications, > or/>". Could I asume that my app has found the
> repository_database.xml file or any posible cases?
> Thanks a lot.
>
> Leon
>
>
> ----- Original Message -----
> From: "Armin Waibel" <ar...@code-au-lait.de>
> To: "OJB Users List" <oj...@db.apache.org>
> Sent: Monday, May 26, 2003 2:41 AM
> Subject: Re: OJB, Eclipse and Weblogic
>
>
> > Hi Leon,
> >
> > > Caused by: org.apache.ojb.broker.metadata.MetadataException: Could not
> > read
> > > jdbc-connection-descriptor data, using repository: repository.xml
> > >
> > > at
> > >
> > org.apache.ojb.broker.metadata.MetadataManager.init(MetadataManager.java
> > :98)
> >
> > Seems your app has problems in finding the repository
> > file (repository.xml) or one of the sub-files (repository_database.xml,
> > ...).
> >
> > regards,
> > Armin
> >
> >
> > ----- Original Message -----
> > From: "Leon" <le...@hotmail.com>
> > To: "OJB Users List" <oj...@db.apache.org>
> > Sent: Monday, May 26, 2003 5:15 AM
> > Subject: OJB, Eclipse and Weblogic
> >
> >
> > > Hi,
> > >
> > > I set OJB up on Weblogic with OjbPbStartup class posted on the OJB web
> > site.
> > > I got following errors when my DAO access to repository.xml.
> > >
> > > <May 25, 2003 11:02:27 PM EDT> <Error> <HTTP> <101017>
> > > <[ServletContext(id=8931423,name=WebContent,context-path=/WebContent)]
> > Root
> > > cause of ServletException
> > >
> > > java.lang.ExceptionInInitializerError
> > >
> > > at
> > >
> > org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.buildDefa
> > ultK
> > > ey(PersistenceBrokerFactoryDefaultImpl.java:139)
> > >
> > > at
> > >
> > org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.<init>(Pe
> > rsis
> > > tenceBrokerFactoryDefaultImpl.java:110)
> > >
> > > at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> > Method)
> > >
> > > at
> > >
> > sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorA
> > cces
> > > sorImpl.java:39)
> > >
> > > at
> > >
> > sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingCons
> > truc
> > > torAccessorImpl.java:27)
> > >
> > > at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
> > >
> > > at java.lang.Class.newInstance0(Class.java:306)
> > >
> > > at java.lang.Class.newInstance(Class.java:259)
> > >
> > > at
> > >
> > org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.init(Persiste
> > nceB
> > > rokerFactoryFactory.java:94)
> > >
> > > at
> > >
> > org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.<clinit>(Pers
> > iste
> > > nceBrokerFactoryFactory.java:71)
> > >
> > > at
> > org.apache.ojb.weblogic.OjbPbStartup.getInstance(OjbPbStartup.java:42)
> > >
> > > at
> > com.xegle.systems.registry.dao.RegistryDAO.insert(RegistryDAO.java:52)
> > >
> > > at
> > >
> > com.xegle.systems.registry.RegistryManagerBD.addRegistryInfo(RegistryMan
> > ager
> > > BD.java:29)
> > >
> > > at
> > >
> > com.xegle.systems.struts.registry.RegistryAction.execute(RegistryAction.
> > java
> > > :48)
> > >
> > > at
> > >
> > org.apache.struts.action.RequestProcessor.processActionPerform(RequestPr
> > oces
> > > sor.java:480)
> > >
> > > at
> > >
> > org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:
> > 274)
> > >
> > > at
> > org.apache.struts.action.ActionServlet.process(ActionServlet.java:1420)
> > >
> > > at
> > org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:520)
> > >
> > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
> > >
> > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> > >
> > > at
> > >
> > weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(Se
> > rvle
> > > tStubImpl.java:1058)
> > >
> > > at
> > >
> > weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.
> > java
> > > :401)
> > >
> > > at
> > >
> > weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.
> > java
> > > :306)
> > >
> > > at
> > >
> > weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.r
> > un(W
> > > ebAppServletContext.java:5445)
> > >
> > > at
> > >
> > weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceMa
> > nage
> > > r.java:780)
> > >
> > > at
> > >
> > weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServl
> > etCo
> > > ntext.java:3105)
> > >
> > > at
> > >
> > weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.
> > java
> > > :2588)
> > >
> > > at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)
> > >
> > > at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)
> > >
> > > Caused by: org.apache.ojb.broker.metadata.MetadataException: Could not
> > read
> > > jdbc-connection-descriptor data, using repository: repository.xml
> > >
> > > at
> > >
> > org.apache.ojb.broker.metadata.MetadataManager.init(MetadataManager.java
> > :98)
> > >
> > > at
> > >
> > org.apache.ojb.broker.metadata.MetadataManager.<init>(MetadataManager.ja
> > va:7
> > > 6)
> > >
> > > at
> > >
> > org.apache.ojb.broker.metadata.MetadataManager.<clinit>(MetadataManager.
> > java
> > > :67)
> > >
> > > ... 29 more
> > >
> > > Caused by: java.lang.NullPointerException
> > >
> > > at
> > weblogic.apache.xerces.framework.XMLParser.parse(XMLParser.java:1151)
> > >
> > > at
> > weblogic.xml.jaxp.WebLogicXMLReader.parse(WebLogicXMLReader.java:135)
> > >
> > > at
> > weblogic.xml.jaxp.RegistryXMLReader.parse(RegistryXMLReader.java:133)
> > >
> > > at
> > weblogic.xml.jaxp.RegistryXMLReader.parse(RegistryXMLReader.java:145)
> > >
> > > at
> > >
> > org.apache.ojb.broker.metadata.RepositoryPersistor.buildRepository(Repos
> > itor
> > > yPersistor.java:307)
> > >
> > > at
> > >
> > org.apache.ojb.broker.metadata.RepositoryPersistor.readConnectionReposit
> > ory(
> > > RepositoryPersistor.java:220)
> > >
> > > at
> > >
> > org.apache.ojb.broker.metadata.MetadataManager.init(MetadataManager.java
> > :94)
> > >
> > > ... 31 more
> > >
> > > >
> > >
> > > My repository.xml is
> > >
> > > <!-- defining entities for include-files -->
> > >
> > > <!DOCTYPE descriptor-repository SYSTEM "repository.dtd" [
> > >
> > > <!ENTITY database SYSTEM "repository_database.xml">
> > >
> > > <!ENTITY internal SYSTEM "repository_internal.xml">
> > >
> > > <!ENTITY user SYSTEM "repository_user.xml">
> > >
> > > ]>
> > >
> > > <descriptor-repository version="1.0"
> > isolation-level="read-uncommitted">
> > >
> > > <!-- include all used database connections -->
> > >
> > > &database;
> > >
> > > <!-- include ojb internal mappings here -->
> > >
> > > &internal;
> > >
> > > <!-- include mappings for JUnit tests -->
> > >
> > > <!-- This could be removed (with <!ENTITY entry), if junit test suite
> > was
> > > not used -->
> > >
> > > <!-- &junit; -->
> > >
> > > <!-- include user defined mappings here -->
> > >
> > > &user;
> > >
> > > <!-- include mappings for the EJB-examples -->
> > >
> > > <!-- &ejb; -->
> > >
> > > <!-- include mappings for the JDO tutorials -->
> > >
> > > <!-- &jdo; -->
> > >
> > > </descriptor-repository>
> > >
> > > My repository_database.xml is
> > >
> > > <!-- Datasource example -->
> > >
> > > <jdbc-connection-descriptor
> > >
> > > platform="MySQL"
> > >
> > > jdbc-level="2.0"
> > >
> > > driver="org.gjt.mm.mysql.Driver"
> > >
> > > protocol="jdbc"
> > >
> > > subprotocol="mysql://localhost:3306/xegledb"
> > >
> > > dbalias="xegledb"
> > >
> > > username="admin"
> > >
> > > password="adminwu"
> > >
> > > useAutoCommit="0" >
> > >
> > > <sequence-manager
> > >
> > className="org.apache.ojb.broker.util.sequence.SequenceManagerNextValImp
> > l">
> > >
> > > <attribute attribute-name="grabSize" attribute-value="20"/>
> > >
> > > </sequence-manager>
> > >
> > > </jdbc-connection-descriptor >
> > >
> > > Anyone could help me to fix it?
> > >
> > > Thanks.
> > >
> > >
> > >
> > > Leon
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> > > For additional commands, e-mail: ojb-user-help@db.apache.org
> > >
> > >
> > >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> > For additional commands, e-mail: ojb-user-help@db.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>

How to get Transaction Manager Factory

Posted by Leon <le...@hotmail.com>.
Hi,

A quick question.
In order to find the transaction manager, I set up transaction manager
property to WeblogicTransactionManagerFactory. How can I get the instance of
it, like look up or just new an instance?

Leon

Re: Not supported in managed environment

Posted by Armin Waibel <ar...@code-au-lait.de>.
Hi Leon,

in managed environments the transaction demarcation
should be done by the container (cm-tx) or using
JTA-UserTransaction.
Hence OJB does not allow OJB-tx demarcation.
This behaviour is managed by the 'ConnectionFactoryClass'
attribute in OJB.properties

regards,
Armin

----- Original Message -----
From: "Leon" <le...@hotmail.com>
To: "OJB Users List" <oj...@db.apache.org>
Sent: Monday, May 26, 2003 9:37 PM
Subject: Not supported in managed environment


> Hi,
>
> I am using MySql database and I got "Not supported in managed
environment'
> exception when borker.beginTransaction() method. Does anybody knows
what's
> wrong?
> Thanks.
>
> Best regards,
> Leon
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
>



Re: How to handle SQLException in OJB?

Posted by Leon <le...@hotmail.com>.
Hi Michael,

I tried do that but pbx.getCause() is not PersistenceBrokerSQLException.
pbx.getSourceException() is instance of SQLException and the cause is
"Duplicate entry 'xxxxxx' for key2". I can use this message to do exception
handling. However, I was wandering if it is a generic way to find the
details of SQLException?
Thanks.

Leon
----- Original Message -----
From: "Michael Hart" <mi...@perceptek.com.au>
To: "'OJB Users List'" <oj...@db.apache.org>
Sent: Tuesday, May 27, 2003 9:02 PM
Subject: RE: How to handle SQLException in OJB?


> Hi Leon,
>
> It looks like you're logging level is not set correctly - you need to set
> the logging level of JdbcAccessImpl to FATAL because the printStackTrace
> occurs when set to ERROR or below.
>
> If you're using the default logger (PoorMansLoggerImpl), then you want to
> change your logging levels in OJB.properties:
>
> # Note that this is NOT JdbcAccess, but rather JdbcAccessImpl
> org.apache.ojb.broker.accesslayer.JdbcAccessImpl.LogLevel=FATAL
>
>
> After this, you can catch a PersistenceBrokerException and check whether
it
> is an SQL exception or not:
>
> try
> {
>     Collection allProducts = broker.getCollectionByQuery(query);
> }
> catch (PersistenceBrokerException pbx)
> {
>     // The PersistenceBrokerSQLException is nested in pbx and the
>     // SQLException is nested in that (ie pbx.getCause().getCause())
>     if (pbx.getCause() instanceof PersistenceBrokerSQLException) {
>         System.out.println("SQL problem " + pbx.getCause());
>     }
> }
>
> Cheers,
>
> Michael
>
> -----Original Message-----
> From: Leon [mailto:leonnewsgroup@hotmail.com]
> Sent: Wednesday, 28 May 2003 1:38 AM
> To: OJB Users List
> Subject: Re: How to handle SQLException in OJB?
>
> Here is it. I am using PersistenceBroker.
>
> Thanks.
>
> .......
>
> tx.begin();
>
> broker.store(registryvo);
>
> tx.commit();
>
> } catch (SQLException e) {
>
> e.printStackTrace();
>
> } catch (PersistenceBrokerException e) {
>
> if (log.isEnabledFor(Priority.INFO)) {
>
> log.info(
>
> "********* Something went wrong while insert a record to account
> **********");
>
> }
>
> e.printStackTrace();
>
> throw new DataAccessException("Error in RegistryDAO.insert():" +
>
> e.toString(), e);
>
> }
>
> ----- Original Message -----
> From: "Michael Hart" <mi...@perceptek.com.au>
> To: "'OJB Users List'" <oj...@db.apache.org>
> Sent: Tuesday, May 27, 2003 11:12 AM
> Subject: RE: How to handle SQLException in OJB?
>
>
> > > I already tried that but it is unreachable catch block.
> >
> > It could be from the logger - have you disabled output from that? (or at
> > least set the log-level to something high-ish)
> >
> > The default logger (PoorMansLoggerImpl) will print a stack trace if a
> > Throwable is logged (perhaps log4j does as well), so this may be your
> > problem.
> >
> > Which code is causing the problem? Can you give a sample? Are you using
> > PersistenceBroker or ODMG or JDO?
> >
> > Cheers,
> >
> > Michael
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> > For additional commands, e-mail: ojb-user-help@db.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>

RE: How to handle SQLException in OJB?

Posted by Michael Hart <mi...@perceptek.com.au>.
Hi Leon,

It looks like you're logging level is not set correctly - you need to set
the logging level of JdbcAccessImpl to FATAL because the printStackTrace
occurs when set to ERROR or below.

If you're using the default logger (PoorMansLoggerImpl), then you want to
change your logging levels in OJB.properties:

# Note that this is NOT JdbcAccess, but rather JdbcAccessImpl
org.apache.ojb.broker.accesslayer.JdbcAccessImpl.LogLevel=FATAL


After this, you can catch a PersistenceBrokerException and check whether it
is an SQL exception or not:

try
{
    Collection allProducts = broker.getCollectionByQuery(query);
}
catch (PersistenceBrokerException pbx)
{
    // The PersistenceBrokerSQLException is nested in pbx and the 
    // SQLException is nested in that (ie pbx.getCause().getCause())
    if (pbx.getCause() instanceof PersistenceBrokerSQLException) {
        System.out.println("SQL problem " + pbx.getCause());
    }
}

Cheers,

Michael

-----Original Message-----
From: Leon [mailto:leonnewsgroup@hotmail.com] 
Sent: Wednesday, 28 May 2003 1:38 AM
To: OJB Users List
Subject: Re: How to handle SQLException in OJB?

Here is it. I am using PersistenceBroker.

Thanks.

.......

tx.begin();

broker.store(registryvo);

tx.commit();

} catch (SQLException e) {

e.printStackTrace();

} catch (PersistenceBrokerException e) {

if (log.isEnabledFor(Priority.INFO)) {

log.info(

"********* Something went wrong while insert a record to account
**********");

}

e.printStackTrace();

throw new DataAccessException("Error in RegistryDAO.insert():" +

e.toString(), e);

}

----- Original Message -----
From: "Michael Hart" <mi...@perceptek.com.au>
To: "'OJB Users List'" <oj...@db.apache.org>
Sent: Tuesday, May 27, 2003 11:12 AM
Subject: RE: How to handle SQLException in OJB?


> > I already tried that but it is unreachable catch block.
>
> It could be from the logger - have you disabled output from that? (or at
> least set the log-level to something high-ish)
>
> The default logger (PoorMansLoggerImpl) will print a stack trace if a
> Throwable is logged (perhaps log4j does as well), so this may be your
> problem.
>
> Which code is causing the problem? Can you give a sample? Are you using
> PersistenceBroker or ODMG or JDO?
>
> Cheers,
>
> Michael
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org



Re: How to handle SQLException in OJB?

Posted by Leon <le...@hotmail.com>.
Here is it. I am using PersistenceBroker.

Thanks.

.......

tx.begin();

broker.store(registryvo);

tx.commit();

} catch (SQLException e) {

e.printStackTrace();

} catch (PersistenceBrokerException e) {

if (log.isEnabledFor(Priority.INFO)) {

log.info(

"********* Something went wrong while insert a record to account
**********");

}

e.printStackTrace();

throw new DataAccessException("Error in RegistryDAO.insert():" +

e.toString(), e);

}

----- Original Message -----
From: "Michael Hart" <mi...@perceptek.com.au>
To: "'OJB Users List'" <oj...@db.apache.org>
Sent: Tuesday, May 27, 2003 11:12 AM
Subject: RE: How to handle SQLException in OJB?


> > I already tried that but it is unreachable catch block.
>
> It could be from the logger - have you disabled output from that? (or at
> least set the log-level to something high-ish)
>
> The default logger (PoorMansLoggerImpl) will print a stack trace if a
> Throwable is logged (perhaps log4j does as well), so this may be your
> problem.
>
> Which code is causing the problem? Can you give a sample? Are you using
> PersistenceBroker or ODMG or JDO?
>
> Cheers,
>
> Michael
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>

RE: How to handle SQLException in OJB?

Posted by Michael Hart <mi...@perceptek.com.au>.
> I already tried that but it is unreachable catch block.

It could be from the logger - have you disabled output from that? (or at
least set the log-level to something high-ish)

The default logger (PoorMansLoggerImpl) will print a stack trace if a
Throwable is logged (perhaps log4j does as well), so this may be your
problem.

Which code is causing the problem? Can you give a sample? Are you using
PersistenceBroker or ODMG or JDO?

Cheers,

Michael


Re: How to handle SQLException in OJB?

Posted by Leon <le...@hotmail.com>.
I already tried that but it is unreachable catch block.
Thanx.

Leon
----- Original Message ----- 
From: "Michael Hart" <mi...@perceptek.com.au>
To: "'OJB Users List'" <oj...@db.apache.org>
Sent: Tuesday, May 27, 2003 10:35 AM
Subject: RE: How to handle SQLException in OJB?


> > How can I catch this exception in my DAO object so that I can
> > throw my application exception?
> 
> This doesn't work? :
> 
> try {
>     // DAO code here...
> } catch (SQLException sx) {
>     throw new MyApplicationException("Had an SQL error.");
> }
> 
> What have you tried already?
> 
> Cheers,
> 
> Michael
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
> 

RE: How to handle SQLException in OJB?

Posted by Michael Hart <mi...@perceptek.com.au>.
> How can I catch this exception in my DAO object so that I can
> throw my application exception?

This doesn't work? :

try {
    // DAO code here...
} catch (SQLException sx) {
    throw new MyApplicationException("Had an SQL error.");
}

What have you tried already?

Cheers,

Michael


How to handle SQLException in OJB?

Posted by Leon <le...@hotmail.com>.
Hi,

In the case of inserting a record with same key value, a SQLException of
duplicate entry is thrown in implementation of OJB. How can I catch this
exception in my DAO object so that I can throw my application exception?
Thanks.

Best regards.

Leon

Not supported in managed environment

Posted by Leon <le...@hotmail.com>.
Hi,

I am using MySql database and I got "Not supported in managed environment'
exception when borker.beginTransaction() method. Does anybody knows what's
wrong?
Thanks.

Best regards,
Leon

Re: OJB, Eclipse and Weblogic

Posted by Leon <le...@hotmail.com>.
Hi Armin,

I am new to OJB. I did a test by making an error in my
repository_database.xml artificially. It looks like this
<jdbc-connection-descriptor

platform="MySQL"

jdbc-level="2.0"

driver="org.gjt.mm.mysql.Driver"

protocol="jdbc"

subprotocol="mysql://localhost:3306/xegledb"

dbalias="xegledb"

username="admin"

password="adminwu"

useAutoCommit="0" -- >

I put --> in the end of jdbc-connection-descriptor tag instead of > and I
run my app. Then, I got errors as
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)

Caused by: org.apache.ojb.broker.metadata.MetadataException: Could not read
repository class descriptor data, using repository: repository.xml: Element
type "jdbc-connection-descriptor" must be followed by either attribute
specifications, ">" or "/>".

at
org.apache.ojb.broker.metadata.MetadataManager.init(MetadataManager.java:89)

at
org.apache.ojb.broker.metadata.MetadataManager.<init>(MetadataManager.java:7
6)

at
org.apache.ojb.broker.metadata.MetadataManager.<clinit>(MetadataManager.java
:67)

... 29 more

Caused by: org.xml.sax.SAXParseException: Element type
"jdbc-connection-descriptor" must be followed by either attribute
specifications, ">" or "/>".

at
weblogic.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1292)

at
weblogic.apache.xerces.framework.XMLDocumentScanner.reportFatalXMLError(XMLD
ocumentScanner.java:604)

at
weblogic.apache.xerces.framework.XMLDocumentScanner.abortMarkup(XMLDocumentS
canner.java:653)

at
weblogic.apache.xerces.framework.XMLDocumentScanner.scanElement(XMLDocumentS
canner.java:1832)

at
weblogic.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispat
ch(XMLDocumentScanner.java:1207)

at
weblogic.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentSca
nner.java:399)

at weblogic.apache.xerces.framework.XMLParser.parse(XMLParser.java:1138)

at weblogic.xml.jaxp.WebLogicXMLReader.parse(WebLogicXMLReader.java:135)

at weblogic.xml.jaxp.RegistryXMLReader.parse(RegistryXMLReader.java:133)

at weblogic.xml.jaxp.RegistryXMLReader.parse(RegistryXMLReader.java:145)

at
org.apache.ojb.broker.metadata.RepositoryPersistor.buildRepository(Repositor
yPersistor.java:296)

at
org.apache.ojb.broker.metadata.RepositoryPersistor.readDescriptorRepository(
RepositoryPersistor.java:207)

at
org.apache.ojb.broker.metadata.MetadataManager.init(MetadataManager.java:85)

... 31 more

It says "jdbc-connection-descriptor must be followed by either attribute
specifications, > or/>". Could I asume that my app has found the
repository_database.xml file or any posible cases?
Thanks a lot.

Leon


----- Original Message -----
From: "Armin Waibel" <ar...@code-au-lait.de>
To: "OJB Users List" <oj...@db.apache.org>
Sent: Monday, May 26, 2003 2:41 AM
Subject: Re: OJB, Eclipse and Weblogic


> Hi Leon,
>
> > Caused by: org.apache.ojb.broker.metadata.MetadataException: Could not
> read
> > jdbc-connection-descriptor data, using repository: repository.xml
> >
> > at
> >
> org.apache.ojb.broker.metadata.MetadataManager.init(MetadataManager.java
> :98)
>
> Seems your app has problems in finding the repository
> file (repository.xml) or one of the sub-files (repository_database.xml,
> ...).
>
> regards,
> Armin
>
>
> ----- Original Message -----
> From: "Leon" <le...@hotmail.com>
> To: "OJB Users List" <oj...@db.apache.org>
> Sent: Monday, May 26, 2003 5:15 AM
> Subject: OJB, Eclipse and Weblogic
>
>
> > Hi,
> >
> > I set OJB up on Weblogic with OjbPbStartup class posted on the OJB web
> site.
> > I got following errors when my DAO access to repository.xml.
> >
> > <May 25, 2003 11:02:27 PM EDT> <Error> <HTTP> <101017>
> > <[ServletContext(id=8931423,name=WebContent,context-path=/WebContent)]
> Root
> > cause of ServletException
> >
> > java.lang.ExceptionInInitializerError
> >
> > at
> >
> org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.buildDefa
> ultK
> > ey(PersistenceBrokerFactoryDefaultImpl.java:139)
> >
> > at
> >
> org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.<init>(Pe
> rsis
> > tenceBrokerFactoryDefaultImpl.java:110)
> >
> > at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
> >
> > at
> >
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorA
> cces
> > sorImpl.java:39)
> >
> > at
> >
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingCons
> truc
> > torAccessorImpl.java:27)
> >
> > at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
> >
> > at java.lang.Class.newInstance0(Class.java:306)
> >
> > at java.lang.Class.newInstance(Class.java:259)
> >
> > at
> >
> org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.init(Persiste
> nceB
> > rokerFactoryFactory.java:94)
> >
> > at
> >
> org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.<clinit>(Pers
> iste
> > nceBrokerFactoryFactory.java:71)
> >
> > at
> org.apache.ojb.weblogic.OjbPbStartup.getInstance(OjbPbStartup.java:42)
> >
> > at
> com.xegle.systems.registry.dao.RegistryDAO.insert(RegistryDAO.java:52)
> >
> > at
> >
> com.xegle.systems.registry.RegistryManagerBD.addRegistryInfo(RegistryMan
> ager
> > BD.java:29)
> >
> > at
> >
> com.xegle.systems.struts.registry.RegistryAction.execute(RegistryAction.
> java
> > :48)
> >
> > at
> >
> org.apache.struts.action.RequestProcessor.processActionPerform(RequestPr
> oces
> > sor.java:480)
> >
> > at
> >
> org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:
> 274)
> >
> > at
> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1420)
> >
> > at
> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:520)
> >
> > at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
> >
> > at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> >
> > at
> >
> weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(Se
> rvle
> > tStubImpl.java:1058)
> >
> > at
> >
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.
> java
> > :401)
> >
> > at
> >
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.
> java
> > :306)
> >
> > at
> >
> weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.r
> un(W
> > ebAppServletContext.java:5445)
> >
> > at
> >
> weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceMa
> nage
> > r.java:780)
> >
> > at
> >
> weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServl
> etCo
> > ntext.java:3105)
> >
> > at
> >
> weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.
> java
> > :2588)
> >
> > at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)
> >
> > at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)
> >
> > Caused by: org.apache.ojb.broker.metadata.MetadataException: Could not
> read
> > jdbc-connection-descriptor data, using repository: repository.xml
> >
> > at
> >
> org.apache.ojb.broker.metadata.MetadataManager.init(MetadataManager.java
> :98)
> >
> > at
> >
> org.apache.ojb.broker.metadata.MetadataManager.<init>(MetadataManager.ja
> va:7
> > 6)
> >
> > at
> >
> org.apache.ojb.broker.metadata.MetadataManager.<clinit>(MetadataManager.
> java
> > :67)
> >
> > ... 29 more
> >
> > Caused by: java.lang.NullPointerException
> >
> > at
> weblogic.apache.xerces.framework.XMLParser.parse(XMLParser.java:1151)
> >
> > at
> weblogic.xml.jaxp.WebLogicXMLReader.parse(WebLogicXMLReader.java:135)
> >
> > at
> weblogic.xml.jaxp.RegistryXMLReader.parse(RegistryXMLReader.java:133)
> >
> > at
> weblogic.xml.jaxp.RegistryXMLReader.parse(RegistryXMLReader.java:145)
> >
> > at
> >
> org.apache.ojb.broker.metadata.RepositoryPersistor.buildRepository(Repos
> itor
> > yPersistor.java:307)
> >
> > at
> >
> org.apache.ojb.broker.metadata.RepositoryPersistor.readConnectionReposit
> ory(
> > RepositoryPersistor.java:220)
> >
> > at
> >
> org.apache.ojb.broker.metadata.MetadataManager.init(MetadataManager.java
> :94)
> >
> > ... 31 more
> >
> > >
> >
> > My repository.xml is
> >
> > <!-- defining entities for include-files -->
> >
> > <!DOCTYPE descriptor-repository SYSTEM "repository.dtd" [
> >
> > <!ENTITY database SYSTEM "repository_database.xml">
> >
> > <!ENTITY internal SYSTEM "repository_internal.xml">
> >
> > <!ENTITY user SYSTEM "repository_user.xml">
> >
> > ]>
> >
> > <descriptor-repository version="1.0"
> isolation-level="read-uncommitted">
> >
> > <!-- include all used database connections -->
> >
> > &database;
> >
> > <!-- include ojb internal mappings here -->
> >
> > &internal;
> >
> > <!-- include mappings for JUnit tests -->
> >
> > <!-- This could be removed (with <!ENTITY entry), if junit test suite
> was
> > not used -->
> >
> > <!-- &junit; -->
> >
> > <!-- include user defined mappings here -->
> >
> > &user;
> >
> > <!-- include mappings for the EJB-examples -->
> >
> > <!-- &ejb; -->
> >
> > <!-- include mappings for the JDO tutorials -->
> >
> > <!-- &jdo; -->
> >
> > </descriptor-repository>
> >
> > My repository_database.xml is
> >
> > <!-- Datasource example -->
> >
> > <jdbc-connection-descriptor
> >
> > platform="MySQL"
> >
> > jdbc-level="2.0"
> >
> > driver="org.gjt.mm.mysql.Driver"
> >
> > protocol="jdbc"
> >
> > subprotocol="mysql://localhost:3306/xegledb"
> >
> > dbalias="xegledb"
> >
> > username="admin"
> >
> > password="adminwu"
> >
> > useAutoCommit="0" >
> >
> > <sequence-manager
> >
> className="org.apache.ojb.broker.util.sequence.SequenceManagerNextValImp
> l">
> >
> > <attribute attribute-name="grabSize" attribute-value="20"/>
> >
> > </sequence-manager>
> >
> > </jdbc-connection-descriptor >
> >
> > Anyone could help me to fix it?
> >
> > Thanks.
> >
> >
> >
> > Leon
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> > For additional commands, e-mail: ojb-user-help@db.apache.org
> >
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>

Re: OJB, Eclipse and Weblogic

Posted by Armin Waibel <ar...@code-au-lait.de>.
Hi Leon,

> Caused by: org.apache.ojb.broker.metadata.MetadataException: Could not
read
> jdbc-connection-descriptor data, using repository: repository.xml
>
> at
>
org.apache.ojb.broker.metadata.MetadataManager.init(MetadataManager.java
:98)

Seems your app has problems in finding the repository
file (repository.xml) or one of the sub-files (repository_database.xml,
...).

regards,
Armin


----- Original Message -----
From: "Leon" <le...@hotmail.com>
To: "OJB Users List" <oj...@db.apache.org>
Sent: Monday, May 26, 2003 5:15 AM
Subject: OJB, Eclipse and Weblogic


> Hi,
>
> I set OJB up on Weblogic with OjbPbStartup class posted on the OJB web
site.
> I got following errors when my DAO access to repository.xml.
>
> <May 25, 2003 11:02:27 PM EDT> <Error> <HTTP> <101017>
> <[ServletContext(id=8931423,name=WebContent,context-path=/WebContent)]
Root
> cause of ServletException
>
> java.lang.ExceptionInInitializerError
>
> at
>
org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.buildDefa
ultK
> ey(PersistenceBrokerFactoryDefaultImpl.java:139)
>
> at
>
org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.<init>(Pe
rsis
> tenceBrokerFactoryDefaultImpl.java:110)
>
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
>
> at
>
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorA
cces
> sorImpl.java:39)
>
> at
>
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingCons
truc
> torAccessorImpl.java:27)
>
> at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
>
> at java.lang.Class.newInstance0(Class.java:306)
>
> at java.lang.Class.newInstance(Class.java:259)
>
> at
>
org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.init(Persiste
nceB
> rokerFactoryFactory.java:94)
>
> at
>
org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.<clinit>(Pers
iste
> nceBrokerFactoryFactory.java:71)
>
> at
org.apache.ojb.weblogic.OjbPbStartup.getInstance(OjbPbStartup.java:42)
>
> at
com.xegle.systems.registry.dao.RegistryDAO.insert(RegistryDAO.java:52)
>
> at
>
com.xegle.systems.registry.RegistryManagerBD.addRegistryInfo(RegistryMan
ager
> BD.java:29)
>
> at
>
com.xegle.systems.struts.registry.RegistryAction.execute(RegistryAction.
java
> :48)
>
> at
>
org.apache.struts.action.RequestProcessor.processActionPerform(RequestPr
oces
> sor.java:480)
>
> at
>
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:
274)
>
> at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1420)
>
> at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:520)
>
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
>
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>
> at
>
weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(Se
rvle
> tStubImpl.java:1058)
>
> at
>
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.
java
> :401)
>
> at
>
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.
java
> :306)
>
> at
>
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.r
un(W
> ebAppServletContext.java:5445)
>
> at
>
weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceMa
nage
> r.java:780)
>
> at
>
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServl
etCo
> ntext.java:3105)
>
> at
>
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.
java
> :2588)
>
> at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)
>
> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)
>
> Caused by: org.apache.ojb.broker.metadata.MetadataException: Could not
read
> jdbc-connection-descriptor data, using repository: repository.xml
>
> at
>
org.apache.ojb.broker.metadata.MetadataManager.init(MetadataManager.java
:98)
>
> at
>
org.apache.ojb.broker.metadata.MetadataManager.<init>(MetadataManager.ja
va:7
> 6)
>
> at
>
org.apache.ojb.broker.metadata.MetadataManager.<clinit>(MetadataManager.
java
> :67)
>
> ... 29 more
>
> Caused by: java.lang.NullPointerException
>
> at
weblogic.apache.xerces.framework.XMLParser.parse(XMLParser.java:1151)
>
> at
weblogic.xml.jaxp.WebLogicXMLReader.parse(WebLogicXMLReader.java:135)
>
> at
weblogic.xml.jaxp.RegistryXMLReader.parse(RegistryXMLReader.java:133)
>
> at
weblogic.xml.jaxp.RegistryXMLReader.parse(RegistryXMLReader.java:145)
>
> at
>
org.apache.ojb.broker.metadata.RepositoryPersistor.buildRepository(Repos
itor
> yPersistor.java:307)
>
> at
>
org.apache.ojb.broker.metadata.RepositoryPersistor.readConnectionReposit
ory(
> RepositoryPersistor.java:220)
>
> at
>
org.apache.ojb.broker.metadata.MetadataManager.init(MetadataManager.java
:94)
>
> ... 31 more
>
> >
>
> My repository.xml is
>
> <!-- defining entities for include-files -->
>
> <!DOCTYPE descriptor-repository SYSTEM "repository.dtd" [
>
> <!ENTITY database SYSTEM "repository_database.xml">
>
> <!ENTITY internal SYSTEM "repository_internal.xml">
>
> <!ENTITY user SYSTEM "repository_user.xml">
>
> ]>
>
> <descriptor-repository version="1.0"
isolation-level="read-uncommitted">
>
> <!-- include all used database connections -->
>
> &database;
>
> <!-- include ojb internal mappings here -->
>
> &internal;
>
> <!-- include mappings for JUnit tests -->
>
> <!-- This could be removed (with <!ENTITY entry), if junit test suite
was
> not used -->
>
> <!-- &junit; -->
>
> <!-- include user defined mappings here -->
>
> &user;
>
> <!-- include mappings for the EJB-examples -->
>
> <!-- &ejb; -->
>
> <!-- include mappings for the JDO tutorials -->
>
> <!-- &jdo; -->
>
> </descriptor-repository>
>
> My repository_database.xml is
>
> <!-- Datasource example -->
>
> <jdbc-connection-descriptor
>
> platform="MySQL"
>
> jdbc-level="2.0"
>
> driver="org.gjt.mm.mysql.Driver"
>
> protocol="jdbc"
>
> subprotocol="mysql://localhost:3306/xegledb"
>
> dbalias="xegledb"
>
> username="admin"
>
> password="adminwu"
>
> useAutoCommit="0" >
>
> <sequence-manager
>
className="org.apache.ojb.broker.util.sequence.SequenceManagerNextValImp
l">
>
> <attribute attribute-name="grabSize" attribute-value="20"/>
>
> </sequence-manager>
>
> </jdbc-connection-descriptor >
>
> Anyone could help me to fix it?
>
> Thanks.
>
>
>
> Leon
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
>