当我针对 oracle 数据库运行我的代码时,我收到以下错误:
Error parsing XML (31) : http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd<Line 31, Column 2>: XML-20068: (Fatal Error) content model is not deterministic
[07 Aug 2012 14:41:36,643](UTC 20:41:36) WARN ApplicationLifecycle | Unable to install module at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: org.hibernate.InvalidMappingException: Unable to read XML
at org.hibernate.util.xml.MappingReader.readMappingDocument(MappingReader.java:101)
at org.hibernate.cfg.Configuration.add(Configuration.java:513)
at org.hibernate.cfg.Configuration.add(Configuration.java:509)
at org.hibernate.cfg.Configuration.add(Configuration.java:716)
at org.hibernate.cfg.Configuration.addResource(Configuration.java:801)
at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:2344)
at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:2310)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:2290)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:2243)
at org.hibernate.cfg.Configuration.configure(Configuration.java:2158)
Caused by: org.dom4j.DocumentException: Error on line 31 of document http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd : http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd<Line 31, Column 2>: XML-20068: (Fatal Error) content model is not deterministic Nested exception: http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd<Line 31, Column 2>: XML-20068: (Fatal Error) content model is not deterministic
at org.dom4j.io.SAXReader.read(SAXReader.java:482)
at org.hibernate.util.xml.MappingReader.readMappingDocument(MappingReader.java:75)
... 20 more
主要错误是Error parsing XML (31) : http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd<Line 31, Column 2>: XML-20068: (Fatal Error) content model is not deterministic
然后当我删除 jar 时,xmlparserv2.jar
我会收到以下错误。
Caused by: java.lang.NoClassDefFoundError: oracle/xml/parser/v2/XMLParseException
at oracle.jdbc.driver.OracleSQLXML.setString(OracleSQLXML.java:415)
at com.capitaliq.loader.persistence.messaging.QueueUtils$1FlushMessages.execute(QueueUtils.java:358)
at com.capitaliq.loader.persistence.messaging.QueueUtils.flushMessages(QueueUtils.java:378)
at com.capitaliq.loader.persistence.AbstractControlFacadeHelper$ControlFacadeRetrier.performOperation(AbstractControlFacadeHelper.java:303)
at com.capitaliq.loader.persistence.AbstractRetryLimitedDurationWithTimout.retryContinuously(AbstractRetryLimitedDurationWithTimout.java:66)
at com.capitaliq.loader.persistence.AbstractControlFacadeHelper.performRetries(AbstractControlFacadeHelper.java:138)
... 12 more
Caused by: java.lang.ClassNotFoundException: oracle.xml.parser.v2.XMLParseException
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
... 18 more
at com.capitaliq.loader.control.ClientManager$HeartbeatCity.safeRun(ClientManager.java:429)
at com.capitaliq.common.thread.SafeRunnable.run(SafeRunnable.java:57)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.NoClassDefFoundError: oracle/xml/parser/v2/XMLParseException
at oracle.jdbc.driver.OracleSQLXML.setString(OracleSQLXML.java:415)
... 12 more
Caused by: java.lang.ClassNotFoundException: oracle.xml.parser.v2.XMLParseException
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
... 18 more
Caused by: oracle.xml.parser.v2.XMLParseException
从堆栈跟踪中,我可以推断我需要在我的类路径中有这个 jar 来读取 xml,但我不能拥有它,因为它与我的 hibernate 版本不兼容。在升级到 Hibernate 3.6 之前,我没有出现此错误。我的问题是,有人以前有过这种情况吗?还有另一个与 oracle 数据库一起使用的 xmlparser 吗?
如果我针对 SQL 数据库运行我的代码,如果 jar 在类路径上,我会得到同样的错误。但是,如果我删除一切正常。所以我知道这与 oracle 数据库有关。有人有什么建议吗?