Hi,
I am running an application with hibernate on Eclipse platform. While testing with JUnit test case, I get an exception. I am using jdk1.5 and hibernate3. I am using MySQL database. I have included xml-apis.jar in the class path. Still it is giving the following exception:
INFO: Configuration resource: /hibernate.cfg.xml
Warning: Caught exception attempting to use SAX to load a SAX XMLReader
Warning: Exception was: java.lang.IllegalAccessException: Class org.xml.sax.helpers.NewInstance can not access a member of class org.orbeon.oxf.xml.XercesSAXParser with modifiers "public"
Warning: I will print the stack trace then carry on using the default SAX parser
java.lang.IllegalAccessException: Class org.xml.sax.helpers.NewInstance can not access a member of class org.orbeon.oxf.xml.XercesSAXParser with modifiers "public"
at org.xml.sax.helpers.XMLReaderFactory.loadClass(Unknown Source)
at org.xml.sax.helpers.XMLReaderFactory.createXMLReader(Unknown Source)
at org.dom4j.io.SAXHelper.createXMLReader(SAXHelper.java:74)
at org.dom4j.io.SAXReader.createXMLReader(SAXReader.java:647)
at org.dom4j.io.SAXReader.getXMLReader(SAXReader.java:530)
at org.dom4j.io.SAXReader.read(SAXReader.java:309)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1297)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1241)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1227)
at com.stabilix.utils.HibernateUtil.<clinit>(HibernateUtil.java:19)
at com.stabilix.hibernate.TestConnection.setUp(TestConnection.java:16)
at junit.framework.TestCase.runBare(TestCase.java:125)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
May 23, 2006 5:01:18 PM com.stabilix.utils.HibernateUtil <clinit>
SEVERE: Initial SessionFactory creation failed.
org.hibernate.HibernateException: Could not parse configuration: /hibernate.cfg.xml
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1307)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1241)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1227)
at com.stabilix.utils.HibernateUtil.<clinit>(HibernateUtil.java:19)
at com.stabilix.hibernate.TestConnection.setUp(TestConnection.java:16)
at junit.framework.TestCase.runBare(TestCase.java:125)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: org.dom4j.DocumentException: Could not initialize a SAX Parser. Please add a SAX parser to your classpath along with preferably jaxp.jar Nested exception: Could not initialize a SAX Parser. Please add a SAX parser to your classpath along with preferably jaxp.jar
at org.dom4j.io.SAXReader.read(SAXReader.java:358)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1297)
... 14 more
Please help in solving my problem.
Thanks in advance Merin
|