<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi,<div><br></div><div>I've tried to serialize the KnowledgeBase to use later but when I do that, I get NullPointer in few rules that doesn't happens when running while building it form scrap:</div><div><br></div><div><div><div><b>Caused by: javax.ejb.EJBException: Exception executing consequence for rule "process sentence" in my.rules: java.lang.NullPointerException</b></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>--</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>at java.lang.reflect.Method.invoke(Method.java:597)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>at org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1052)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>at org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1124)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>at com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:5388)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>at com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:619)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:800)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:571)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>at org.jboss.weld.ejb.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:42)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>at sun.reflect.GeneratedMethodAccessor277.invoke(Unknown Source)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>at java.lang.reflect.Method.invoke(Method.java:597)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:861)</div></div></div><div><br></div><div><br></div><div>Im afraid that some transient attributes are used. Should I cache it on RAM?</div><div><br></div><div>Thanks in advance.</div><div><br><div apple-content-edited="true">
<span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px; "><div>Paulo Reis</div><div><a href="mailto:casmeiron@gmail.com">casmeiron@gmail.com</a></div><div><br></div></span><br class="Apple-interchange-newline">

</div>
<br><div><div>On Aug 23, 2012, at 2:24 PM, Paulo Reis &lt;<a href="mailto:casmeiron@gmail.com">casmeiron@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html charset=us-ascii"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Thank you guys.<div>I will take the advices, will try storing the bytes on the db and later recasting to object or putting on the server memory.</div><div><br></div><div>I didn't know I could serialize KnowledgeBase.</div><div><br></div><div>Thanks.</div><div><br><div apple-content-edited="true">
<span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div>Paulo Reis</div><div><a href="mailto:casmeiron@gmail.com">casmeiron@gmail.com</a></div><div><br></div></span><br class="Apple-interchange-newline">

</div>
<br><div><div>On Aug 23, 2012, at 12:39 PM, lhorton &lt;<a href="mailto:LHorton@ABCLegal.com">LHorton@ABCLegal.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">At my shop, our design is to build the knowledge bases only once, when the<br>rules server starts up. &nbsp;Each knowledge base stays in server memory, and a<br>session (we use stateless) is created for each request, when the request<br>comes in. &nbsp;&nbsp;Creating the knowledge base is slow, but session creation is<br>very fast (we have thousands of rules). &nbsp;If you search this forum on<br>"knowledge base expensive" you'll find lots of tuning advice.<br><br><br><br>--<br>View this message in context: <a href="http://drools.46999.n3.nabble.com/rules-users-Marshalling-Unmarshalling-KnowledgeBase-StatefulSession-tp4019349p4019365.html">http://drools.46999.n3.nabble.com/rules-users-Marshalling-Unmarshalling-KnowledgeBase-StatefulSession-tp4019349p4019365.html</a><br>Sent from the Drools: User forum mailing list archive at <a href="http://nabble.com/">Nabble.com</a>.<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">https://lists.jboss.org/mailman/listinfo/rules-users</a><br></blockquote></div><br></div></div></blockquote></div><br></div></body></html>