Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate SunOne configuration NoClassDefFoundError

 
Adnan Badar
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I am getting problem while configuring Hibernate with SunOne7 as well as Oracle9iAS. It works fine when I put all hibernate required jar files in SunOne JVM classpath, sunone is not picking hibernate jars from mywebapp\web-inf\lib directory. I dont want to put paths in classpath of application server. Below is the exception that I always get when I dont place entries in classpath:


Sun ONE Application Server - HTTP Status 500 Error
The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.

Type: Exception Report

Message: Internal Server Error

Exception

javax.servlet.ServletException: com/mchange/v2/c3p0/PoolConfig
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:478)
at _jasper._testHibernate_jsp._jspService(_testHibernate_jsp.java:90)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.iplanet.ias.web.jsp.JspServlet$JspServletWrapper.service(JspServlet.java:552)
at com.iplanet.ias.web.jsp.JspServlet.serviceJspFile(JspServlet.java:368)
at com.iplanet.ias.web.jsp.JspServlet.service(JspServlet.java:287)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:720)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:309)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:203)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:158)
at com.iplanet.ias.web.WebContainer.service(WebContainer.java:598)



Root Cause
java.lang.NoClassDefFoundError: com/mchange/v2/c3p0/PoolConfig
at net.sf.hibernate.connection.C3P0ConnectionProvider.configure(C3P0ConnectionProvider.java:75)
at net.sf.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:83)
at net.sf.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:76)
at net.sf.hibernate.cfg.Configuration.buildSettings(Configuration.java:1160)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:794)
at ae.gov.dm.bpcs.dao.hibernate.Config.(Config.java:33)
at ae.gov.dm.bpcs.dao.hibernate.Config.(Config.java:25)
at ae.gov.dm.bpcs.dao.hibernate.ThreadSession.(ThreadSession.java:32)
at ae.gov.dm.bpcs.dao.hibernate.ThreadSession.(ThreadSession.java:23)
at ae.gov.dm.bpcs.dao.hibernate.EmployeeDAOHibernateImp.getEducation(EmployeeDAOHibernateImp.java:59)
at _jasper._testHibernate_jsp._jspService(_testHibernate_jsp.java:68)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.iplanet.ias.web.jsp.JspServlet$JspServletWrapper.service(JspServlet.java:552)
at com.iplanet.ias.web.jsp.JspServlet.serviceJspFile(JspServlet.java:368)
at com.iplanet.ias.web.jsp.JspServlet.service(JspServlet.java:287)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:720)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:309)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:203)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:158)
at com.iplanet.ias.web.WebContainer.service(WebContainer.java:598)


*****************************************************
SOME TIMES I GET:::
*****************************************************

INFO: CORE3282: stdout: <========Configuring========>
WARNING: CORE3283: stderr: log4j:WARN No appenders could be found for logger (ne
t.sf.hibernate.cfg.Environment).
WARNING: CORE3283: stderr: log4j:WARN Please initialize the log4j system properl
y.
INFO: CORE3282: stdout: jdbc racle:thin:@10.0.21.203:1521:BPCS1
INFO: CORE3282: stdout: <========Building Session Factory========>
SEVERE: StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw excep
tion
javax.servlet.ServletException: com/mchange/v2/c3p0/PoolConfig
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageCon
textImpl.java:478)
at _jasper._testHibernate_jsp._jspService(_testHibernate_jsp.java:90)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.iplanet.ias.web.jsp.JspServlet$JspServletWrapper.service(JspServl
et.java:552)
at com.iplanet.ias.web.jsp.JspServlet.serviceJspFile(JspServlet.java:368
)
at com.iplanet.ias.web.jsp.JspServlet.service(JspServlet.java:287)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.StandardWrapperValve.invokeServletService(St
andardWrapperValve.java:720)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:309)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:505)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:212)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:505)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:203)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:505)
at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProce
ssor.java:158)
at com.iplanet.ias.web.WebContainer.service(WebContainer.java:598)
----- Root Cause -----
java.lang.NoClassDefFoundError: com/mchange/v2/c3p0/PoolConfig
at net.sf.hibernate.connection.C3P0ConnectionProvider.configure(C3P0Conn
ectionProvider.java:75)
at net.sf.hibernate.connection.ConnectionProviderFactory.newConnectionPr
ovider(ConnectionProviderFactory.java:83)
at net.sf.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.ja
va:76)
at net.sf.hibernate.cfg.Configuration.buildSettings(Configuration.java:1
160)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.
java:794)
at ae.gov.dm.bpcs.dao.hibernate.Config.<init>(Config.java:33)
at ae.gov.dm.bpcs.dao.hibernate.Config.<clinit>(Config.java:25)
at ae.gov.dm.bpcs.dao.hibernate.ThreadSession.<init>(ThreadSession.java:
32)
at ae.gov.dm.bpcs.dao.hibernate.ThreadSession.<clinit>(ThreadSession.jav
a:23)
at ae.gov.dm.bpcs.dao.hibernate.EmployeeDAOHibernateImp.getEducation(Emp
loyeeDAOHibernateImp.java:59)
at _jasper._testHibernate_jsp._jspService(_testHibernate_jsp.java:68)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.iplanet.ias.web.jsp.JspServlet$JspServletWrapper.service(JspServl
et.java:552)
at com.iplanet.ias.web.jsp.JspServlet.serviceJspFile(JspServlet.java:368
)
at com.iplanet.ias.web.jsp.JspServlet.service(JspServlet.java:287)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.StandardWrapperValve.invokeServletService(St
andardWrapperValve.java:720)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:309)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:505)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:212)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:505)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:203)
at org.apache.cat
SEVERE: alina.core.StandardPipeline.invoke(StandardPipeline.java:505)
at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProce
ssor.java:158)
at com.iplanet.ias.web.WebContainer.service(WebContainer.java:598)


I found problem with connection pooler C3P0.JAR . When I extracted this jar file and placed all class files in SunOne <webApp>/web-inf/classes folder hibernate is working fine without any JVM classpath settings.

Any idea about this problem? what is the basic problem?

Thanks in advance
[ February 16, 2005: Message edited by: adnanssd badarsd ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic