GWT/Hibernate: java.lang.NoClassDefFoundError: org/hibernate/Interceptor -
i trying initialize hibernate session in project-web-server. using library wrote project-data-model linked dependency in maven:
project-web-server pom.xml:
<dependency> <groupid>com.preoject.server</groupid> <artifactid>project-data-model</artifactid> <version>0.0.1-snapshot</version> </dependency>
hibernatesession.java
therefore in project-data-model; how use in project-web-server:
public class serverconfig implements servletcontextlistener { public void contextinitialized(servletcontextevent event) { try { hibernatesession.initialize(); } catch (filenotfoundexception e) { e.printstacktrace(); } } public void contextdestroyed(servletcontextevent event) { // stuff on shutdown. } }
even though referenced data model project dependency getting java.lang.noclassdeffounderror
exception:
java.lang.noclassdeffounderror: org/hibernate/interceptor @ java.lang.class.forname0(native method) @ java.lang.class.forname(unknown source) @ com.google.appengine.tools.development.agent.runtime.runtimehelper.checkrestricted(runtimehelper.java:70) @ com.google.appengine.tools.development.agent.runtime.runtime.checkrestricted(runtime.java:65) @ com.project.datamodel.hibernatesession.initialize(hibernatesession.java:19) @ com.project.web.server.serverconfig.contextinitialized(serverconfig.java:14) ...
i can't figure out have here. folder war/web-inf/lib
not contain hibernate related libraries; problem? i'm not sure because have added hibernate dependencies parent pom.xml:
<dependency> <groupid>org.hibernate</groupid> <artifactid>hibernate-core</artifactid> <version>4.0.1.final</version> </dependency> <dependency> <groupid>org.hibernate</groupid> <artifactid>hibernate-validator</artifactid> <version>4.2.0.final</version> </dependency> <dependency> <groupid>org.hibernate.common</groupid> <artifactid>hibernate-commons-annotations</artifactid> <version>4.0.1.final</version> <classifier>tests</classifier> </dependency> <dependency> <groupid>org.hibernate.javax.persistence</groupid> <artifactid>hibernate-jpa-2.0-api</artifactid> <version>1.0.1.final</version> </dependency> <dependency> <groupid>org.hibernate</groupid> <artifactid>hibernate-entitymanager</artifactid> <version>4.0.1.final</version> </dependency>
maven eclipse plugin default add dependencies eclipse project classpath. not aware of custom build/packaging/deployment scenarios unless explicitly configure use cases need. maybe question can helpful in use case. this article explains how configure m2eclipse plugin goals.
nevertheless, expect gwt plugin eclipse (i assume use it) take project classpath , copy appropriate places, i'm not sure why doesn't setup.
Comments
Post a Comment