persistence@glassfish.java.net

Re: NullPointerException javaagent WebSphere 6.1

From: Sanjeeb Kumar Sahoo <Sanjeeb.Sahoo_at_Sun.COM>
Date: Fri, 27 Oct 2006 16:56:53 +0530

I think you are facing
https://glassfish.dev.java.net/issues/show_bug.cgi?id=1331. I think
something like this is happening: when you start WebSphere with
toplink-essentials-agent.jar, the TopLink Essential Persistence provider
is getting initialized when WebSphere starts up and it is looking for
META-INF/persistence.xml using the WebSphere class loader. Since
persistence.xml is not available to that class loader, it's getting an
NPE because of that bug.

You are right, it is not necessary to use agent jar.

You also mentioned that you are sometimes getting NPE even without using
agent jar, but that could be because your META-INF/persistence.xml is
not available to application class loader.

Thanks,
Sahoo
DonBrady wrote:
> I am using toplink-essentials under WebSphere 6.1 (which is based on Java 5)
>
> If I try to use the the toplink-essentials-agent.jar via the jvm javaagent
> argument that starts WebSphere, I get the following exception:
>
> java.lang.NullPointerException
> at
> oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.createEntityManagerFactory(EntityManagerFactoryProvider.java:120)
> at
> javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:83)
> at
> com.ncfbins.services.mship.implementations.FetchHRController.fetchhr(FetchHRController.java:94)
> at
> com.ncfbins.services.mship.implementations.MembershipImplementation.fetchhr(MembershipImplementation.java:141)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:615)
> at
> com.ibm.ws.webservices.engine.dispatchers.java.JavaDispatcher.invokeMethod(JavaDispatcher.java:178)
> at
> com.ibm.ws.webservices.dispatchers.ejb.J2ee14EJBDispatcher.invokeMethod(J2ee14EJBDispatcher.java:173)
> at
> com.ibm.ws.webservices.engine.dispatchers.java.JavaDispatcher.invokeOperation(JavaDispatcher.java:141)
> at
> com.ibm.ws.webservices.engine.dispatchers.SoapRPCProcessor.processRequestResponse(SoapRPCProcessor.java:447)
> at
> com.ibm.ws.webservices.engine.dispatchers.SoapRPCProcessor.processMessage(SoapRPCProcessor.java:412)
> at
> com.ibm.ws.webservices.engine.dispatchers.BasicDispatcher.processMessage(BasicDispatcher.java:134)
> at
> com.ibm.ws.webservices.dispatchers.ejb.J2ee14EJBDispatcher.invoke(J2ee14EJBDispatcher.java:154)
> ... 31 more
>
> I realixe that it is not essential to specify the javaagent.
>
> However, even when I leave it off, I sometimes get the same exception.
>
> Any suggestions would be appreciated....
>
> Thanks,
>
> Don
>