maybe the problem could be the isolation-level set on descriptor-repository element level (repository.xml file), this level is used as default level in class-descriptor.
Do you set isolation-level attribute on this level? How does your repository.xml file look like?
Should be something like that:
....
<descriptor-repository version="1.0" isolation-level="read-uncommitted"
proxy-prefetching-limit="50"> <!-- include all used database connections -->
&database; <!-- include ojb internal mappings here -->
&internal; <!-- include user defined mappings here -->
&user;
</descriptor-repository>It's also possible to include all mappings in the repository.xml file without using !ENTITY-references.
When I run in debug mode I get
[org.apache.ojb.broker.metadata.RepositoryXmlHandler] DEBUG: startDoc
[org.apache.ojb.broker.metadata.RepositoryXmlHandler] DEBUG: proxy-prefetching-limit: 50
[org.apache.ojb.broker.metadata.RepositoryXmlHandler] DEBUG: > descriptor-repository
...
You get:
[org.apache.ojb.broker.metadata.RepositoryXmlHandler] DEBUG: startDoc
[org.apache.ojb.broker.metadata.RepositoryXmlHandler] DEBUG: > class-descriptor
[org.apache.ojb.broker.metadata.RepositoryXmlHandler] DEBUG: isolation-level: null
java.lang.ExceptionInInitializerError
regards, Armin
Armin Waibel wrote:
Hi Larry,
hmm, stack trace says:
Caused by: org.apache.ojb.broker.metadata.MetadataException: Can not read repository class descriptor data, using repository: repository_user.xml
and
[org.apache.ojb.broker.metadata.RepositoryXmlHandler] DEBUG: > class-descriptor
[org.apache.ojb.broker.metadata.RepositoryXmlHandler] DEBUG: isolation-level: null
Seems your parser returns 'null' when attribute is not set or do you set the class-descriptor 'isolation-level' attribute?
RepositoryXmlHandler does not check for 'null', seems other parser return an empty string instead of 'null'. Will check in a fix ASAP.
regards, Armin
Larry V. Streepy, Jr. wrote:
Please ignore the last posting, it was the same file by mistake :-( The attached file contains the stack trace with debug information enabled.
Thanks.
Larry V. Streepy, Jr. wrote:
I've got a very strange error cropping up when I try to run a simple test program for OJB. Note that I can build and execute the JUnit tests using the distribution and things work fine. However, when I construct a simple batch file to include all the jar files from the ojb "lib" directory and add in the directory that contains the properties files I get a NullPointer exception during the parse due to "isolation-level" being null. Now this appears to be an internal table lookup, so I'm not sure how it can fail. Also, I copied the repository.xml file from the OJB distribution as my starting point, so the isolation-level attribute is being properly specified. I've attached the debug output and the exception trace below. Any help or insights would be appreciated.
Thanks.
-- Larry V. Streepy, Jr. Senior Vice President and CTO Health Language, Inc.
------------------------------------------------------------------------
[org.apache.ojb.broker.metadata.RepositoryXmlHandler] DEBUG: startDoc
[org.apache.ojb.broker.metadata.RepositoryXmlHandler] DEBUG: > class-descriptor
[org.apache.ojb.broker.metadata.RepositoryXmlHandler] DEBUG: isolation-level: null
java.lang.ExceptionInInitializerError
at org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl.getDefaultKey(PersistenceBrokerFactoryBaseImpl.java:114)
at org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl.defaultPersistenceBroker(PersistenceBrokerFactoryBaseImpl.java:196)
at org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker(PersistenceBrokerFactory.java:104)
at com.staffmix.nurse.play.Application.<init>(Application.java:25)
at com.staffmix.nurse.play.Application.main(Application.java:56)
Caused by: org.apache.ojb.broker.metadata.MetadataException: Can not read repository class descriptor data, using repository: repository_user.xml
at org.apache.ojb.broker.metadata.MetadataManager.init(MetadataManager.java:135)
at org.apache.ojb.broker.metadata.MetadataManager.<init>(MetadataManager.java:121)
at org.apache.ojb.broker.metadata.MetadataManager.<clinit>(MetadataManager.java:110)
... 5 more
Caused by: org.apache.ojb.broker.metadata.MetadataException: Exception when reading metadata information, please check your repository.xml file
at org.apache.ojb.broker.metadata.RepositoryXmlHandler.startElement(RepositoryXmlHandler.java:953)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRootElementHook(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.ojb.broker.metadata.RepositoryPersistor.readMetadataFromXML(RepositoryPersistor.java:343)
at org.apache.ojb.broker.metadata.RepositoryPersistor.buildRepository(RepositoryPersistor.java:300)
at org.apache.ojb.broker.metadata.RepositoryPersistor.readDescriptorRepository(RepositoryPersistor.java:215)
at org.apache.ojb.broker.metadata.MetadataManager.init(MetadataManager.java:131)
... 7 more
Caused by: java.lang.NullPointerException
at org.apache.ojb.broker.metadata.RepositoryXmlHandler.getIsoLevel(RepositoryXmlHandler.java:1174)
at org.apache.ojb.broker.metadata.RepositoryXmlHandler.startElement(RepositoryXmlHandler.java:223)
... 21 more
------------------------------------------------------------------------
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
