<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi,&nbsp;<div><br></div><div>I was trying to change the persistence settings for human task process server for using MySQL instead of H2DB.&nbsp;</div><div><br></div><div>I was following the Drools Flows Documentation on chapter 5.1.3.: Configuring Persistence.(<a href="https://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/docs/drools-flow/html_single/index.html">https://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/docs/drools-flow/html_single/index.html</a>#d0e1157)</div><div><br></div><div>I read on docs that I should override the persistence.xml of the&nbsp;drools-process-enterprise.jar, create the drools.session.conf with some contents (i don`t undestand` what it is...) and put them on my project&nbsp;META-INF directory... ok?</div><div><br></div><div>I created the files as stated on docs but it didn't work... &nbsp;My example runned ok, but using the H2DB and not my MYSQL.</div><div><br></div><div><span class="Apple-style-span" style="font-family: Monaco; font-size: 11px; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(63, 127, 95); "><span style="color: rgb(0, 0, 0); "><span class="Apple-tab-span" style="white-space: pre; ">                </span></span>// Use persistence.xml configuration</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><span class="Apple-tab-span" style="white-space: pre; ">                </span><span style="color: rgb(0, 0, 192); ">emf</span>&nbsp;= Persistence.createEntityManagerFactory(<span style="color: rgb(42, 0, 255); ">"org.drools.persistence.jpa"</span>);</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><span class="Apple-tab-span" style="white-space: pre; ">                </span><span style="color: rgb(0, 0, 192); ">taskService</span>&nbsp;=&nbsp;<span style="color: rgb(127, 0, 85); ">new</span>&nbsp;TaskService(<span style="color: rgb(0, 0, 192); ">emf</span>);</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(0, 0, 192); "><span class="Apple-style-span" style="color: rgb(0, 0, 0); "><span class="Apple-tab-span" style="white-space: pre; ">                </span><span style="color: rgb(0, 0, 192); ">taskSession</span>&nbsp;=&nbsp;<span style="color: rgb(0, 0, 192); ">taskService</span>.createSession();</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><span class="Apple-tab-span" style="white-space: pre; ">                </span><span style="color: rgb(0, 0, 192); ">server</span>&nbsp;=&nbsp;<span style="color: rgb(127, 0, 85); ">new</span>&nbsp;MinaTaskServer(<span style="color: rgb(0, 0, 192); ">taskService</span>);</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><span class="Apple-tab-span" style="white-space: pre; ">                </span>Thread thread =&nbsp;<span style="color: rgb(127, 0, 85); ">new</span>&nbsp;Thread(<span style="color: rgb(0, 0, 192); ">server</span>);</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><span class="Apple-tab-span" style="white-space: pre; ">                </span>thread.start();</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><span class="Apple-tab-span" style="white-space: pre; ">                </span>Thread.sleep(500);</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(0, 0, 192); "><span class="Apple-style-span" style="color: rgb(0, 0, 0); "><span class="Apple-tab-span" style="white-space: pre; ">                </span>System.<span style="color: rgb(0, 0, 192); ">out</span>.println(<span style="color: rgb(42, 0, 255); ">"Server started ..."</span>);</span></div><div><br></div></div></span></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(63, 127, 127); "><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">                </span></span><span style="color: #008080">&lt;</span>properties<span style="color: #008080">></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(42, 0, 255); "><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">                        </span></span><span style="color: #008080">&lt;</span><span style="color: #3f7f7f">property</span><span style="color: #000000"> </span><span style="color: #7f007f">name</span><span style="color: #000000">=</span>"hibernate.dialect"<span style="color: #000000"> </span><span style="color: #7f007f">value</span><span style="color: #000000">=</span>"org.hibernate.dialect.MySQL5Dialect"<span style="color: #000000"> </span><span style="color: #008080">/></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(42, 0, 255); "><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">                        </span></span><span style="color: #008080">&lt;</span><span style="color: #3f7f7f">property</span><span style="color: #000000"> </span><span style="color: #7f007f">name</span><span style="color: #000000">=</span>"hibernate.connection.driver_class"<span style="color: #000000"> </span><span style="color: #7f007f">value</span><span style="color: #000000">=</span>"com.mysql.jdbc.Driver"<span style="color: #000000"> </span><span style="color: #008080">/></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(42, 0, 255); "><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">                        </span></span><span style="color: #008080">&lt;</span><span style="color: #3f7f7f">property</span><span style="color: #000000"> </span><span style="color: #7f007f">name</span><span style="color: #000000">=</span>"hibernate.connection.url"<span style="color: #000000"> </span><span style="color: #7f007f">value</span><span style="color: #000000">=</span>"jdbc:mysql://localhost/drools"<span style="color: #000000"> </span><span style="color: #008080">/></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(42, 0, 255); "><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">                        </span></span><span style="color: #008080">&lt;</span><span style="color: #3f7f7f">property</span><span style="color: #000000"> </span><span style="color: #7f007f">name</span><span style="color: #000000">=</span>"hibernate.connection.username"<span style="color: #000000"> </span><span style="color: #7f007f">value</span><span style="color: #000000">=</span>"root"<span style="color: #000000"> </span><span style="color: #008080">/></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(42, 0, 255); "><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">                        </span></span><span style="color: #008080">&lt;</span><span style="color: #3f7f7f">property</span><span style="color: #000000"> </span><span style="color: #7f007f">name</span><span style="color: #000000">=</span>"hibernate.connection.password"<span style="color: #000000"> </span><span style="color: #7f007f">value</span><span style="color: #000000">=</span>""<span style="color: #000000"> </span><span style="color: #008080">/></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(42, 0, 255); "><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">                        </span></span><span style="color: #008080">&lt;</span><span style="color: #3f7f7f">property</span><span style="color: #000000"> </span><span style="color: #7f007f">name</span><span style="color: #000000">=</span>"hibernate.connection.autocommit"<span style="color: #000000"> </span><span style="color: #7f007f">value</span><span style="color: #000000">=</span>"false"<span style="color: #000000"> </span><span style="color: #008080">/></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(42, 0, 255); "><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">                        </span></span><span style="color: #008080">&lt;</span><span style="color: #3f7f7f">property</span><span style="color: #000000"> </span><span style="color: #7f007f">name</span><span style="color: #000000">=</span>"hibernate.max_fetch_depth"<span style="color: #000000"> </span><span style="color: #7f007f">value</span><span style="color: #000000">=</span>"3"<span style="color: #000000"> </span><span style="color: #008080">/></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(42, 0, 255); "><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">                        </span></span><span style="color: #008080">&lt;</span><span style="color: #3f7f7f">property</span><span style="color: #000000"> </span><span style="color: #7f007f">name</span><span style="color: #000000">=</span>"hibernate.hbm2ddl.auto"<span style="color: #000000"> </span><span style="color: #7f007f">value</span><span style="color: #000000">=</span>"create-drop"<span style="color: #000000"> </span><span style="color: #008080">/></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(42, 0, 255); "><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">                        </span></span><span style="color: #008080">&lt;</span><span style="color: #3f7f7f">property</span><span style="color: #000000"> </span><span style="color: #7f007f">name</span><span style="color: #000000">=</span>"hibernate.show_sql"<span style="color: #000000"> </span><span style="color: #7f007f">value</span><span style="color: #000000">=</span>"true"<span style="color: #000000"> </span><span style="color: #008080">/></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(63, 127, 127); "><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">                </span></span><span style="color: #008080">&lt;/</span>properties<span style="color: #008080">></span></div><div><font class="Apple-style-span" color="#008080" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 11px;"><br></span></font></div></div><div><br></div><div>After some investigation I could see that the example recommended by Mark Proctor (<span class="Apple-style-span" style="font-family: Monaco; font-size: 11px; ">TaskLifeCycleTest.java, and others that use MinaTaskServer) use &lt;<span class="Apple-style-span" style="color: rgb(63, 95, 191); ">persistence-unit name =&nbsp;"org.drools.task"> that is setting&nbsp;<font class="Apple-style-span" color="#000000">on&nbsp;<span class="Apple-style-span" style="font-family: Helvetica; font-size: 12px; ">drools-process-task.jar</span>&nbsp;and not the</font><span class="Apple-style-span" style="color: rgb(0, 0, 0); "><span class="Apple-style-span" style="color: rgb(63, 95, 191); ">&nbsp;<span class="Apple-style-span" style="color: rgb(42, 0, 255); ">"org.drools.persistence.jpa" on&nbsp;<span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; ">drools-process-enterprise.jar&nbsp;as stated on documentation...</span></span></span></span></span></span></div><div><div><br></div><div><span class="Apple-style-span" style="font-family: Monaco; font-size: 11px; "><div>First question, which one should I use for use the Drools Flows Server and Client?</div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(63, 127, 95); "><span class="Apple-style-span" style="color: rgb(0, 0, 0); ">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: rgb(0, 0, 192); ">emf</span>&nbsp;= Persistence.createEntityManagerFactory(&nbsp;<span style="color: rgb(42, 0, 255); ">"org.drools.task"</span>&nbsp;);</span></div><div><br></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 11px; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><span class="Apple-tab-span" style="white-space: pre; ">        </span><span style="color: rgb(0, 0, 192); ">emf</span>&nbsp;= Persistence.createEntityManagerFactory(<span style="color: rgb(42, 0, 255); ">"org.drools.persistence.jpa"</span>);</div><div><br></div></span></font></div></div></span></div><div><br></div><div>I test the first option. I changed the persistence.xml file and use the code below:</div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(63, 127, 95); "><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">                </span></span>// Use persistence.xml configuration</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><span class="Apple-tab-span" style="white-space:pre">                </span><span style="color: #0000c0">emf</span> = Persistence.createEntityManagerFactory(<span style="color: #2a00ff">"org.drools.task"</span>);</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><span class="Apple-tab-span" style="white-space:pre">                </span><span style="color: #0000c0">taskService</span> = <span style="color: #7f0055">new</span> TaskService(<span style="color: #0000c0">emf</span>);</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(0, 0, 192); "><span class="Apple-style-span" style="color: rgb(0, 0, 0); "><span class="Apple-tab-span" style="white-space:pre">                </span><span style="color: #0000c0">taskSession</span> = <span style="color: #0000c0">taskService</span>.createSession();</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><span class="Apple-tab-span" style="white-space:pre">                </span><span style="color: #0000c0">server</span> = <span style="color: #7f0055">new</span> MinaTaskServer(<span style="color: #0000c0">taskService</span>);</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><span class="Apple-tab-span" style="white-space:pre">                </span>Thread thread = <span style="color: #7f0055">new</span> Thread(<span style="color: #0000c0">server</span>);</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><span class="Apple-tab-span" style="white-space:pre">                </span>thread.start();</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><span class="Apple-tab-span" style="white-space:pre">                </span>Thread.sleep(500);</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(0, 0, 192); "><span class="Apple-style-span" style="color: rgb(0, 0, 0); "><span class="Apple-tab-span" style="white-space:pre">                </span>System.<span style="color: #0000c0">out</span>.println(<span style="color: #2a00ff">"Server started ..."</span>);</span></div><div><br></div><div><br></div><div><br></div><div>Hummm.... It runs and connect well to my MySQL. but now it brings me a error...</div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; min-height: 15px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(255, 0, 0); "><span style="text-decoration: underline ; color: #000080">java.lang.IllegalArgumentException</span>: Named query not found: UnescalatedDeadlines</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(255, 0, 0); "><span class="Apple-tab-span" style="white-space:pre">        </span>at org.hibernate.ejb.AbstractEntityManagerImpl.createNamedQuery(<span style="text-decoration: underline ; color: #000080">AbstractEntityManagerImpl.java:108</span>)</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(255, 0, 0); "><span class="Apple-tab-span" style="white-space:pre">        </span>at org.drools.task.service.TaskService.&lt;init>(<span style="text-decoration: underline ; color: #000080">TaskService.java:84</span>)</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(255, 0, 0); "><span class="Apple-tab-span" style="white-space:pre">        </span>at org.drools.task.service.TaskService.&lt;init>(<span style="text-decoration: underline ; color: #000080">TaskService.java:68</span>)</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(255, 0, 0); "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(255, 0, 0); "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(255, 0, 0); "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(255, 0, 0); "><font class="Apple-style-span" color="#000000">It sounds like it was not possible to find orm.xml that is on META-INF of&nbsp;<span class="Apple-style-span" style="font-family: Helvetica; font-size: 12px; ">drools-process-task.jar.</span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(255, 0, 0); "><font class="Apple-style-span" color="#000000" face="Helvetica" size="3"><span class="Apple-style-span" style="font-size: 12px;"><br></span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(255, 0, 0); "><font class="Apple-style-span" color="#000000"><span class="Apple-style-span" style="font-family: Helvetica; font-size: 12px; ">But when I copy the orm.xml file to my project META-INF it works ok<span class="Apple-style-span" style="font-family: Monaco; font-size: 11px; ">....</span></span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(255, 0, 0); "><br></div></div><div><br></div><div>Could someone give some ideas how can I solve this problem..</div><div><br></div><div>Thanks a lot</div><div><br></div></div></div><div><br></div><div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 11px;"><div>Cristiano</div><div><br></div></span></font></div><div apple-content-edited="true"> <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div><br></div></div></div></span></div></span></div></span></div></div></div></body></html>