I have stateful bean with JPA and when I test locally, it connects to database and displays correct values.
I have added a JSP to the project and when I run JSP file from Jdeveloper, I am getting the following errors
- Exception creating EntityManagerFactory using PersistenceProvider class oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider for persistence unit Project3.
at com.evermind.server.ejb.exception.DeploymentException.exceptionCreatingEntityManagerFactory(DeploymentException.java:130)
at com.evermind.server.ejb.persistence.PersistenceUnitManagerImpl.createContainerEntityManagerFactory(PersistenceUnitManagerImpl.java:197)
at com.evermind.server.ejb.persistence.PersistenceUnitManagerImpl.initializePersistenceUnit(PersistenceUnitManagerImpl.java:159)
at com.evermind.server.ejb.persistence.PersistenceUnitManagerImpl.initialize(PersistenceUnitManagerImpl.java:87)
at com.evermind.server.ejb.EJBPackageDeployment.initializePersistenceUnitManager(EJBPackageDeployment.java:1074)
at com.evermind.server.ejb.EJBContainer.postInit(EJBContainer.java:841)
at com.evermind.server.ApplicationStateRunning.initializeApplication(ApplicationStateRunning.java:235)
at com.evermind.server.Application.setConfig(Application.java:460)
at com.evermind.server.Application.setConfig(Application.java:361)
at com.evermind.server.ApplicationServer.addApplication(ApplicationServer.java:1919)
at com.evermind.server.ApplicationServer.initializeDeployedApplications(ApplicationServer.java:1667)
at com.evermind.server.ApplicationServer.setConfig(ApplicationServer.java:1050)
at com.evermind.server.ApplicationServerLauncher.run(ApplicationServerLauncher.java:131)
at java.lang.Thread.run(Thread.java:662)
Caused by: javax.persistence.PersistenceException: Exception [TOPLINK-28018] (Oracle TopLink Essentials - 2.1 (Build b52-fcs (09/24/2008))): oracle.toplink.essentials.exceptions.EntityManagerSetupException
Exception Description: predeploy for PersistenceUnit [Project3] failed.
Internal Exception: Exception [TOPLINK-30007] (Oracle TopLink Essentials - 2.1 (Build b52-fcs (09/24/2008))): oracle.toplink.essentials.exceptions.PersistenceUnitLoadingException
Exception Description: An exception was thrown while loading class: .jsps._test to check whether it implements @Entity, @Embeddable, or @MappedSuperclass.
Internal Exception: oracle.classloader.util.AnnotatedClassNotFoundException:
Missing class: .jsps._test
Dependent class: oracle.toplink.essentials.ejb.cmp3.persistence.PersistenceUnitProcessor
Loader: oracle.persistence:1.0
Code-Source: /D:/jdevstudio10135/toplink/jlib/toplink-essentials.jar
Configuration: <code-source> in /D:/jdevstudio10135/jdev/system/oracle.j2ee.10.1.3.43.6/embedded-oc4j/config/server.xml
This load was initiated at current-workspace-app.root:0.0.1 using the loadClass() method.
The missing class is not available from any code-source or loader in the system.
at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:644)
at oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.createContainerEntityManagerFactory(EntityManagerFactoryProvider.java:244)
at com.evermind.server.ejb.persistence.PersistenceUnitManagerImpl.createContainerEntityManagerFactory(PersistenceUnitManagerImpl.java:192)
... 12 more
Caused by: Exception [TOPLINK-28018] (Oracle TopLink Essentials - 2.1 (Build b52-fcs (09/24/2008))): oracle.toplink.essentials.exceptions.EntityManagerSetupException
Exception Description: predeploy for PersistenceUnit [Project3] failed.
Internal Exception: Exception [TOPLINK-30007] (Oracle TopLink Essentials - 2.1 (Build b52-fcs (09/24/2008))): oracle.toplink.essentials.exceptions.PersistenceUnitLoadingException
Exception Description: An exception was thrown while loading class: .jsps._test to check whether it implements @Entity, @Embeddable, or @MappedSuperclass.
Internal Exception: oracle.classloader.util.AnnotatedClassNotFoundException:
Missing class: .jsps._test
Dependent class: oracle.toplink.essentials.ejb.cmp3.persistence.PersistenceUnitProcessor
Loader: oracle.persistence:1.0
Code-Source: /D:/jdevstudio10135/toplink/jlib/toplink-essentials.jar
Configuration: <code-source> in /D:/jdevstudio10135/jdev/system/oracle.j2ee.10.1.3.43.6/embedded-oc4j/config/server.xml
This load was initiated at current-workspace-app.root:0.0.1 using the loadClass() method.
The missing class is not available from any code-source or loader in the system.
at oracle.toplink.essentials.exceptions.EntityManagerSetupException.predeployFailed(EntityManagerSetupException.java:228)
... 15 more
Caused by: Exception [TOPLINK-30007] (Oracle TopLink Essentials - 2.1 (Build b52-fcs (09/24/2008))): oracle.toplink.essentials.exceptions.PersistenceUnitLoadingException
Exception Description: An exception was thrown while loading class: .jsps._test to check whether it implements @Entity, @Embeddable, or @MappedSuperclass.
Internal Exception: oracle.classloader.util.AnnotatedClassNotFoundException:
Missing class: .jsps._test
Dependent class: oracle.toplink.essentials.ejb.cmp3.persistence.PersistenceUnitProcessor
Loader: oracle.persistence:1.0
Code-Source: /D:/jdevstudio10135/toplink/jlib/toplink-essentials.jar
Configuration: <code-source> in /D:/jdevstudio10135/jdev/system/oracle.j2ee.10.1.3.43.6/embedded-oc4j/config/server.xml
This load was initiated at current-workspace-app.root:0.0.1 using the loadClass() method.
The missing class is not available from any code-source or loader in the system.
at oracle.toplink.essentials.exceptions.PersistenceUnitLoadingException.exceptionLoadingClassWhileLookingForAnnotations(PersistenceUnitLoadingException.java:161)
at oracle.toplink.essentials.ejb.cmp3.persistence.PersistenceUnitProcessor.loadClass(PersistenceUnitProcessor.java:265)
at oracle.toplink.essentials.internal.ejb.cmp3.metadata.MetadataProcessor.processPersistenceUnitClasses(MetadataProcessor.java:413)
at oracle.toplink.essentials.internal.ejb.cmp3.metadata.MetadataProcessor.processPersistenceUnitClasses(MetadataProcessor.java:373)
at oracle.toplink.essentials.ejb.cmp3.persistence.PersistenceUnitProcessor.processORMetadata(PersistenceUnitProcessor.java:292)
at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:608)
... 14 more
Caused by: oracle.classloader.util.AnnotatedClassNotFoundException:
Missing class: .jsps._test
Dependent class: oracle.toplink.essentials.ejb.cmp3.persistence.PersistenceUnitProcessor
Loader: oracle.persistence:1.0
Code-Source: /D:/jdevstudio10135/toplink/jlib/toplink-essentials.jar
Configuration: <code-source> in /D:/jdevstudio10135/jdev/system/oracle.j2ee.10.1.3.43.6/embedded-oc4j/config/server.xml
This load was initiated at current-workspace-app.root:0.0.1 using the loadClass() method.
The missing class is not available from any code-source or loader in the system.
at oracle.classloader.PolicyClassLoader.handleClassNotFound(PolicyClassLoader.java:2204)
at oracle.classloader.PolicyClassLoader.internalLoadClass(PolicyClassLoader.java:1726)
at oracle.classloader.PolicyClassLoader.loadClass(PolicyClassLoader.java:1682)
at oracle.classloader.PolicyClassLoader.loadClass(PolicyClassLoader.java:1667)
at oracle.toplink.essentials.ejb.cmp3.persistence.PersistenceUnitProcessor.loadClass(PersistenceUnitProcessor.java:262)
... 18 more
14/12/13 14:35:48 WARNING: Application.setConfig Application: current-workspace-app is in failed state as initialization failed.
java.lang.InstantiationException: Error initializing ejb-modules: [current-workspace-app:TestJPA2_Project3_2] - Exception creating EntityManagerFactory using PersistenceProvider class oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider for persistence unit Project3.
14/12/13 14:35:48 Error parsing application-server config file: null
14/12/13 14:35:48 java.lang.NullPointerException
14/12/13 14:35:48 at com.evermind.server.ObjectReferenceCleaner.resetApplicationLogger(ObjectReferenceCleaner.java:260)
14/12/13 14:35:48 at com.evermind.server.ObjectReferenceCleaner.cleanupApplicationLogger(ObjectReferenceCleaner.java:167)
14/12/13 14:35:48 at com.evermind.server.ObjectReferenceCleaner.loaderDestroyed(ObjectReferenceCleaner.java:94)
14/12/13 14:35:48 at oracle.classloader.EventDispatcher.loaderDestroyed(EventDispatcher.java:254)
14/12/13 14:35:48 at oracle.classloader.PolicyClassLoader.close(PolicyClassLoader.java:1187)
14/12/13 14:35:48 at oracle.classloader.PolicyClassLoader.close(PolicyClassLoader.java:1069)
14/12/13 14:35:48 at com.evermind.server.ApplicationStateRunning.destroyClassLoaders(ApplicationStateRunning.java:1201)
14/12/13 14:35:48 at com.evermind.server.Application.stateCleanUp(Application.java:3766)
14/12/13 14:35:48 at com.evermind.server.Application.setConfig(Application.java:512)
14/12/13 14:35:48 at com.evermind.server.Application.setConfig(Application.java:361)
14/12/13 14:35:48 at com.evermind.server.ApplicationServer.addApplication(ApplicationServer.java:1919)
14/12/13 14:35:48 at com.evermind.server.ApplicationServer.initializeDeployedApplications(ApplicationServer.java:1667)
14/12/13 14:35:48 at com.evermind.server.ApplicationServer.setConfig(ApplicationServer.java:1050)
14/12/13 14:35:48 at com.evermind.server.ApplicationServerLauncher.run(ApplicationServerLauncher.java:131)
14/12/13 14:35:48 at java.lang.Thread.run(Thread.java:662)
This is for others if you are getting the same error as I have posted in question.
I have solved the issue by adding the following in persistence.xml as this is a bug with 10.1.3.5 version.
<exclude-unlisted-classes>true</exclude-unlisted-classes>