在EntityManagerWrapper.getNonTxEMsFromCurrentInvocation中获取错误(EntityManagerWrapper.java:276)

时间:2018-05-25 07:24:05

标签: ejb eclipselink

我将我的应用程序部署在glassfish服务器的EJBContainer中。我在会话bean中使用Callable和future调用一个方法,并且在这个方法中我使用EntityManager进行某些事务,但是只要有任何对EntityManager的调用就会得到NullPointerException。下面是错误堆栈跟踪::

 Severe:   java.lang.NullPointerException
at com.sun.enterprise.container.common.impl.EntityManagerWrapper.getNonTxEMsFromCurrentInvocation(EntityManagerWrapper.java:276)
at com.sun.enterprise.container.common.impl.EntityManagerWrapper.getNonTxEMFromCurrentInvocation(EntityManagerWrapper.java:260)
at com.sun.enterprise.container.common.impl.EntityManagerWrapper._getDelegate(EntityManagerWrapper.java:213)
at com.sun.enterprise.container.common.impl.EntityManagerWrapper.createQuery(EntityManagerWrapper.java:455)
at LogisticsEngineSessionBean.getAllPackSerialsForProcess(LogisticsEngineSessionBean.java:3137)
at LogisticsEngineSessionBean.processSalesOutLines(LogisticsEngineSessionBean.java:3462)
at LogisticsEngineSessionBean.lambda$updateSKULocationStatusOnSell$0(LogisticsEngineSessionBean.java:2972)
at LogisticsEngineSessionBean$$Lambda$7/1138463255.call(Unknown Source)
at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1424)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1689)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)

请建议是否因为我试图进行多线程或任何替代方案可用。我正在使用EclipseLink JPA。这个NullPointerException不在我的代码中,它来自EntityManager,当我没有进行MultiThreading时工作正常。并且EntityManager对象不为空,请在给予downvote之前正确阅读问题。

0 个答案:

没有答案