6 Replies Latest reply on Aug 16, 2012 8:18 AM by user111

    jBPM 5.3 Deployment on Amazon EC2 instance

    user111

      Hi, I've downloaded the jbpm-5.3.0.Final-installer-full.zip and have got it working fine on my localhost.

       

      I'm now trying to deploy it on an Amazon EC2 Centos instance and having no end of problems.  Amazon EC2 is a NAT'd server, so the actual IP on the server is different to the IP accessible from the Internet.

       

      I'm trying to get the JBPM-console working correctly. I can see the console and launch processes, but tasks never arrive for the users. Keep getting stack traces which I can share if required.

       

      So, the things I've tried on the Final installer are:

       

      1)  Modify build.xml so that the bind address is the NAT'd IP address on the server's primary interface.

      2)  In standalone.xml I've changed the management and public addresses from localhost to 0.0.0.0 (Listen on all interfaces)

      3)  Then 'ant install.demo'  to push the changes

       

      It is now accessible from the Internet and I can access drools-guvnor, jbpm-console etc.

      Here are the listening ports:

      [root@myinst2 data]# lsof -i -Pn|grep java|grep -i listen

      java     29475        root    7r  IPv4 1416067      0t0  TCP *:9092 (LISTEN)

      java     29536        root  161u  IPv4 1416083      0t0  TCP *:9999 (LISTEN)

      java     29536        root  163u  IPv4 1416084      0t0  TCP 10.240.217.46:8080 (LISTEN)

      java     29536        root  166u  IPv4 1416085      0t0  TCP *:9990 (LISTEN)

      java     29536        root  170u  IPv4 1416087      0t0  TCP *:1090 (LISTEN)

      java     29536        root  171u  IPv4 1416088      0t0  TCP *:1091 (LISTEN)

      java     29536        root  799u  IPv4 1416111      0t0  TCP 127.0.0.1:5445 (LISTEN)

       

      So what is the subtle difference between having a working JBPM-console on localhost vs live on the Internet? 

      I tried modifying the war file for the jbpm-console as advised here: http://docs.jboss.org/jbpm/v5.3/userguide/ch.console.html#d0e4624  but then JBPM-console wouldn't even start. All I did was add the NAT'd IP address for bpm.console.server.host=<NAT IP address> in WEB-INF/classes/jbpm.console.properties.

       

      Any advice on how to deploy JBPM 5.3 on a Cloud server (using NAT - like they all do) would be appreciated.

       

      Geoff.

        • 1. Re: jBPM 5.3 Deployment on Amazon EC2 instance
          salaboy21

          It sounds as a normal IP + application server problem, but if the problem is with the Human Task server you should check if everything is started correctly there.

          Look at the task-service directory inside the installer and see there if you need to customize the IP address that is being used by the task server.

          Cheers

          • 2. Re: jBPM 5.3 Deployment on Amazon EC2 instance
            user111

            Nope. Nothing in the task-service directory that jumps out.

            Shouldn't it all be going via port 8080?  And that's working perfectly. 

            • 3. Re: jBPM 5.3 Deployment on Amazon EC2 instance
              salaboy21

              This looks like HornetQ listening at Localhost:

               

              java     29536        root  799u  IPv4 1416111      0t0  TCP 127.0.0.1:5445 (LISTEN)

               

              I'm not sure if you can do that on amazon, that's being started by the task-service code as far as I remember. Check the ant goal for starting that module.

              You can probably customize how the server is started and compile the code inside task-service there.

               

              Cheers

              • 4. Re: jBPM 5.3 Deployment on Amazon EC2 instance
                user111

                So should the HornetQ service be listening on all ports?  and should I open my firewall to allow incoming requests on 5445?

                The only reason I can think that would be necessary is if the Javascript / AJAX of the JBPM-console needs to communicate over 5445 instead of over the standard HTTP connection.

                • 5. Re: jBPM 5.3 Deployment on Amazon EC2 instance
                  salaboy21

                  No, if you want the human task server to comunicate with the process runtime inside amazon that's fine, but you mention that the human tasks are not working and that's probably due a configuration problem with hornetQ and the WorkItemHandler that is sending request to it.

                  You need to find out where the communication is failing. DO you have an stack trace or something to share?

                  Cheers

                  • 6. Re: jBPM 5.3 Deployment on Amazon EC2 instance
                    user111

                    Everything is running on the one EC2 instance. It's identical to the localhost deployment except being accessible over an Internet IP address.

                     

                    One of the stack traces I'm getting (and this isn't all the time!!) when I do refresh on the 'Personal tasks' is:

                    -------------

                    04:23:41,698 ERROR [stderr] (http--0.0.0.0-8080-14) java.lang.RuntimeException: Timeout : unable to retrieve results

                    04:23:41,699 ERROR [stderr] (http--0.0.0.0-8080-14)           at org.jbpm.task.service.responsehandlers.BlockingTaskSummaryResponseHandler.getResults(BlockingTaskSummaryResponseHandler.java:41)

                    04:23:41,699 ERROR [stderr] (http--0.0.0.0-8080-14)           at org.jbpm.task.service.SyncTaskServiceWrapper.getTasksOwned(SyncTaskServiceWrapper.java:512)

                    04:23:41,699 ERROR [stderr] (http--0.0.0.0-8080-14)           at org.jbpm.integration.console.TaskManagement.getAssignedTasks(TaskManagement.java:140)

                    04:23:41,700 ERROR [stderr] (http--0.0.0.0-8080-14)           at org.jboss.bpm.console.server.TaskListFacade.getTasksForIdRef(TaskListFacade.java:101)

                    04:23:41,700 ERROR [stderr] (http--0.0.0.0-8080-14)           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                    04:23:41,700 ERROR [stderr] (http--0.0.0.0-8080-14)           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

                    04:23:41,700 ERROR [stderr] (http--0.0.0.0-8080-14)           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

                    04:23:41,701 ERROR [stderr] (http--0.0.0.0-8080-14)           at java.lang.reflect.Method.invoke(Method.java:601)

                    04:23:41,701 ERROR [stderr] (http--0.0.0.0-8080-14)           at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:140)

                    04:23:41,701 ERROR [stderr] (http--0.0.0.0-8080-14)           at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:255)

                    04:23:41,701 ERROR [stderr] (http--0.0.0.0-8080-14)           at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:220)

                    04:23:41,702 ERROR [stderr] (http--0.0.0.0-8080-14)           at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:209)

                    04:23:41,702 ERROR [stderr] (http--0.0.0.0-8080-14)           at org.jboss.resteasy.core.SynchronousDispatcher

                    ...

                    NOTE: I get this same dump occasionally on the localhost version as well.

                     

                    If I do a refresh on the 'Group Tasks' I get this stack trace every time:

                    04:27:07,265 ERROR [stderr] (Thread-19) java.lang.IllegalArgumentException: org.hibernate.QueryParameterException: could not locate named parameter [userId]

                    04:27:07,266 ERROR [stderr] (Thread-19)           at org.hibernate.ejb.QueryImpl.setParameter(QueryImpl.java:206)

                    04:27:07,266 ERROR [stderr] (Thread-19)           at org.jbpm.task.service.TaskServiceSession.getTasksAssignedAsPotentialOwnerByStatusByGroup(TaskServiceSession.java:1011)

                    04:27:07,266 ERROR [stderr] (Thread-19)           at org.jbpm.task.service.TaskServerHandler.messageReceived(TaskServerHandler.java:356)

                    04:27:07,267 ERROR [stderr] (Thread-19)           at org.jbpm.task.service.hornetq.HornetQTaskServerHandler.messageReceived(HornetQTaskServerHandler.java:44)

                    04:27:07,267 ERROR [stderr] (Thread-19)           at org.jbpm.task.service.hornetq.BaseHornetQTaskServer.run(BaseHornetQTaskServer.java:85)

                    04:27:07,267 ERROR [stderr] (Thread-19)           at java.lang.Thread.run(Thread.java:722)

                    ...

                     

                    NOTE:  I get this same dump on the localhost version as well, so this is clearly a bug in the JBPM-console.

                     

                    It would be really useful if you guys have tested this on a production server and have some notes on how to deploy it (except on localhost)?