m***@gmx.de
2008-08-12 10:41:50 UTC
Hi,
I’m currently trying to set up Hibernate 3.2 as JPA provider in WebSphere 6.1 with feature pack 15 (Base 6.1.0.15 EJB 3.0 6.1.0.15), but unfortunately without success. After starting my test application, several hibernate log messages show up as expected:
\[12.08.08 11:59:42:381 CEST] 00000019 Version I org.hibernate.cfg.annotations.Version Hibernate Annotations 3.4.0.CR2
\[12.08.08 11:59:42:413 CEST] 00000019 Environment I org.hibernate.cfg.Environment Hibernate 3.3.0.CR2
...
\[12.08.08 11:59:44:694 CEST] 00000019 SettingsFacto I org.hibernate.cfg.SettingsFactory buildSettings Default entity-mode: pojo
\[12.08.08 11:59:44:709 CEST] 00000019 SettingsFacto I org.hibernate.cfg.SettingsFactory buildSettings Named query checking : enabled
A few seconds later a class not found exception is thrown and the application is stopped:
\[12.08.08 11:59:45:334 CEST] 00000019 SystemErr R Caused by: java.lang.NoClassDefFoundError: org.apache.commons.collections.map.LRUMap
at org.hibernate.util.SimpleMRUCache.init(SimpleMRUCache.java:71)
at org.hibernate.util.SimpleMRUCache. (SimpleMRUCache.java:55)
at org.hibernate.util.SimpleMRUCache. (SimpleMRUCache.java:50)
at org.hibernate.engine.query.QueryPlanCache. (QueryPlanCache.java:65)
at org.hibernate.impl.SessionFactoryImpl. (SessionFactoryImpl.java:176)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1327)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669)
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:132)
at com.ibm.ws.jpa.management.JPAPUnitInfo.getFactory(JPAPUnitInfo.java:978)
From within a session bean, I can successfully instantiate this class (org.apache.commons.collections.map.LRUMap).
The class is contained in commons-collections.jar, which is deployed together with all the other hibernate relevant libraries:
- antlr-2.7.6.jar
- asm-attrs.jar
- asm.jar
- cglib-2.1.3.jar
- commons-collections-2.1.1.jar
- dom4j.jar
- hibernate-annotations.jar
- hibernate-commons-annotations.jar
- hibernate-core.jar
- hibernate-entitymanager.jar
- hibernate-validator.jar
- hibernate3.jar
- javassist.jar
- slf4j-api.jar
- slf4j-jdk14-1.5.2.jar
I've tried several ways to deploy these libraries:
- As part of the ear archive
- As shared libraries configured in the websphere admin console
- With application classloader policy set to PARENT_LAST or PARENT_FIRST
My persistence.xml is:
persistence xmlns="http://java.sun.com/xml/ns/persistence" ....
.
... org.hibernate.ejb.HibernatePersistence
... jdbc/MyDB2DS
...
.....
.....
...
.
Any help appreciated...
thx
Mathias
I’m currently trying to set up Hibernate 3.2 as JPA provider in WebSphere 6.1 with feature pack 15 (Base 6.1.0.15 EJB 3.0 6.1.0.15), but unfortunately without success. After starting my test application, several hibernate log messages show up as expected:
\[12.08.08 11:59:42:381 CEST] 00000019 Version I org.hibernate.cfg.annotations.Version Hibernate Annotations 3.4.0.CR2
\[12.08.08 11:59:42:413 CEST] 00000019 Environment I org.hibernate.cfg.Environment Hibernate 3.3.0.CR2
...
\[12.08.08 11:59:44:694 CEST] 00000019 SettingsFacto I org.hibernate.cfg.SettingsFactory buildSettings Default entity-mode: pojo
\[12.08.08 11:59:44:709 CEST] 00000019 SettingsFacto I org.hibernate.cfg.SettingsFactory buildSettings Named query checking : enabled
A few seconds later a class not found exception is thrown and the application is stopped:
\[12.08.08 11:59:45:334 CEST] 00000019 SystemErr R Caused by: java.lang.NoClassDefFoundError: org.apache.commons.collections.map.LRUMap
at org.hibernate.util.SimpleMRUCache.init(SimpleMRUCache.java:71)
at org.hibernate.util.SimpleMRUCache. (SimpleMRUCache.java:55)
at org.hibernate.util.SimpleMRUCache. (SimpleMRUCache.java:50)
at org.hibernate.engine.query.QueryPlanCache. (QueryPlanCache.java:65)
at org.hibernate.impl.SessionFactoryImpl. (SessionFactoryImpl.java:176)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1327)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669)
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:132)
at com.ibm.ws.jpa.management.JPAPUnitInfo.getFactory(JPAPUnitInfo.java:978)
From within a session bean, I can successfully instantiate this class (org.apache.commons.collections.map.LRUMap).
The class is contained in commons-collections.jar, which is deployed together with all the other hibernate relevant libraries:
- antlr-2.7.6.jar
- asm-attrs.jar
- asm.jar
- cglib-2.1.3.jar
- commons-collections-2.1.1.jar
- dom4j.jar
- hibernate-annotations.jar
- hibernate-commons-annotations.jar
- hibernate-core.jar
- hibernate-entitymanager.jar
- hibernate-validator.jar
- hibernate3.jar
- javassist.jar
- slf4j-api.jar
- slf4j-jdk14-1.5.2.jar
I've tried several ways to deploy these libraries:
- As part of the ear archive
- As shared libraries configured in the websphere admin console
- With application classloader policy set to PARENT_LAST or PARENT_FIRST
My persistence.xml is:
persistence xmlns="http://java.sun.com/xml/ns/persistence" ....
.
... org.hibernate.ejb.HibernatePersistence
... jdbc/MyDB2DS
...
.....
.....
...
.
Any help appreciated...
thx
Mathias