-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: problem parsing hibernate.cfg.xml in weblogic
PostPosted: Wed Jul 15, 2009 11:49 am 
Newbie

Joined: Wed Jul 15, 2009 11:33 am
Posts: 2
Hi All,
I'm trying to make hibernate work as part of my app which is running in weblogic 8.1.3 . when I run hibernate as a standalone it has no probs, but when i'm running in as part of my app I'm running into some XML parsing issue! I have tried to change it to various SAX parsers from the regular xerces.jar to crimson.jar but I always keep getting the same problem.

I have all my required jar files under the WEB-INF/lib
crimson.jar
xercesImpl.jar
ehcache-1.1.jar
antlr-2.7.4.jar
cglib-full-2.0.2.jar
dom4j-1.5.2.jar
hibernate3.jar
jta.jar
xml-apis.jar
Please let me know if I'm missing any other jar files here.


Here is the error stacktrace.

11:20:21,537 [ExecuteThread: '23' for queue: 'weblogic.kernel.Default'] ERROR cfg.Configuration - problem parsing configuration/hibernate.cfg.xml
org.dom4j.DocumentException: SAX2 driver class org.apache.crimson.parser.XMLReaderImpl does not implement XMLReader Nested exception: SAX2 driver class org.apache.crimson.parser.XMLReaderImpl does not implement XMLReader
at org.dom4j.io.SAXReader.read(SAXReader.java:353)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1286)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1230)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1216)
at com.myapp.maintenance.ui.hibernate.HibernateCall.invokeHibernate(HibernateCall.java:33)
at com.myapp.ui.struts.action.HibernateAction.execute(HibernateAction.java:101)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
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(ServletStubImpl.java:996)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
at com.cybersource.risk.otf.ui.filter.AuditFilter.doFilter(AuditFilter.java:63)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
at com.cybersource.risk.otf.ui.filter.TimeZoneFilter.doFilter(TimeZoneFilter.java:80)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
at com.cybersource.risk.otf.ui.filter.RoleManagementFilter.doFilter(RoleManagementFilter.java:139)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6458)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3661)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2630)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
Nested exception:
java.lang.ClassCastException
at org.dom4j.io.SAXHelper.createXMLReader(SAXHelper.java:83)
at org.dom4j.io.SAXReader.createXMLReader(SAXReader.java:650)
at org.dom4j.io.SAXReader.getXMLReader(SAXReader.java:525)
at org.dom4j.io.SAXReader.read(SAXReader.java:311)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1286)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1230)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1216)
at com.myapp.maintenance.ui.hibernate.HibernateCall.invokeHibernate(HibernateCall.java:33)
at com.myapp.ui.struts.action.HibernateAction.execute(HibernateAction.java:101)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
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(ServletStubImpl.java:996)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
at com.cybersource.risk.otf.ui.filter.AuditFilter.doFilter(AuditFilter.java:63)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
at com.cybersource.risk.otf.ui.filter.TimeZoneFilter.doFilter(TimeZoneFilter.java:80)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
at com.cybersource.risk.otf.ui.filter.RoleManagementFilter.doFilter(RoleManagementFilter.java:139)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6458)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3661)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2630)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)


Top
 Profile  
 
 Post subject: Re: problem parsing hibernate.cfg.xml in weblogic
PostPosted: Thu Jul 16, 2009 2:43 am 
Newbie

Joined: Mon Dec 29, 2008 9:48 am
Posts: 6
This is a bit of a shot in the dark (I don't work with weblogic myself) but maybe trying to specify the xml reader yourself will fix that. You can try setting the system property "org.xml.sax.driver". Either by calling
System.setProperty("org.xml.sax.driver", "org.apache.crimson.parser.XMLReaderImpl")
Or by launching WebLogic with
-Dorg.xml.sax.driver=org.apache.crimson.parser.XMLReaderImpl

The value I used here (org.apache.crimson.parser.XMLReaderImpl) is one that solved similar problems for me in the past, I'm not sure it's the one you need...

Alternatively, it's possible that WebLogic loads its libraries before loading your application libraries, which might affect the behavior. There should be some option to configure it to load application libraries first, and only then WebLogic's libraries.


Top
 Profile  
 
 Post subject: Re: problem parsing hibernate.cfg.xml in weblogic
PostPosted: Thu Jul 16, 2009 8:18 am 
Newbie

Joined: Wed Jul 15, 2009 11:33 am
Posts: 2
ozlevanon wrote:
This is a bit of a shot in the dark (I don't work with weblogic myself) but maybe trying to specify the xml reader yourself will fix that. You can try setting the system property "org.xml.sax.driver". Either by calling
System.setProperty("org.xml.sax.driver", "org.apache.crimson.parser.XMLReaderImpl")
Or by launching WebLogic with
-Dorg.xml.sax.driver=org.apache.crimson.parser.XMLReaderImpl

The value I used here (org.apache.crimson.parser.XMLReaderImpl) is one that solved similar problems for me in the past, I'm not sure it's the one you need...

Alternatively, it's possible that WebLogic loads its libraries before loading your application libraries, which might affect the behavior. There should be some option to configure it to load application libraries first, and only then WebLogic's libraries.


thank you for your reply!
I did set the system property by adding the -D property with various xml drivers, but when I do that, it still keeps throwing the same error message, except the change in the driver class name.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.