<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    how to use jbpm5 in web app
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="http://community.jboss.org/people/sd1527907">losfa jon</a> in <i>jBPM</i> - <a href="http://community.jboss.org/message/634721#634721">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>hi</p><p>i have a question when i use jbpm5 in web app</p><p>i user jboss5.1GA and mysql5.1 </p><p>i have config a database on jboss and i can use it on my app like it</p><p>&#160;&#160;&#160;&#160; emf = Persistence.createEntityManagerFactory( "org.jbpm.persistence.jpa1" );</p><p>but when i </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>JPAKnowledgeService.newStatefulKnowledgeSession(kbase, config, env);</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>i have a example </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>10:46:46,464 WARN&#160; [JtaTransactionManager] Participating in existing JTA transaction, but no JTA TransactionManager or TransactionSychronizationRegistry available: </p><p>java.lang.NullPointerException</p><p> at org.drools.persistence.jta.JtaTransactionManager.registerTransactionSynchronization(JtaTransactionManager.java:221)</p><p> at org.drools.persistence.SingleSessionCommandService.registerRollbackSync(SingleSessionCommandService.java:333)</p><p> at org.drools.persistence.SingleSessionCommandService.&lt;init&gt;(SingleSessionCommandService.java:123)</p><p> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)</p><p> at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)</p><p> at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)</p><p> at java.lang.reflect.Constructor.newInstance(Constructor.java:513)</p><p> at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.buildCommanService(KnowledgeStoreServiceImpl.java:116)</p><p> at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.newStatefulKnowledgeSession(KnowledgeStoreServiceImpl.java:54)</p><p> at org.drools.persistence.jpa.JPAKnowledgeService.newStatefulKnowledgeSession(JPAKnowledgeService.java:122)</p><p> at com.sample.test2.createKnowledgeSession(test2.java:168)</p><p> at action.TaskListAction.index(TaskListAction.java:51)</p><p> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)</p><p> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)</p><p> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)</p><p> at java.lang.reflect.Method.invoke(Method.java:597)</p><p> at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:270)</p><p> at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:187)</p><p> at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)</p><p> at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)</p><p> at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)</p><p> at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)</p><p> at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)</p><p> at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)</p><p> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)</p><p> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)</p><p> at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:638)</p><p> at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:444)</p><p> at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:382)</p><p> at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:310)</p><p> at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1085)</p><p> at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:398)</p><p> at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:241)</p><p> at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)</p><p> at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)</p><p> at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)</p><p> at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)</p><p> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)</p><p> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)</p><p> at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)</p><p> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)</p><p> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)</p><p> at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)</p><p> at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)</p><p> at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)</p><p> at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)</p><p> at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)</p><p> at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)</p><p> at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)</p><p> at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)</p><p> at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)</p><p> at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)</p><p> at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)</p><p> at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)</p><p> at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)</p><p> at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)</p><p> at java.lang.Thread.run(Thread.java:619)</p><p>10:46:47,229 WARN&#160; [RequestProcessor] Unhandled Exception thrown: class java.lang.IllegalStateException</p><p>10:46:47,229 ERROR [[action]] Servlet.service() for servlet action threw exception</p><p>java.lang.NullPointerException</p><p> at org.drools.persistence.SingleSessionCommandService.&lt;init&gt;(SingleSessionCommandService.java:138)</p><p> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)</p><p> at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)</p><p> at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)</p><p> at java.lang.reflect.Constructor.newInstance(Constructor.java:513)</p><p> at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.buildCommanService(KnowledgeStoreServiceImpl.java:116)</p><p> at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.newStatefulKnowledgeSession(KnowledgeStoreServiceImpl.java:54)</p><p> at org.drools.persistence.jpa.JPAKnowledgeService.newStatefulKnowledgeSession(JPAKnowledgeService.java:122)</p><p> at com.sample.test2.createKnowledgeSession(test2.java:168)</p><p> at action.TaskListAction.index(TaskListAction.java:51)</p><p> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)</p><p> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)</p><p> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)</p><p> at java.lang.reflect.Method.invoke(Method.java:597)</p><p> at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:270)</p><p> at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:187)</p><p> at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)</p><p> at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)</p><p> at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)</p><p> at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)</p><p> at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)</p><p> at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)</p><p> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)</p><p> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)</p><p> at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:638)</p><p> at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:444)</p><p> at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:382)</p><p> at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:310)</p><p> at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1085)</p><p> at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:398)</p><p> at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:241)</p><p> at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)</p><p> at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)</p><p> at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)</p><p> at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)</p><p> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)</p><p> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)</p><p> at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)</p><p> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)</p><p> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)</p><p> at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)</p><p> at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)</p><p> at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)</p><p> at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)</p><p> at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)</p><p> at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)</p><p> at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)</p><p> at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)</p><p> at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)</p><p> at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)</p><p> at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)</p><p> at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)</p><p> at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)</p><p> at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)</p><p> at java.lang.Thread.run(Thread.java:619)</p><p>10:46:47,229 ERROR [[action]] Servlet.service() for servlet action threw exception</p><p>java.lang.NullPointerException</p><p> at org.drools.persistence.SingleSessionCommandService.&lt;init&gt;(SingleSessionCommandService.java:138)</p><p> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)</p><p> at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)</p><p> at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)</p><p> at java.lang.reflect.Constructor.newInstance(Constructor.java:513)</p><p> at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.buildCommanService(KnowledgeStoreServiceImpl.java:116)</p><p> at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.newStatefulKnowledgeSession(KnowledgeStoreServiceImpl.java:54)</p><p> at org.drools.persistence.jpa.JPAKnowledgeService.newStatefulKnowledgeSession(JPAKnowledgeService.java:122)</p><p> at com.sample.test2.createKnowledgeSession(test2.java:168)</p><p> at action.TaskListAction.index(TaskListAction.java:51)</p><p> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)</p><p> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)</p><p> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)</p><p> at java.lang.reflect.Method.invoke(Method.java:597)</p><p> at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:270)</p><p> at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:187)</p><p> at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)</p><p> at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)</p><p> at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)</p><p> at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)</p><p> at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)</p><p> at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)</p><p> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)</p><p> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)</p><p> at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:638)</p><p> at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:444)</p><p> at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:382)</p><p> at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:310)</p><p> at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1085)</p><p> at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:398)</p><p> at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:241)</p><p> at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)</p><p> at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)</p><p> at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)</p><p> at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)</p><p> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)</p><p> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)</p><p> at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)</p><p> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)</p><p> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)</p><p> at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)</p><p> at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)</p><p> at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)</p><p> at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)</p><p> at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)</p><p> at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)</p><p> at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)</p><p> at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)</p><p> at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)</p><p> at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)</p><p> at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)</p><p> at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)</p><p> at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)</p><p> at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)</p><p> at java.lang.Thread.run(Thread.java:619)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>if someone who know please help</p><p>thanks</p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/634721#634721">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in jBPM at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>