Hi nanic23,<br>Can you provide us more information about your test case?<br>Are you sure that the sessionId is the correct one? the knowledgeBase provided is the correct one, and the env too?<br><br>ksession = JPAKnowledgeService.<div id=":1p" class="ii gt">
loadStatefulKnowledgeSession(<br>
rwi.getSessionId(), knowledgeBase, null, env );</div><br>would be nice also to see what are you doing in the following method:<br><br> registerWorkItemHandlers((<div id=":1p" class="ii gt">WorkItemManager) ksession<br>
                                .getWorkItemManager(), ksession);<br><br>
</div><br><br><div class="gmail_quote">On Tue, Apr 13, 2010 at 4:19 PM, tolitius <span dir="ltr">&lt;<a href="mailto:webakaunt@gmail.com">webakaunt@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
@nanic23,<br>
<br>
   It seems that when trying to complete the work item, internally Drools<br>
Flow is using JPA persistence module to find ( retrieve ) a work item to be<br>
completed from a WorkItemInfo table.<br>
<br>
   Interestingly enough, if you look at the &quot;getWorkItem&quot; method of the<br>
&quot;org.drools.persistence.processinstance.WorkItemInfo&quot;, it passes a NULL for<br>
a RuleBase while setting up a context:<br>
<br>
    public WorkItem getWorkItem() {<br>
        if ( workItem == null ) {<br>
            try {<br>
                ByteArrayInputStream bais = new ByteArrayInputStream(<br>
workItemByteArray );<br>
                MarshallerReaderContext context = new<br>
MarshallerReaderContext( bais,<br>
<br>
<br>
null,  // THIS IS a RULEBASE &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;<br>
<br>
<br>
null,<br>
<br>
null );<br>
                workItem = InputMarshaller.readWorkItem( context );<br>
<br>
   And right after that, when trying to set parameters on the work item, it<br>
uses that RuleBase in MarshallerReaderContext:<br>
<br>
<br>
    protected Class&lt; ? &gt; resolveClass(ObjectStreamClass desc) throws<br>
IOException, ClassNotFoundException {<br>
        String name = desc.getName();<br>
        try {<br>
<br>
            return Class.forName(name, false,<br>
this.ruleBase.getRootClassLoader()); // HERE IS WHERE THE NULL POINTER<br>
EXCEPTION OCCURS &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt; since the RuleBase is NULL<br>
<br>
        } catch (ClassNotFoundException ex) {<br>
            return super.resolveClass( desc );<br>
        }<br>
    }<br>
<br>
    I am not sure why it is not passing a RuleBase in case of<br>
&quot;JPAWorkItemManager.completeWorkItem&quot;, but that is how it behaves.<br>
<br>
    I think Kris would be a good guy to explain the reason / the approach<br>
that should be taken.<br>
<br>
/Anatoly<br>
<font color="#888888">--<br>
View this message in context: <a href="http://n3.nabble.com/Resuming-Flow-NPE-when-completing-a-work-item-tp716847p717055.html" target="_blank">http://n3.nabble.com/Resuming-Flow-NPE-when-completing-a-work-item-tp716847p717055.html</a><br>

</font><div><div></div><div class="h5">Sent from the Drools - User mailing list archive at Nabble.com.<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br> - <a href="http://salaboy.wordpress.com">http://salaboy.wordpress.com</a><br> - <a href="http://www.jbug.com.ar">http://www.jbug.com.ar</a><br> - Salatino &quot;Salaboy&quot; Mauricio -<br>