Note that there are some explanatory texts on larger screens.

plurals
  1. POjava.lang.NoClassDefFoundError: org/hibernate/Session hibernate jars is set
    primarykey
    data
    text
    <p>I inherited several projects Javas in my new job, but I'm having some problems with settings. I'm facing a problem that is researched so common. "java.lang.NoClassDefFoundError: org / hibernate / Session", put all the jars even unnecessary hibernate are mapped in the classpath. </p> <p>Im using tomcat 7, hirbernat 4, jre7.</p> <p>every project extends compnet that have all necessary jars in lib folder.</p> <p>do i need to put those already mapped jars in this project ?</p> <p>The erro is catch here:</p> <pre><code> @Override public void init(ServletConfig config) throws ServletException { super.init(config); HibernateUtil.currentSession(); } </code></pre> <p>classpath:</p> <pre><code>&lt;classpathentry kind="src" path="src"/&gt; &lt;classpathentry exported="true" kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/&gt; &lt;classpathentry exported="true" kind="lib" path="/Compnet/lib/xstream 1.3/xpp3_min-1.1.4c.jar"&gt; &lt;attributes&gt; &lt;attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/&gt; &lt;/attributes&gt; &lt;/classpathentry&gt; &lt;classpathentry exported="true" kind="lib" path="/Compnet/lib/xstream 1.3/xstream-1.3.1.jar"&gt; &lt;attributes&gt; &lt;attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/&gt; &lt;/attributes&gt; &lt;/classpathentry&gt; &lt;classpathentry exported="true" kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v6.0"/&gt; &lt;classpathentry exported="true" kind="lib" path="/Compnet/lib/commons fileupload 1.2.1/commons-fileupload-1.2.1.jar"&gt; &lt;attributes&gt; &lt;attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/&gt; &lt;/attributes&gt; &lt;/classpathentry&gt; &lt;classpathentry exported="true" kind="lib" path="/Compnet/lib/hibernate 3/antlr.jar"&gt; &lt;attributes&gt; &lt;attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/&gt; &lt;/attributes&gt; &lt;/classpathentry&gt; &lt;classpathentry exported="true" kind="lib" path="/Compnet/lib/hibernate 3/commons-collections.jar"&gt; &lt;attributes&gt; &lt;attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/&gt; &lt;/attributes&gt; &lt;/classpathentry&gt; &lt;classpathentry exported="true" kind="lib" path="/Compnet/lib/hibernate 3/dom4j.jar"&gt; &lt;attributes&gt; &lt;attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/&gt; &lt;/attributes&gt; &lt;/classpathentry&gt; &lt;classpathentry exported="true" kind="lib" path="/Compnet/lib/hibernate 3/ejb3-persistence.jar"&gt; &lt;attributes&gt; &lt;attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/&gt; &lt;/attributes&gt; &lt;/classpathentry&gt; &lt;classpathentry exported="true" kind="lib" path="/Compnet/lib/hibernate 3/hibernate-annotations.jar"&gt; &lt;attributes&gt; &lt;attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/&gt; &lt;/attributes&gt; &lt;/classpathentry&gt; &lt;classpathentry exported="true" kind="lib" path="/Compnet/lib/hibernate 3/hibernate-commons-annotations.jar"&gt; &lt;attributes&gt; &lt;attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/&gt; &lt;/attributes&gt; &lt;/classpathentry&gt; &lt;classpathentry exported="true" kind="lib" path="/Compnet/lib/hibernate 3/hibernate-validator.jar"&gt; &lt;attributes&gt; &lt;attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/&gt; &lt;/attributes&gt; &lt;/classpathentry&gt; &lt;classpathentry exported="true" kind="lib" path="/Compnet/lib/hibernate 3/hibernate3.jar"&gt; &lt;attributes&gt; &lt;attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/&gt; &lt;/attributes&gt; &lt;/classpathentry&gt; &lt;classpathentry exported="true" kind="lib" path="/Compnet/lib/hibernate 3/javassist.jar"&gt; &lt;attributes&gt; &lt;attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/&gt; &lt;/attributes&gt; &lt;/classpathentry&gt; &lt;classpathentry exported="true" kind="lib" path="/Compnet/lib/hibernate 3/jta.jar"&gt; &lt;attributes&gt; &lt;attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/&gt; &lt;/attributes&gt; &lt;/classpathentry&gt; &lt;classpathentry exported="true" kind="lib" path="/Compnet/lib/hibernate 3/jtds-1.2.4.jar"&gt; &lt;attributes&gt; &lt;attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/&gt; &lt;/attributes&gt; &lt;/classpathentry&gt; &lt;classpathentry exported="true" kind="lib" path="/Compnet/lib/hibernate 3/log4j.jar"&gt; &lt;attributes&gt; &lt;attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/&gt; &lt;/attributes&gt; &lt;/classpathentry&gt; &lt;classpathentry exported="true" kind="lib" path="/Compnet/lib/hibernate 3/slf4j-api.jar"&gt; &lt;attributes&gt; &lt;attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/&gt; &lt;/attributes&gt; &lt;/classpathentry&gt; &lt;classpathentry exported="true" kind="lib" path="/Compnet/lib/hibernate 3/slf4j-log4j12.jar"&gt; &lt;attributes&gt; &lt;attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/&gt; &lt;/attributes&gt; &lt;/classpathentry&gt; &lt;classpathentry exported="true" kind="lib" path="/Compnet/lib/commons logging/commons-logging-1.1.1.jar"&gt; &lt;attributes&gt; &lt;attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/&gt; &lt;/attributes&gt; &lt;/classpathentry&gt; &lt;classpathentry exported="true" kind="lib" path="/Compnet/lib/commons logging/commons-logging-adapters-1.1.jar"&gt; &lt;attributes&gt; &lt;attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/&gt; &lt;/attributes&gt; &lt;/classpathentry&gt; &lt;classpathentry exported="true" kind="lib" path="/Compnet/lib/commons logging/commons-logging-api-1.1.jar"&gt; &lt;attributes&gt; &lt;attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/&gt; &lt;/attributes&gt; &lt;/classpathentry&gt; &lt;classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/&gt; &lt;classpathentry combineaccessrules="false" exported="true" kind="src" path="/pkg_ocorrencia"/&gt; &lt;classpathentry combineaccessrules="false" exported="true" kind="src" path="/pkg_mandado"/&gt; &lt;classpathentry exported="true" kind="lib" path="/Compnet/lib/jasper - ireport 3.7.4/commons-beanutils-1.8.2.jar"&gt; &lt;attributes&gt; &lt;attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/&gt; &lt;/attributes&gt; &lt;/classpathentry&gt; &lt;classpathentry exported="true" kind="lib" path="/Compnet/lib/jasper - ireport 3.7.4/commons-digester-1.7.jar"&gt; &lt;attributes&gt; &lt;attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/&gt; &lt;/attributes&gt; &lt;/classpathentry&gt; &lt;classpathentry exported="true" kind="lib" path="/Compnet/lib/jasper - ireport 3.7.4/groovy-all-1.5.5.jar"&gt; &lt;attributes&gt; &lt;attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/&gt; &lt;/attributes&gt; &lt;/classpathentry&gt; &lt;classpathentry exported="true" kind="lib" path="/Compnet/lib/jasper - ireport 3.7.4/iText-2.1.0.jar"&gt; &lt;attributes&gt; &lt;attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/&gt; &lt;/attributes&gt; &lt;/classpathentry&gt; &lt;classpathentry exported="true" kind="lib" path="/Compnet/lib/jasper - ireport 3.7.4/jasperreports-3.7.4.jar"&gt; &lt;attributes&gt; &lt;attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/&gt; &lt;/attributes&gt; &lt;/classpathentry&gt; &lt;classpathentry exported="true" kind="lib" path="/Compnet/lib/jasper - ireport 3.7.4/jasperreports-chart-themes-3.7.4.jar"&gt; &lt;attributes&gt; &lt;attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/&gt; &lt;/attributes&gt; &lt;/classpathentry&gt; &lt;classpathentry exported="true" kind="lib" path="/Compnet/lib/jasper - ireport 3.7.4/jasperreports-extensions-3.5.3.jar"&gt; &lt;attributes&gt; &lt;attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/&gt; &lt;/attributes&gt; &lt;/classpathentry&gt; &lt;classpathentry exported="true" kind="lib" path="/Compnet/lib/jasper - ireport 3.7.4/jasperreports-fonts-3.7.4.jar"&gt; &lt;attributes&gt; &lt;attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/&gt; &lt;/attributes&gt; &lt;/classpathentry&gt; &lt;classpathentry exported="true" kind="lib" path="/Compnet/lib/jasper - ireport 3.7.4/spring.jar"&gt; &lt;attributes&gt; &lt;attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/&gt; &lt;/attributes&gt; &lt;/classpathentry&gt; &lt;classpathentry exported="true" kind="lib" path="/Compnet/lib/jasper - ireport 3.7.4/xalan.jar"&gt; &lt;attributes&gt; &lt;attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/&gt; &lt;/attributes&gt; &lt;/classpathentry&gt; &lt;classpathentry exported="true" kind="lib" path="/Compnet/lib/jasper - ireport 3.7.4/jfreechart-1.0.12.jar"&gt; &lt;attributes&gt; &lt;attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/&gt; &lt;/attributes&gt; &lt;/classpathentry&gt; &lt;classpathentry exported="true" kind="lib" path="/Compnet/lib/jasper - ireport 3.7.4/jcommon-1.0.15.jar"&gt; &lt;attributes&gt; &lt;attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/&gt; &lt;/attributes&gt; &lt;/classpathentry&gt; &lt;classpathentry combineaccessrules="false" kind="src" path="/Compnet"/&gt; &lt;classpathentry exported="true" kind="lib" path="/Compnet/lib/commons email 1.2/commons-email-1.2.jar"/&gt; &lt;classpathentry kind="lib" path="D:/Tomcat 7/apache-tomcat-7.0.27/lib/servlet-api.jar"/&gt; &lt;classpathentry kind="lib" path="/Compnet/lib/hibernate4/antlr-2.7.7.jar"/&gt; &lt;classpathentry kind="lib" path="/Compnet/lib/hibernate4/c3p0-0.9.1.jar"/&gt; &lt;classpathentry kind="lib" path="/Compnet/lib/hibernate4/dom4j-1.6.1.jar"/&gt; &lt;classpathentry kind="lib" path="/Compnet/lib/hibernate4/ehcache-core-2.4.3.jar"/&gt; &lt;classpathentry kind="lib" path="/Compnet/lib/hibernate4/hibernate-c3p0-4.1.4.Final.jar"/&gt; &lt;classpathentry kind="lib" path="/Compnet/lib/hibernate4/hibernate-commons-annotations-4.0.1.Final.jar"/&gt; &lt;classpathentry kind="lib" path="/Compnet/lib/hibernate4/hibernate-core-4.1.4.Final.jar"/&gt; &lt;classpathentry kind="lib" path="/Compnet/lib/hibernate4/hibernate-ehcache-4.1.4.Final.jar"/&gt; &lt;classpathentry kind="lib" path="/Compnet/lib/hibernate4/hibernate-entitymanager-4.1.4.Final.jar"/&gt; &lt;classpathentry kind="lib" path="/Compnet/lib/hibernate4/hibernate-envers-4.1.4.Final.jar"/&gt; &lt;classpathentry kind="lib" path="/Compnet/lib/hibernate4/hibernate-infinispan-4.1.4.Final.jar"/&gt; &lt;classpathentry kind="lib" path="/Compnet/lib/hibernate4/hibernate-jpa-2.0-api-1.0.1.Final.jar"/&gt; &lt;classpathentry kind="lib" path="/Compnet/lib/hibernate4/hibernate-proxool-4.1.4.Final.jar"/&gt; &lt;classpathentry kind="lib" path="/Compnet/lib/hibernate4/infinispan-core-5.1.4.FINAL.jar"/&gt; &lt;classpathentry kind="lib" path="/Compnet/lib/hibernate4/javassist-3.15.0-GA.jar"/&gt; &lt;classpathentry kind="lib" path="/Compnet/lib/hibernate4/jboss-logging-3.1.0.GA.jar"/&gt; &lt;classpathentry kind="lib" path="/Compnet/lib/hibernate4/jboss-marshalling-1.3.11.GA.jar"/&gt; &lt;classpathentry kind="lib" path="/Compnet/lib/hibernate4/jboss-marshalling-river-1.3.11.GA.jar"/&gt; &lt;classpathentry kind="lib" path="/Compnet/lib/hibernate4/jboss-transaction-api_1.1_spec-1.0.0.Final.jar"/&gt; &lt;classpathentry kind="lib" path="/Compnet/lib/hibernate4/jgroups-3.0.9.Final.jar"/&gt; &lt;classpathentry kind="lib" path="/Compnet/lib/hibernate4/proxool-0.8.3.jar"/&gt; &lt;classpathentry kind="lib" path="/Compnet/lib/hibernate4/rhq-pluginAnnotations-3.0.4.jar"/&gt; &lt;classpathentry kind="lib" path="/Compnet/lib/hibernate4/slf4j-api-1.6.1.jar"/&gt; &lt;classpathentry kind="lib" path="/Compnet/lib/hibernate4/stax2-api-3.1.1.jar"/&gt; &lt;classpathentry kind="lib" path="/Compnet/lib/hibernate4/woodstox-core-asl-4.1.1.jar"/&gt; &lt;classpathentry kind="output" path="build/classes"/&gt; </code></pre> <p></p> <p>stacktrance:</p> <p>java.lang.NoClassDefFoundError: org/hibernate/Session at br.com.flex4j.servlet.genericActionServlet.init(genericActionServlet.java:29) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161) at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:806) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.ClassNotFoundException: org.hibernate.Session at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204) ... 13 more</p> <p>Jun 21, 2012 3:39:22 PM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Allocate exception for servlet genericActionServlet java.lang.ClassNotFoundException: org.hibernate.Session at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204) at br.com.flex4j.servlet.genericActionServlet.init(genericActionServlet.java:29) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161) at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:806) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Unknown Source)</p> <p>EDIT:</p> <p>ClassPath of my project: <img src="https://i.stack.imgur.com/8rQFB.png" alt="properties&gt;java build path"></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload