Hi, I am experiencing problems with an EAR deployed onto Websphere 7. The EAR contains a web module and an ejb 3 module that uses openjpa 2 for persistence.
More than half the time after redeploying the EAR, for each EJB3 class, I would get the following kind of error the first time I invoke EntityManager::find(beanclass, beanid) java.lang.NoClassDefFoundError: org/apache/openjpa/util/StringId at com.example.beans.MyEntity.pcNewObjectIdInstance(MyEntity.java) at org.apache.openjpa.enhance.PCRegistry.newObjectId(PCRegistry.java:142) at org.apache.openjpa.meta.MetaDataRepository.processRegisteredClass(MetaDataRepository.java:1595) at org.apache.openjpa.meta.MetaDataRepository.processRegisteredClasses(MetaDataRepository.java:1543) at org.apache.openjpa.meta.ClassMetaData.getPCSubclasses(ClassMetaData.java:358) at org.apache.openjpa.jdbc.meta.MappingRepository.findBaseClassMapping(MappingRepository.java:1471) at org.apache.openjpa.jdbc.meta.MappingRepository.prepareMapping(MappingRepository.java:364) at org.apache.openjpa.meta.MetaDataRepository.preMapping(MetaDataRepository.java:753) at org.apache.openjpa.meta.MetaDataRepository.resolve(MetaDataRepository.java:646) at org.apache.openjpa.meta.MetaDataRepository.getMetaData(MetaDataRepository.java:411) at org.apache.openjpa.kernel.BrokerImpl.newObjectId(BrokerImpl.java:1199) at org.apache.openjpa.kernel.DelegatingBroker.newObjectId(DelegatingBroker.java:286) at org.apache.openjpa.persistence.EntityManagerImpl.find(EntityManagerImpl.java:471) at com.ibm.ws.jpa.management.JPATxEmInvocation.find(JPATxEmInvocation.java:211) at com.ibm.ws.jpa.management.JPAEntityManager.find(JPAEntityManager.java:215) ... Curiously, this only happens upon most redeployments, but not all. However, once I encounter this error, I would encounter it with all the other EJB 3 classes in the EAR as well. And, the error only occurs for the first EntityManager::find invocation per ejb. Subsequent EntityManager::find invocations would be able to work without exceptions. Thanks for any advice or help, let me know if you need anymore information!