[rules-users] Drools Flow : Persistence :- Getting Null Pointer Exception in JPAWorkItemManager.java

Pardeep.Ruhil at lntinfotech.com Pardeep.Ruhil at lntinfotech.com
Mon Nov 9 06:33:08 EST 2009


Hi,
When I try to run a sample test case using drools-persistence.jar it works 
successfully.
But when I try to include the persistence in my OFBiz application, I am 
getting null pointer exception in class JPAWorkItemManager.java.

java.lang.NullPointerException 
 at 
org.drools.persistence.processinstance.JPAWorkItemManager.completeWorkItem(
JPAWorkItemManager.java:85).

Null Pointer is because of getting EntityManager object as NULL. In the 
below line of JPAWorkItemManager.java
  EntityManager em = (EntityManager) this.workingMemory
.getEnvironment().get( EnvironmentName.ENTITY_MANAGER );
the em is null.
Because of this I am getting Null Pointer exception when it try to run the 
code
 if (workItemInfo == null) {
                workItemInfo = em.find(WorkItemInfo.class, id);
        }
 
Can you tell me why I getting NPE when I try to run the jar file in my 
application.
While the code run successfully when I try to run sample test case for 
that.
Please help me to get through the situation.


Thanks & Regards

Pardeep Ruhil
L&T Infotech Ltd
Mumbai
Ph: +919820283884

Larsen & Toubro Infotech Ltd.
www.Lntinfotech.com

This Document is classified as: 

L&T Infotech Proprietary   L&T Infotech Confidential   L&T Infotech 
Internal Use Only   L&T Infotech General Business 

This Email may contain confidential or privileged information for the 
intended recipient (s) If you are not the intended recipient, please do 
not use or disseminate the information, notify the sender and delete it 
from your system. 

______________________________________________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20091109/3e077324/attachment.html 


More information about the rules-users mailing list