It turns out that my application was picking up an old repository.xml,
one that was actually just the user fragment. So, it started with a
class-descriptor. Since there was no DTD declared in the file, there
was no default value for isolation-level and, thus, the parser returned
null. Definitely an error on my part, but until I recompiled the code
with debugging on, I didn't even get an error message telling me what
was wrong with the file. So, I think that a change to trap and report
null values in the parsing would be very helpful.
Thanks for looking into this.
Armin Waibel wrote:
Hi
again,
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]
--
signature
Larry V. Streepy, Jr.
Senior Vice President and CTO
|
"We speak the
language of healthcare" ™ |
Direct: +1
425-373-0600
Fax: +1 425-373-1633
Corp.: +1 303-307-4400
Health Language, Inc.
3950 Lewiston Street, Suite 210
Aurora, Colorado 80011 |
The information in this email message is
intended only
for the use of
the intended recipient and may contain confidential information. Any
unauthorized review, use, disclosure or distribution is strictly
prohibited. If you are not the intended addressee, please promptly
delete this message and notify the sender of the delivery error by
e-mail or you may call Health Language's corporate offices in Aurora,
Colorado USA at (+1) 303-307-4400.
|
|