6/17/08 10:16:23:729 EDT 000000f6 ExceptionUtil E CNTR0020E: EJB threw an unexpected (non-declared) exception during invocation of method "findById" on bean "BeanId(Flare2#FlareBusobj.jar#RtEntityManagerBean, null)". Exception data: java.lang.NullPointerException
at com.ibm.ws.jpa.management.JPAEMFactory.createEntityManager(JPAEMFactory.java:10 8)
at com.ibm.ws.jpa.management.JPATxEntityManager.getEMInvocationInfo(JPATxEntityMan ager.java:204)
at com.ibm.ws.jpa.management.JPAEntityManager.find(JPAEntityManager.java:161)
at com.riptide.ejb.RtEntityManagerBean.findById(RtEntityManagerBean.java:60)
at com.riptide.ejb.EJSRemote0SLRtEntityManagerBean_0d9d8d8f.findById(EJSRemote0SLR tEntityManagerBean_0d9d8d8f.java)
at com.riptide.ejb._EJSRemote0SLRtEntityManagerBean_0d9d8d8f_Tie.findById(_EJSRemo te0SLRtEntityManagerBean_0d9d8d8f_Tie.java)
at com.riptide.ejb._EJSRemote0SLRtEntityManagerBean_0d9d8d8f_Tie._invoke(_EJSRemot e0SLRtEntityManagerBean_0d9d8d8f_Tie.java)
at com.ibm.CORBA.iiop.ServerDelegate.dispatchInvokeHandler(ServerDelegate.java:621 )
at com.ibm.CORBA.iiop.ServerDelegate.dispatch(ServerDelegate.java:474)
at com.ibm.rmi.iiop.ORB.process(ORB.java:503)
at com.ibm.CORBA.iiop.ORB.process(ORB.java:1571)
at com.ibm.rmi.iiop.Connection.respondTo(Connection.java:2701)
at com.ibm.rmi.iiop.Connection.doWork(Connection.java:2575)
at com.ibm.rmi.iiop.WorkUnitImpl.doWork(WorkUnitImpl.java:62)
at com.ibm.ejs.oa.pool.PooledThread.run(ThreadPool.java:118)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469)
Any ideas on why this is happening?
E CWWJP0015E: An error occurred in the org.hibernate.ejb.HibernatePersistence persistence provider when it attempted to create the container entity manager factory for the Counter persistence unit. The following error occurred: PersistenceUnit: Counter Unable to build EntityManagerFactory
E CWWJP0009E: The server cannot create an EntityManangerFactory factory for the Counter persistent unit from the org.hibernate.ejb.HibernatePersistence provider in jar:file:/D:/IBM/SDP70/runtimes/base_v61/profiles/AppSrv02/installedApps/TATEAM S2Node04Cell/EJB3CounterSample.ear/EJB3Beans.jar!/ module.
There is no javax.persistence and org.hibernate errors in the log4j logs.
My persistence.xml config is:
org.hibernate.ejb.HibernatePersistence
jdbc/EJB3SampleDatasource
com.ibm.websphere.ejb3sample.counter.JPACounterEntity
true
The problem works fine when I remove the provider element in the persistence.xml.
Any idea?
-- Randy
I'm facing the exact same problem. I just installed the counter sample out of the box through the console. Absolutely no changes made.
It installs fine however throws a nullPointer exception when I hit on the increment button. See stack trace from System.err log.
On examining code I see that its because the EntityManager instance has not been injected (that's what it seems anyway, I might be wrong).
On further investigation, I opened the persistence.xml and it doesn't have any persistence provider at all. This is extremely surprising. Does it default or something?
We're having the same injection problem deploying our JPA application. This time there is indeed a persistence provider (openJPA).
Help!!!
Complete Stack trace also attached
[7/12/08 21:43:08:281 IST] 0000009e SystemErr R java.lang.NullPointerException
[7/12/08 21:43:08:281 IST] 0000009e SystemErr R at com.ibm.websphere.ejb3sample.counter.StatelessCounterBean.increment(StatelessCounterBean.java:28)
[7/12/08 21:43:08:281 IST] 0000009e SystemErr R at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[7/12/08 21:43:08:281 IST] 0000009e SystemErr R at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
[7/12/08 21:43:08:281 IST] 0000009e SystemErr R at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[7/12/08 21:43:08:281 IST] 0000009e SystemErr R at java.lang.reflect.Method.invoke(Method.java:618)
[7/12/08 21:43:08:281 IST] 0000009e SystemErr R at com.ibm.ejs.container.interceptors.InvocationContextImpl.proceed(InvocationContextImpl.java:547)
[7/12/08 21:43:08:281 IST] 0000009e SystemErr R at com.ibm.websphere.ejb3sample.counter.Audit.methodChecker(Audit.java:23)
[7/12/08 21:43:08:281 IST] 0000009e SystemErr R at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[7/12/08 21:43:08:281 IST] 0000009e SystemErr R at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
[7/12/08 21:43:08:281 IST] 0000009e SystemErr R at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[7/12/08 21:43:08:281 IST] 0000009e SystemErr R at java.lang.reflect.Method.invoke(Method.java:618)
[7/12/08 21:43:08:281 IST] 0000009e SystemErr R at com.ibm.ejs.container.interceptors.InterceptorProxy.invokeInterceptor(InterceptorProxy.java:227)
[7/12/08 21:43:08:281 IST] 0000009e SystemErr R at com.ibm.ejs.container.interceptors.InvocationContextImpl.proceed(InvocationContextImpl.java:526)
[7/12/08 21:43:08:281 IST] 0000009e SystemErr R at com.ibm.ejs.container.interceptors.InvocationContextImpl.doAroundInvoke(InvocationContextImpl.java:184)
[7/12/08 21:43:08:281 IST] 0000009e SystemErr R at com.ibm.ejs.container.EJSContainer.invoke(EJSContainer.java:5535)
[7/12/08 21:43:08:281 IST] 0000009e SystemErr R at com.ibm.websphere.ejb3sample.counter.EJSLocal0SLStatelessCounterBean_c8ad5802.increment(EJSLocal0SLStatelessCounterBean_c8ad5802.java)
[7/12/08 21:43:08:281 IST] 0000009e SystemErr R at com.ibm.websphere.ejb3sample.counter.EJBCount.doPost(EJBCount.java:49)
[7/12/08 21:43:08:281 IST] 0000009e SystemErr R at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
[7/12/08 21:43:08:281 IST] 0000009e SystemErr R at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
[7/12/08 21:43:08:281 IST] 0000009e SystemErr R at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1076)
[7/12/08 21:43:08:281 IST] 0000009e SystemErr R at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:550)
[7/12/08 21:43:08:281 IST] 0000009e SystemErr R at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:486)
[7/12/08 21:43:08:281 IST] 0000009e SystemErr R at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:90)
[7/12/08 21:43:08:281 IST] 0000009e SystemErr R at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:744)
[7/12/08 21:43:08:296 IST] 0000009e SystemErr R at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1455)
[7/12/08 21:43:08:296 IST] 0000009e SystemErr R at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:115)
[7/12/08 21:43:08:296 IST] 0000009e SystemErr R at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:458)
[7/12/08 21:43:08:296 IST] 0000009e SystemErr R at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:387)
[7/12/08 21:43:08:296 IST] 0000009e SystemErr R at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:102)
[7/12/08 21:43:08:296 IST] 0000009e SystemErr R at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
[7/12/08 21:43:08:296 IST] 0000009e SystemErr R at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
[7/12/08 21:43:08:296 IST] 0000009e SystemErr R at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
[7/12/08 21:43:08:296 IST] 0000009e SystemErr R at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
[7/12/08 21:43:08:296 IST] 0000009e SystemErr R at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:195)
[7/12/08 21:43:08:296 IST] 0000009e SystemErr R at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:743)
[7/12/08 21:43:08:296 IST] 0000009e SystemErr R at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873)
[7/12/08 21:43:08:296 IST] 0000009e SystemErr R at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1473)
Are there indications elsewhere in the log, or FFDC event files, that might give a clue as to why the injection of the EntityManager is not succeeding? I promise, that we did at least test the Counter sample before we shipped the feature pack :-) so I'd guess there's something happening that's specific to your environment.
The previous poster was on 6.1.0.13, is that the level you are on also?
-- Randy
So you may want to verify again whether the WAS profile under which you're running, has in fact been augmented to enable the EJB 3.0 feature pack.
-- Randy
I have the same problem here.. the feature pak for EJB 3.0 has been
augumented as Randy recommended. What is happening is: the Websphere
container is able to inject an EntityManager when we´re using its
native OpenJPA. But when we set up to use the hibernate provider, we
have the same exact problem.
We´re using hibernate 3.2.6, hibernate entitymanager 3.3.1.
Anyone has any idea?
best regards,
Rodrigo Cunha