<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Looks like data source is created
      twice. Do you have any other place that bootstraps data source via
      bitronix?<br>
      <br>
      Maciej<br>
      <br>
      W dniu 29.05.2013 07:23, Charles Moulliard pisze:<br>
    </div>
    <blockquote
cite="mid:CAAxZHdeggPa=u2s7eYGRid+s7k1SngFe17uCWhibKu855C65rg@mail.gmail.com"
      type="cite">
      <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&nbsp;</div>
        <div><br>
        </div>
        <div>
          <div>&lt;beans xmlns="<a moz-do-not-send="true"
              href="http://www.springframework.org/schema/beans">http://www.springframework.org/schema/beans</a>"</div>
          <div>&nbsp; &nbsp; &nbsp; &nbsp;xmlns:xsi="<a moz-do-not-send="true"
              href="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</a>"</div>
          <div>&nbsp; &nbsp; &nbsp; &nbsp;xsi:schemaLocation="</div>
          <div>&nbsp; &nbsp; &nbsp; &nbsp;<a moz-do-not-send="true"
              href="http://www.springframework.org/schema/beans">http://www.springframework.org/schema/beans</a>
            <a moz-do-not-send="true"
              href="http://www.springframework.org/schema/beans/spring-beans.xsd">http://www.springframework.org/schema/beans/spring-beans.xsd</a></div>
          <div>&nbsp; &nbsp; "&gt;</div>
          <div><br>
          </div>
          <div>&nbsp; &lt;bean id="humanTaskExample"
            class="org.jbpm.osgi.example.HumanTaskExample"<br>
          </div>
          <div>&nbsp; &nbsp; &nbsp; &nbsp; init-method="configure"/&gt;</div>
          <div><br>
          </div>
          <div>&lt;/beans&gt;</div>
        </div>
        <div><br>
        </div>
        <div>
          <div>public class HumanTaskExample {</div>
          <div><br>
          </div>
          <div>&nbsp; &nbsp; public static void configure() {</div>
          <div><br>
          </div>
          <div>&nbsp; &nbsp; &nbsp; &nbsp; RuntimeManager manager =
            getRuntimeManager("humantask/HumanTask.bpmn");</div>
        </div>
        <div><br>
        </div>
        <div>...</div>
        <div><br>
        </div>
        <div>
          <div>&nbsp; &nbsp; private static RuntimeManager
            getRuntimeManager(String process) {</div>
          <div>&nbsp; &nbsp; &nbsp; &nbsp; // load up the knowledge base</div>
          <div>&nbsp; &nbsp; &nbsp; &nbsp; JBPMHelper.startUp();</div>
        </div>
        <div><br>
        </div>
        <div>...</div>
        <div><br>
        </div>
        <div>The JBPMHelper class used corresponds to : <a
            moz-do-not-send="true"
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 'jdbc/jbpm-ds' 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,&nbsp;<br clear="all">
          <div><br>
          </div>
          -- <br>
          <div>Charles Moulliard</div>
          <div>Apache Committer / Sr. Enterprise Architect (RedHat)</div>
          <div>Twitter : @cmoulliard |&nbsp;Blog : <a moz-do-not-send="true"
              href="http://cmoulliard.blogspot.com" target="_blank">http://cmoulliard.blogspot.com</a></div>
          <div><br>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
rules-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-dev">https://lists.jboss.org/mailman/listinfo/rules-dev</a></pre>
    </blockquote>
    <br>
  </body>
</html>