10 Replies Latest reply on Sep 15, 2009 10:23 AM by Ronald van Kuijk

    Deploying processes on Tomcat

    Sebastian Schneider Master

      Good morning!

      If I got it right there is an ant task which can be used to deploy processes. However I have never used this task since when I was still using JBoss I was always dropping the business archives in the deployment directory.

      The ant task uses a direct database connection to deploy processes, right? So you have to supply connection details for the ant task. Can processes also be deployed by dropping them in the appropiate directory?

      Bye
      Sebastian

        • 1. Re: Deploying processes on Tomcat
          Sebastian Schneider Master

          The actual problem is that I don't succeed in deploying processes with the help of the ANT task. The tasks runs but it always deploys the processs to an in-memory database although I have specified the connection details in the build.xml file.

          I have to say I am a bit confused because there are jdbc-properties and hibernate-properties. To be sure I set them both

           <property name="jdbc.driver" value="org.hsqldb.jdbcDriver"/>
           <property name="jdbc.url" value="jdbc:hsqldb:hsql://myserver.mydomain.de:1701"/>
           <property name="jdbc.username" value="sa"/>
           <property name="jdbc.password" value=""/>
          
           <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialec"/>
           <property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver"/>
           <property name="hibernate.connection.url" value="jdbc:hsqldb:hsql://myserver.mydomain.de:1701"/>
           <property name="hibernate.connection.username" value="sa"/>
           <property name="hibernate.connection.password" value=""/>
           <property name="hibernate.format_sql" value="true"/>
          


          But obviously connection details are ignored:

          [jbpm-deploy] INFO: using driver: org.hsqldb.jdbcDriver at URL: jdbc:hsqldb:mem:.
          


          • 2. Re: Deploying processes on Tomcat
            Ronald van Kuijk Master

            'Appropriate?' Not in Tomcat, since the deployer is for JBoss, with the ant task? Ofcourse not ;-) but you couldbuild your own directory poller in e.g. a servlet and use that as a 'deploy' dir

            Regarding your 'problem' I think the wrong config is picked up. It works for me. Try corrupting the config you expect is used and see if the ant task throws an error

            • 3. Re: Deploying processes on Tomcat
              Sebastian Schneider Master

              You're my hero for today, Ronald. ;) I was messing around with bugs of third-party software and started to overlook some things already.

              Thanks a lot!

              • 4. Re: Deploying processes on Tomcat
                Sebastian Schneider Master

                Okay, it's me again:

                Where and how can I make the HSQLDB server used in the demo setup bind to the actual IP address and not to localhost? The reason: I am trying to deploy remote.

                I have done the following for a workaround: I stopped Tomcat and I changed the supplied start-up script to start the HSQLDB from

                java -cp hsqldb.jar org.hsqldb.Server -address localhost -port 1701 -dbname.0 jbpmDatabase


                to

                java -cp hsqldb.jar org.hsqldb.Server -address 0.0.0.0 -port 1701 -dbname.0 jbpmDatabase


                Then I started the HSQLDB server using the start script and I could deploy my process from the remote system. Afterwards I stopped the HSQLDB server and restarted Tomcat.

                Where can I set the address to bind to when the server is started in/by Tomcat?

                • 5. Re: Deploying processes on Tomcat
                  Sebastian Schneider Master

                  It's absolutely not my day. Starting Tomcat does not bring up a database server anymore. I checked by the help of the HSQLDB Manager. Connecting to localhost worked before. I cannot login to the jBPM Console since it gives me the message "Authentication failed.".

                  • 6. Re: Deploying processes on Tomcat
                    Ronald van Kuijk Master

                    Yesterday I would have sent you http://www.youtube.com/watch?v=8yteMugRAc0, but today I'm not sure.

                    What do you mean by :Starting Tomcat does not bring up a database server anymore.

                    • 7. Re: Deploying processes on Tomcat
                      Sebastian Schneider Master

                      My test installation is based upon the demo setup you get when you use ant demo.setup.tomcat. Normally after running this ant-task you just have to use startup.bat to bring up Tomcat and there you go. When running on the same machine you can also connect to the HSQLDB running on localhost with the Database Manager. However this does not work anymore and I cannot login to the jBPM Console anymore. It just says: "Authentication failed".

                      • 8. Re: Deploying processes on Tomcat
                        Ronald van Kuijk Master

                        Sorry for not being more clear. This part I new (well, sort of, just indirectly).

                        What I meant was, do you get any errors (I assume not, otherwise you would have mentioned that I think) and I also assume you 'reverted' every manual change you made.

                        Can you see what ip adres hsqldb is actually listening on when you start it with 0.0.0.0?

                        And can http://osdir.com/ml/java.hsqldb.user/2007-05/msg00024.html be related e.g. in combination with short connect timeouts?

                        • 9. Re: Deploying processes on Tomcat
                          Sebastian Schneider Master

                          Hello Ronald,

                          finally I managed to get everything working. As I mentioned already, it was not my day. :)

                          1) When you use the ant task demo.setup.tomcat to create the demo setup the ant task also brings up the hsqldb-server using the supplied batch file after the installation is done. So I was under the impression that starting Tomcat also starts the database but it is just the first time after installation like this. Think this is a difference to the JBoss AS setup.

                          2) Regarding binding the hsqldb-server to the actual ip address I changed the installation templates of the config files so the changes are promoted all over the setup, especially important for C:\jbpm-4.1\apache-tomcat-6.0.20\conf\server.xml where the JbpmConsoleRealm is declared together with a connection url to the database server. :)

                          3) Regarding the deployment I also deleted the line

                          <property name="hibernate.hbm2ddl.auto">create-drop</property>
                          from my configuration file in the process project. Whenever I deployed the process the schema was dropped and re-created so I lost the example users I was using for my tests.

                          Have a nice day and thanks for your hints.

                          • 10. Re: Deploying processes on Tomcat
                            Ronald van Kuijk Master

                            1) Was just looking if something like this could be the case. Might be good to add that to the docs / setup text somewhere.

                            2) hahaha... connecting to 0.0.0.0 is indeed a bit difficult

                            3) Happens to me now and then to :-)

                            Thanks for reporting back.