2 Replies Latest reply on Jun 18, 2014 2:41 PM by Tim McClure

    Issue Trying to use JBPM 6.1, Jetty and MySql

    Tim McClure Apprentice

      I am using JBPM 6.1 and trying to configure mysql with jetty in my netbeans environment.  I bring the kie webapp up with h2 but when I switch to mysql I get the error listed below (along with gwt dev mode screenshot) despite the fact I have mysql configured in the pom.xml:

      <dependency>

        <groupId>mysql</groupId>

        <artifactId>mysql-connector-java</artifactId>

      </dependency>

       

      and in my jetty-env.xml

      <New id="jbpmConsoleDS" class="org.mortbay.jetty.plus.naming.Resource">

          <Arg>jdbc/jbpmConsoleDS</Arg>

          <Arg>

            <New class="bitronix.tm.resource.jdbc.PoolingDataSource">

              <Set name="uniqueName">jbpmConsoleDS</Set>

              <Set name="className">>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</Set>

              <Set name="maxPoolSize">50</Set>

              <Set name="allowLocalTransactions">true</Set>

              <Get name="driverProperties">

                <Put name="user">root</Put>

                <Put name="password">Miami1Heat</Put>

                <Put name="URL">jdbc:mysql://localhost:3306/jbpm</Put>

              </Get>

              <Call name="init"/>

            </New>

          </Arg>

        </New>

       

      Before the exception I get the following displayed on the GWT console:

      00:00:01.835 [WARN] Config error at <Call name="init"/>

              00:00:01.835 [WARN] Config error at <New id="jbpmConsoleDS" class="org.mortbay.jetty.plus.naming.Resource"><Arg>jdbc/jbpmConsoleDS</Arg><Arg>

      <New class="bitronix.tm.resource.jdbc.PoolingDataSource"><Set name="uniqueName">jbpmConsoleDS</Set><Set name="className">>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</Set><Set name="maxPoolSize">50</Set><Set name="allowLocalTransactions">true</Set><Get name="driverProperties"><Put name="user">root</Put><Put name="password">Miami1Heat</Put><Put name="URL">jdbc:mysql://localhost:3306/jbpm</Put></Get><Call name="init"/></New>

      </Arg></New>    

       

      I think there might be something regarding this errai jetty plugin.  Any help would be greatly appreciated.

       

      Tim

       

      00:00:01.835  [WARN] Failed startup of context org.jboss.errai.cdi.server.gwt.JettyLauncher$WebAppContextWithReload@3c616d10{/,/Users/timothymcclure/dakota-wb/kie-wb-distributions/kie-wb/kie-wb-webapp/target/kie-wb-webapp-6.1.0.CR1}

      <pre>java.lang.reflect.InvocationTargetException: null

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:606)

        at org.mortbay.xml.XmlConfiguration.call(XmlConfiguration.java:534)

        at org.mortbay.xml.XmlConfiguration.configure(XmlConfiguration.java:244)

        at org.mortbay.xml.XmlConfiguration.newObj(XmlConfiguration.java:618)

        at org.mortbay.xml.XmlConfiguration.itemValue(XmlConfiguration.java:907)

        at org.mortbay.xml.XmlConfiguration.value(XmlConfiguration.java:829)

        at org.mortbay.xml.XmlConfiguration.newObj(XmlConfiguration.java:585)

        at org.mortbay.xml.XmlConfiguration.configure(XmlConfiguration.java:248)

        at org.mortbay.xml.XmlConfiguration.configure(XmlConfiguration.java:182)

        at org.mortbay.jetty.plus.webapp.EnvConfiguration.configureWebApp(EnvConfiguration.java:130)

        at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1217)

        at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:513)

        at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448)

        at org.jboss.errai.cdi.server.gwt.JettyLauncher$WebAppContextWithReload.doStart(JettyLauncher.java:525)

        at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)

        at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)

        at org.mortbay.jetty.handler.RequestLogHandler.doStart(RequestLogHandler.java:115)

        at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)

        at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)

        at org.mortbay.jetty.Server.doStart(Server.java:222)

        at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)

        at org.jboss.errai.cdi.server.gwt.JettyLauncher.start(JettyLauncher.java:738)

        at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:509)

        at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:1093)

        at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:836)

        at com.google.gwt.dev.DevMode.main(DevMode.java:311)

      Caused by: bitronix.tm.resource.ResourceConfigurationException: cannot create JDBC datasource named jbpmConsoleDS

        at bitronix.tm.resource.jdbc.PoolingDataSource.init(PoolingDataSource.java:92)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:606)

        at org.mortbay.xml.XmlConfiguration.call(XmlConfiguration.java:534)

        at org.mortbay.xml.XmlConfiguration.configure(XmlConfiguration.java:244)

        at org.mortbay.xml.XmlConfiguration.newObj(XmlConfiguration.java:618)

        at org.mortbay.xml.XmlConfiguration.itemValue(XmlConfiguration.java:907)

        at org.mortbay.xml.XmlConfiguration.value(XmlConfiguration.java:829)

        at org.mortbay.xml.XmlConfiguration.newObj(XmlConfiguration.java:585)

        at org.mortbay.xml.XmlConfiguration.configure(XmlConfiguration.java:248)

        at org.mortbay.xml.XmlConfiguration.configure(XmlConfiguration.java:182)

        at org.mortbay.jetty.plus.webapp.EnvConfiguration.configureWebApp(EnvConfiguration.java:130)

        at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1217)

        at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:513)

        at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448)

        at org.jboss.errai.cdi.server.gwt.JettyLauncher$WebAppContextWithReload.doStart(JettyLauncher.java:525)

        at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)

        at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)

        at org.mortbay.jetty.handler.RequestLogHandler.doStart(RequestLogHandler.java:115)

        at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)

        at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)

        at org.mortbay.jetty.Server.doStart(Server.java:222)

        at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)

        at org.jboss.errai.cdi.server.gwt.JettyLauncher.start(JettyLauncher.java:738)

        at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:509)

        at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:1093)

        at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:836)

        at com.google.gwt.dev.DevMode.main(DevMode.java:311)

      Caused by: java.lang.ClassNotFoundException: >com.mysql.jdbc.jdbc2.optional.MysqlXADataSource

        at java.net.URLClassLoader$1.run(URLClassLoader.java:366)

        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)

        at java.security.AccessController.doPrivileged(Native Method)

        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)

        at java.lang.ClassLoader.loadClass(ClassLoader.java:425)

        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)

        at java.lang.ClassLoader.loadClass(ClassLoader.java:358)

        at java.lang.Class.forName0(Native Method)

        at java.lang.Class.forName(Class.java:190)

        at bitronix.tm.utils.ClassLoaderUtils.loadClass(ClassLoaderUtils.java:63)

        at bitronix.tm.resource.common.XAPool.createXAFactory(XAPool.java:292)

        at bitronix.tm.resource.common.XAPool.<init>(XAPool.java:63)

        at bitronix.tm.resource.jdbc.PoolingDataSource.buildXAPool(PoolingDataSource.java:101)

        at bitronix.tm.resource.jdbc.PoolingDataSource.init(PoolingDataSource.java:88)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:606)

        at org.mortbay.xml.XmlConfiguration.call(XmlConfiguration.java:534)

        at org.mortbay.xml.XmlConfiguration.configure(XmlConfiguration.java:244)

        at org.mortbay.xml.XmlConfiguration.newObj(XmlConfiguration.java:618)

        at org.mortbay.xml.XmlConfiguration.itemValue(XmlConfiguration.java:907)

        at org.mortbay.xml.XmlConfiguration.value(XmlConfiguration.java:829)

        at org.mortbay.xml.XmlConfiguration.newObj(XmlConfiguration.java:585)

        at org.mortbay.xml.XmlConfiguration.configure(XmlConfiguration.java:248)

        at org.mortbay.xml.XmlConfiguration.configure(XmlConfiguration.java:182)

        at org.mortbay.jetty.plus.webapp.EnvConfiguration.configureWebApp(EnvConfiguration.java:130)

        at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1217)

        at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:513)

        at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448)

        at org.jboss.errai.cdi.server.gwt.JettyLauncher$WebAppContextWithReload.doStart(JettyLauncher.java:525)

        at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)

        at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)

        at org.mortbay.jetty.handler.RequestLogHandler.doStart(RequestLogHandler.java:115)

        at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)

        at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)

        at org.mortbay.jetty.Server.doStart(Server.java:222)

        at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)

        at org.jboss.errai.cdi.server.gwt.JettyLauncher.start(JettyLauncher.java:738)

        at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:509)

        at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:1093)

        at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:836)

        at com.google.gwt.dev.DevMode.main(DevMode.java:311)</pre>

        • 1. Re: Issue Trying to use JBPM 6.1, Jetty and MySql
          Kris Verlaenen Master

          Xml around "classname" seems invalid, double > and no closing Set tag

          • 2. Re: Issue Trying to use JBPM 6.1, Jetty and MySql
            Tim McClure Apprentice

            Kris,

             

            Thanks for pointing out my stupid mistake however I fixed this issue and still had the same problem.  In 6.1 it seems the maven enforcer is forcing the use of managed versions - meaning it is forcing the use of mysql driver 5.1.22 - I get the error above when using this version.  I used the maven configuration below to turn off the enforcement and it allowed me to override the mysql version - I set it to 5.1.6 - what I was using previously.  Strangely it seems 5.1.22 works with the JBoss configuration but not the jetty - anyone have any input on this?

             

            Tim

             

              <plugin>

                  <artifactId>maven-enforcer-plugin</artifactId>

                  <version>1.0</version>

                  <dependencies>

                    <dependency>

                      <groupId>org.commonjava.maven.enforcer</groupId>

                      <artifactId>enforce-managed-deps-rule</artifactId>

                      <version>1.0</version>

                    </dependency>

                  </dependencies>

                  <executions>

                    <execution>

                      <id>no-managed-deps</id>

                      <goals>

                        <goal>enforce</goal>

                      </goals>

                      <phase>initialize</phase>

                      <configuration>

                        <rules>

                          <requireManagedDeps implementation="org.commonjava.maven.enforcer.rule.EnforceManagedDepsRule">

                            <checkProfiles>true</checkProfiles>

                            <failOnViolation>false</failOnViolation>

                          </requireManagedDeps>

                        </rules>

                      </configuration>

                    </execution>

                  </executions>

                </plugin>