<div dir="ltr">Hi,<div><br></div><div>I have created a java + spring project to run a HumanTask example on Apache Karaf. To instantiate the class, I use spring like this </div><div><br></div><div><div>&lt;beans xmlns=&quot;<a href="http://www.springframework.org/schema/beans">http://www.springframework.org/schema/beans</a>&quot;</div>
<div>       xmlns:xsi=&quot;<a href="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</a>&quot;</div><div>       xsi:schemaLocation=&quot;</div><div>       <a href="http://www.springframework.org/schema/beans">http://www.springframework.org/schema/beans</a> <a href="http://www.springframework.org/schema/beans/spring-beans.xsd">http://www.springframework.org/schema/beans/spring-beans.xsd</a></div>
<div>    &quot;&gt;</div><div><br></div><div>  &lt;bean id=&quot;humanTaskExample&quot; class=&quot;org.jbpm.osgi.example.HumanTaskExample&quot;<br></div><div>        init-method=&quot;configure&quot;/&gt;</div><div><br></div>
<div>&lt;/beans&gt;</div></div><div><br></div><div><div>public class HumanTaskExample {</div><div><br></div><div>    public static void configure() {</div><div><br></div><div>        RuntimeManager manager = getRuntimeManager(&quot;humantask/HumanTask.bpmn&quot;);</div>
</div><div><br></div><div>...</div><div><br></div><div><div>    private static RuntimeManager getRuntimeManager(String process) {</div><div>        // load up the knowledge base</div><div>        JBPMHelper.startUp();</div>
</div><div><br></div><div>...</div><div><br></div><div>The JBPMHelper class used corresponds to : <a href="https://github.com/droolsjbpm/jbpm/blob/master/jbpm-test/src/main/java/org/jbpm/test/JBPMHelper.java">https://github.com/droolsjbpm/jbpm/blob/master/jbpm-test/src/main/java/org/jbpm/test/JBPMHelper.java</a></div>
<div><br></div><div>But when spring creates the dataSource, I get this error :</div><div><br></div><div><div>Caused by: bitronix.tm.resource.ResourceConfigurationException: cannot create JDBC datasource named jdbc/jbpm-ds</div>
<div><span class="" style="white-space:pre">        </span>at bitronix.tm.resource.jdbc.PoolingDataSource.init(PoolingDataSource.java:80)</div><div><span class="" style="white-space:pre">        </span>at org.jbpm.osgi.example.JBPMHelper.setupDataSource(JBPMHelper.java:79)</div>
<div><span class="" style="white-space:pre">        </span>at org.jbpm.osgi.example.JBPMHelper.startUp(JBPMHelper.java:49)</div><div><span class="" style="white-space:pre">        </span>at org.jbpm.osgi.example.HumanTaskExample.getRuntimeManager(HumanTaskExample.java:88)</div>
<div><span class="" style="white-space:pre">        </span>at org.jbpm.osgi.example.HumanTaskExample.configure(HumanTaskExample.java:28)</div><div><span class="" style="white-space:pre">        </span>at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.6.0_45]</div>
<div><span class="" style="white-space:pre">        </span>at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)[:1.6.0_45]</div><div><span class="" style="white-space:pre">        </span>at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[:1.6.0_45]</div>
<div><span class="" style="white-space:pre">        </span>at java.lang.reflect.Method.invoke(Method.java:597)[:1.6.0_45]</div><div><span class="" style="white-space:pre">        </span>at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1546)[91:org.springframework.beans:3.0.7.RELEASE]</div>
<div><span class="" style="white-space:pre">        </span>at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1487)[91:org.springframework.beans:3.0.7.RELEASE]</div>
<div><span class="" style="white-space:pre">        </span>at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1419)[91:org.springframework.beans:3.0.7.RELEASE]</div>
<div><span class="" style="white-space:pre">        </span>... 14 more</div><div>Caused by: java.lang.IllegalArgumentException: resource with uniqueName &#39;jdbc/jbpm-ds&#39; has already been registered</div><div><span class="" style="white-space:pre">        </span>at bitronix.tm.resource.ResourceRegistrar.register(ResourceRegistrar.java:74)</div>
<div><span class="" style="white-space:pre">        </span>at bitronix.tm.resource.jdbc.PoolingDataSource.buildXAPool(PoolingDataSource.java:92)</div><div><span class="" style="white-space:pre">        </span>at bitronix.tm.resource.jdbc.PoolingDataSource.init(PoolingDataSource.java:76)</div>
</div><div><br></div><div>Any idea is welcome</div><div><br></div><div>Regards, <br clear="all"><div><br></div>-- <br><div>Charles Moulliard</div><div>Apache Committer / Sr. Enterprise Architect (RedHat)</div><div>Twitter : @cmoulliard | Blog : <a href="http://cmoulliard.blogspot.com" target="_blank">http://cmoulliard.blogspot.com</a></div>
<div><br></div>
</div></div>