Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Websphere 6.1 + EJB Feature Pack + Hibernate JPA provider

556 views
Skip to first unread message

carlos...@riptidesoftware.com

unread,
Jun 17, 2008, 11:39:40 AM6/17/08
to
I am using WAS 6.1.0.13 with the EJB Feature pack, and I want to use the hibernate JPA provider as it offers some extensions that I find useful in my application. I have changed the persistence.xml accordingly by adding the provider class name and some Hibernate configuration properties. The application deploys fine and I even get some log entries about it doing the mappings properly, but then I get the following exception without any other explanation:

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?

joej...@yahoo.com.hk

unread,
Jul 10, 2008, 10:59:24 PM7/10/08
to
I has the same problem, when testing it by the Counter Sample provided by IBM. The error is:

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 Schnier

unread,
Jul 11, 2008, 10:19:03 AM7/11/08
to
If you haven't already, I'd recommend that you open a PMR with IBM Support.

-- Randy

devu...@rediffmail.com

unread,
Jul 12, 2008, 10:40:20 AM7/12/08
to
Hi,

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)

Randy Schnier

unread,
Jul 14, 2008, 9:38:17 AM7/14/08
to
Hi,
Sorry you are experiencing problems. You are correct that there is a default JPA provider that is used if no specific provider is defined in persistence.xml.

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

Randy Schnier

unread,
Jul 14, 2008, 6:28:15 PM7/14/08
to
I found out some additional information about what might be causing this. If you have not augmented your WebSphere profile to add the EJB 3.0 feature pack, the feature pack code dealing with resolution of persistence.xml will not be enabled. We made this change in 6.1.0.15 because a customer with a syntactically incorrect persistence.xml file in an EJB 2.1 module running on regular WAS 6.1 (without the feature pack installed) started getting error messages complaining about the malformed persistence.xml file after they installed the feature pack, even though they had not augmented the profile to "turn on" the feature pack function.

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

rcu...@gmail.com

unread,
Sep 12, 2008, 1:55:15 PM9/12/08
to devu...@rediffmail.com, rsch...@us.ibm.com, carlos...@riptidesoftware.com, joej...@yahoo.com.hk

Hello,

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

0 new messages