12 Replies Latest reply on Jan 18, 2006 11:00 AM by petes4557

    problem in configuring jbpm for mysql database

    tanmay

      hi
      I want to use mysql as database for jbpm...
      I am using jbpm starters kit with eclipse and mysql 5.0
      I followed a forum topic
      http://www.jboss.com/index.html?module=bb&op=viewtopic&t=72947

      I gave the ant command to create db i.e "ant -buildfile build.deploy.xml create.db"
      the database tables are created but i get a following messege at the end..
      Can anybody please tell me where i am goin wrong..


      [deploypar] 22:06:44,975 DEBUG ProcessArchiveDeployer : committing transaction to deploy process ProcessDefinition(websale)
      BUILD FAILED
      C:\jbpm-starters-kit-with-eclipse-3.0\jbpm\build.deploy.xml:55: Attribute target
       or at least one nested target is required.


        • 1. Re: problem in configuring jbpm for mysql database
          lappi_79

          Hi,
          I followed the same article (with tomcat55 + mysql ),
          https://sourceforge.net/forum/message.php?msg_id=3301077
          I am stuck on step# 9 on
          ant create.db -buildfile build.deploy.xml
          It created the database tables but gave this error.
          Can you tell me if i went wrong someplace?


          BUILD FAILED
          C:\Downloads\jbpm-3.0.2\jbpm-3.0.2\build.deploy.xml:51: The following error occu
          rred while executing this line:
          C:\Downloads\jbpm-3.0.2\jbpm-3.0.2\build.deploy.xml:180: C:\server\default\lib n
          ot found.



          • 2. Re: problem in configuring jbpm for mysql database
            lappi_79

            I guess we are having the same issue!

            • 3. Re: problem in configuring jbpm for mysql database
              kukeltje

              Why do you think it is the same issue? I see two totally different errors. Im still looking for some explanation for the error of Tanmay, but your posting, lappi_79, looks like could be cause by a wrong reference to an non existing jboss config

              • 4. Re: problem in configuring jbpm for mysql database
                lappi_79

                I guess I thot its the same issue, cos it occured after the same line (printed to console)


                [deploypar] 10:19:00,313 DEBUG ProcessArchiveDeployer : committing transaction to deploy process ProcessDefinition(websale)


                • 5. Re: problem in configuring jbpm for mysql database
                  kukeltje

                  ahh.. but you did not report that, so how would we have known that ;-)

                  Still, the real lines are more important and those differ. Therefor I still do not think they are the same issue. Did you check if c:\server\default\lib exists on your system

                  • 6. Re: problem in configuring jbpm for mysql database
                    lappi_79

                    I made some progress, was able to get the build done.
                    You are right it was not the same issue.
                    But when I deployed the newly created jbpm.war, tomcat logs show some errors, does this look familiar?


                    Jan 12, 2006 4:36:19 PM org.apache.catalina.startup.HostConfig deployWAR
                    INFO: Deploying web application archive jbpm.war
                    Jan 12, 2006 4:36:20 PM org.apache.catalina.core.StandardContext start
                    SEVERE: Error listenerStart
                    Jan 12, 2006 4:36:20 PM org.apache.catalina.core.StandardContext start
                    SEVERE: Context [/jbpm] startup failed due to previous errors


                    • 7. Re: problem in configuring jbpm for mysql database
                      lappi_79

                      I could deply jbpm on tomcat(using mysql)
                      but on http://localhost:8080/jbpm
                      I get the following Exception, can someone please help

                      exception

                      javax.servlet.ServletException: Filter execution threw an exception
                      org.jbpm.webapp.filter.ContextFilter.doFilter(ContextFilter.java:19)
                      org.jbpm.webapp.filter.LogFilter.doFilter(LogFilter.java:38)


                      root cause

                      java.lang.NoClassDefFoundError
                      java.lang.Class.forName0(Native Method)
                      java.lang.Class.forName(Class.java:164)
                      org.jbpm.webapp.context.Context.class$(Context.java:33)
                      org.jbpm.webapp.context.Context.getPersistenceContext(Context.java:33)
                      org.jbpm.webapp.filter.PersistenceFilter.doFilter(PersistenceFilter.java:22)
                      org.jbpm.webapp.filter.ContextFilter.doFilter(ContextFilter.java:19)
                      org.jbpm.webapp.filter.LogFilter.doFilter(LogFilter.java:38)



                      Thanks in advance!!

                      • 8. Re: problem in configuring jbpm for mysql database
                        petes4557

                        I am seeing something similar to lappi's issue. I've also perused a number of other topics re: DB driver issues, but none directly correspond to my problem, or were able to help me fix it.

                        I've deployed jBPM 3.0.2 to JBoss 4.0.3 SP1. I'm testing a process definition using a simple servlet in a webapp. The servlet calls some utility code, packaged within an EAR. The jBPM core libraries are packaged in another EAR. Both EARs are within the ...\server\default\deploy directory.

                        The webapp worked fine when using the Hypersonic default DB. However, I've not had the same success with mySQL. I keep getting the following error message:

                        12:26:32,646 INFO [Configuration] processing association property references
                        12:26:32,646 INFO [Configuration] processing foreign key constraints
                        12:26:32,748 INFO [C3P0ConnectionProvider] C3P0 using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://localhost:1521/jbpm
                        12:26:32,748 INFO [C3P0ConnectionProvider] Connection properties: {user=root, password=****}
                        12:26:32,748 INFO [C3P0ConnectionProvider] autocommit mode: false
                        12:26:32,748 FATAL [C3P0ConnectionProvider] JDBC Driver class not found: com.mysql.jdbc.Driver
                        java.lang.ClassNotFoundException: No ClassLoaders found for: com.mysql.jdbc.Driver
                        at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:292)
                        at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:475)
                        at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:377)
                        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
                        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
                        at java.lang.Class.forName0(Native Method)
                        at java.lang.Class.forName(Class.java:164)
                        at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:108)
                        at org.hibernate.connection.C3P0ConnectionProvider.configure(C3P0ConnectionProvider.java:65)
                        at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvi
                        der(ConnectionProviderFactory.java:124)
                        at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvi
                        der(ConnectionProviderFactory.java:56)
                        at org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:366)... etc.

                        I deployed the mySQL driver in the ...\server\default\lib directory and added a datasource definition into the corresponding "deploy" directory.

                        I adjusted the hibernate.properties and hibernate.cfg.xml files and checked them repeatedly.

                        I even added a "resource-ref" to the webapp's "web.xml" file and added a "jboss-web.xml" file there, even though they weren't needed for Hypersonic. Still no luck.

                        It seems no matter what I do, I can't get my app, or Hibernate, to recognize the mySQL driver.

                        Any ideas to fix this would be most appreciated!

                        • 9. Re: problem in configuring jbpm for mysql database
                          petes4557

                          Forgot to mention in the above post...

                          The configured mySQL datasource seems to be deployed correctly by JBoss during startup, and has valid JMX entries in the JMX console.

                          This is the most perplexing part -- why can JBoss find the driver class, but my jBPM deployment cannot?

                          • 10. Re: problem in configuring jbpm for mysql database
                            ummadiravi78

                            Have you solved this problem?

                            Deploying mysql driver jar in the server/default/lib should ideally solve drive class loading problem. But, I think there is some class loading issues in your case.

                            If you have not sovled the problem yet, pl. let me know the contents of your jbpm core libraries ear file.
                            Also why you have deployed the libraries as ear instead of a 'sar' archive? You also could bundle the jbpm libraries with your application. Right?

                            Ravi Prakash

                            • 11. Re: problem in configuring jbpm for mysql database
                              ummadiravi78

                              Have you solved this problem?

                              Deploying mysql driver jar in the server/default/lib should ideally solve drive class loading problem. But, I think there is some class loading issues in your case.

                              If you have not sovled the problem yet, pl. let me know the contents of your jbpm core libraries ear file.
                              Also why you have deployed the libraries as ear instead of a 'sar' archive? You also could bundle the jbpm libraries with your application. Right?

                              Ravi Prakash

                              • 12. Re: problem in configuring jbpm for mysql database
                                petes4557

                                Hi Ravi,

                                I have solved the problem, but it wasn't how I expected. The main culprit in this is Hibernate.

                                My first issue was trying to get Hibernate to recognize the mySQL JDBC driver. I put that thing in nearly every possible location it could go within my JBoss environment, with no luck.

                                Finally, I played with my Hibernate configuration files. Turns out that, when deployed within JBoss, Hibernate must use a configured DataSource, not a collection of connection properties, such as "driver", "url", etc. Once I did this, jBPM was able to find my mySQL instance. This only seems to apply to external DB's, though --I did not have this problem with the internal Hypersonic DB. Moreover, I did not have this problem when running my test app within the Starter's Kit in Eclipse, even w/ mySQL.

                                I'd be very interested to know why Hibernate couldn't find the driver outside of a DataSource specification.

                                My second issue was simpler -- packaging up jBPM with the correct dependencies. jBPM 3.0.1 and JBoss 4.0.3 use different versions of Hibernate -- 3.0.5 for the former and 3.1 for the latter. This also includes different versions for some of the third-party libraries used by both jBPM and JBoss, such as collections-commons and BSH.

                                My goal was to minimize the number of duplicate libraries within my environment, but, in the end, I simply decided that the versioning issue was going to overrule this. Thus, I packaged jBPM with all libraries that were not included with, or had different versions than, the same libraries deployed with JBoss.

                                It seems that JBoss will allow classloading to occur from within the EAR first, then delegate up the chain, instead of delegating first, as would be standard behavior. I was surprised by this, because, according to the JBoss 4.0 documentation, the "local EAR" loading behavior would require a jboss-deploy.xml file to be included with the EAR, but I did not include one. In any case, this behavior does solve versioning issues.

                                I used an EAR instead of a SAR because EAR's are portable and, to my knowledge, SAR's are not (perhaps I'm behind the times?). Also, I didn't want to package the jBPM libraries with my app, because I want to be able to use jBPM for multiple applications, without having to deploy it separately each time.

                                Of course, using an EAR for jBPM requires EAR-to-EAR visibility, which may not be desireable, as it's not standard J2EE. I haven't figured out that issue yet.

                                Hope this is helpful. Thanks.