* Cross Posting to Weblogic Server from Identity Management forum *
I have a JPA / JSF application that was written to assist with DB reads / writes. The java methods are called from OIM, as task adapters.
If I run my application from within JDeveloper, all is well. Everything behaves as you'd expect.
If I create a deployment profile and deploy to a jar file, everything works as well. In the jar, all of the classes, as well as the META-INF/persistence.xml file are included. Running the app with 'java -classpath .:/path/to/jar com.classname.method works as expected.
If, however, I then copy the jar to the JavaTasks directory of WLS/OIM, and try and execute the method, I get the following error:
Target Class = com.classname.method
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at Thor.API.Operations.tcProvisioningOperationsIntfEJB.retryTasksx(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Caused by: javax.persistence.PersistenceException: No Persistence provider for EntityManager named persistenceID: The following providers:
Returned null to createEntityManagerFactory.
My persistence.xml file defines the persistenceID provider. It works fine if run from JDeveloper, or the command line. But, WLS/OIM cannot seem to find/parse the persistence.xml file when run as a task adapter.
I have even created a DataSource within WLS, and tried to reference it that way (instead of directly via the jdbc drivers) with no luck.
How do I get OIM to recognize the existence of the persistence.xml file in the META-INF directory of the jar that contains my classes? Do I have to add another persistence.xml file elsewhere in the WLS server to get it to be parsed?
The fact that the name of the Persistence Unit (persistenceID) is in the error message, tells me that persistence.xml file is found. The problem seems to be finding the Persistence Provider specified in there, if any. Would you be able to share the content of your persistence.xml file?
try to include prefer-web-inf tag with in your weblogic.xml file and try one more time might this should pic your persistence.xml file.
Mostly this option is used to check your jar with your APP-INF/lib folder.
just do a try mostly it should help you.