7 Replies Latest reply on Mar 8, 2013 11:18 AM by roxy1987

    Startup of task service

    dmwpepper

      I'm following directions in the install.html document in the jbpm install directory that says how to install jbpm without the demo, "Manually installing the different components".  When I got to the part about starting up task service (ant start.human.task), the task service doesn't execute in the background.  Is the service hung, waiting for something, or is the service supposed to run in the foreground?  If the latter, the instructions don't indicate that this will happen.  The message is

       

       

      C:\jbpm>ant start.human.task

      Buildfile: C:\jbpm\build.xml

       

      start.human.task:

          [mkdir] Created dir: C:\jbpm\task-service\target

          [javac] C:\jbpm\build.xml:864: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds

          [javac] Compiling 1 source file to C:\jbpm\task-service\target

           [copy] Copying 5 files to C:\jbpm\task-service\target

           [java] 0    07/03 14:05:08,123[main] ERROR task.identity.DefaultUserGroupCallbackImpl.<init>  - Error when loading group information for callback from location: file:null/roles.pro

      perties

           [java] java.io.FileNotFoundException: null\roles.properties (The system cannot find the path specified)

           [java]     at java.io.FileInputStream.open(Native Method)

           [java]     at java.io.FileInputStream.<init>(FileInputStream.java:120)

           [java]     at java.io.FileInputStream.<init>(FileInputStream.java:79)

           [java]     at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:70)

           [java]     at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:161)

           [java]     at java.net.URL.openStream(URL.java:1010)

           [java]     at org.jbpm.task.identity.DefaultUserGroupCallbackImpl.<init>(DefaultUserGroupCallbackImpl.java:55)

           [java]     at org.jbpm.task.identity.DefaultUserGroupCallbackImpl.<init>(DefaultUserGroupCallbackImpl.java:40)

           [java]     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

           [java]     at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)

           [java]     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)

           [java]     at java.lang.reflect.Constructor.newInstance(Constructor.java:513)

           [java]     at java.lang.Class.newInstance0(Class.java:357)

           [java]     at java.lang.Class.newInstance(Class.java:310)

           [java]     at org.jbpm.task.identity.UserGroupCallbackManager.setCallbackFromProperties(UserGroupCallbackManager.java:69)

           [java]     at org.jbpm.DemoTaskService.main(Unknown Source)

           [java] Task service registered usergroup callback ...

           [java] Task service started correctly!

           [java] Task service running ...

       

      The services hangs at this point and doesn't return the command prompt, but appears to be running.  

       

      The problem appears to be that is was looking for the roles.properties file in jbpm/auth/, but couldn't create the path.

        • 1. Re: Startup of task service
          roxy1987

          Your task service is not getting started because your roles.properties file link. Just look for the following code snippet in your build.xml

           

          <java classname="org.jbpm.DemoTaskService" fork="true">        

                <classpath>

                      <pathelement path="${install.home}/task-service/target"/>

                      <path refid="classpath.human.task" />

                </classpath>

              </java>

           

          And add the line <sysproperty key="jbpm.user.group.mapping" value="file:///<path of your jboss server>/jboss-as-7.1.1.Final/standalone/configuration/roles.properties"/>  like this :

           

           

          <sysproperty key="jbpm.user.group.mapping" value="file:///<path of your jboss server>/jboss-as-7.1.1.Final/standalone/configuration/roles.properties"/>

           

                <classpath>

                      <pathelement path="${install.home}/task-service/target"/>

                      <path refid="classpath.human.task" />

                </classpath>

              </java>

          <java classname="org.jbpm.DemoTaskService" fork="true">        

          • 2. Re: Startup of task service
            dmwpepper

            Hi, technically would this work since <java classname="org.jbpm.DemoTaskService" fork="true">  comes at the end?  That would leave </java> appearing before.  So, I did this

             

             

              <target name="start.human.task">


                  <mkdir dir="${install.home}/task-service/target"/>
                  <javac srcdir="${install.home}/task-service/src" destdir="${install.home}/task-service/target" classpathref="classpath.human.task">
                      <compilerarg value="-Xlint:unchecked"/>
                 </javac>
                <copy todir="${install.home}/task-service/target">
                     <fileset dir="${install.home}/task-service/resources"/>
                </copy>


                <sysproperty key="jbpm.user.group.mapping" value="${install.home}/jboss-as-7.1.1.Final/standalone/configuration/roles.properties"/>
                <java classname="org.jbpm.DemoTaskService" fork="true"> 
                     <classpath>
                        <pathelement path="${install.home}/task-service/target"/>
                        <path refid="classpath.human.task" />
                     </classpath>
                </java>

             

             

              </target>

             

            However, it didn't work.  I got the following response:

             

            C:\jbpm>ant start.human.task
            Buildfile: C:\jbpm\build.xml

            start.human.task:
                [javac] C:\jbpm\build.xml:864: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds

            BUILD FAILED
            C:\jbpm\build.xml:870: Problem: failed to create task or type sysproperty
            Cause: The name is undefined.
            Action: Check the spelling.
            Action: Check that any custom tasks/types have been declared.
            Action: Check that any <presetdef>/<macrodef> declarations have taken place.


            Total time: 0 seconds

            C:\jbpm>

             

            What's next?

            • 3. Re: Startup of task service
              roxy1987

              That was a typo, I am sorry. What I meant is :

               

               

              <java classname="org.jbpm.DemoTaskService" fork="true">

               

              <sysproperty key="jbpm.user.group.mapping" value="file:///<path of your jboss server>/jboss-as-7.1.1.Final/standalone/configuration/roles.properties"/>

               

              <classpath>

              <pathelement path="${install.home}/task-service/target"/>

              <path refid="classpath.human.task" />

              </classpath>

              </java>

              • 4. Re: Startup of task service
                dmwpepper

                Ok, this seems to solve the problem in it finding the properties file and starting up.  Is the following what you expected?:

                 

                C:\jbpm>ant start.human.task
                Buildfile: C:\jbpm\build.xml

                start.human.task:
                    [javac] C:\jbpm\build.xml:864: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
                     [echo] before classname
                     [java] Task service registered usergroup callback ...
                     [java] Task service started correctly!
                     [java] Task service running ...

                Also, the process still runs in the foreground.  When I install the demo application, and use "ant start.demo", all processes run in the background, including the human task service.  Is there a way to get the task service to run in the background when it's started by itself (which install.html says you can do). 

                • 5. Re: Startup of task service
                  roxy1987

                  I am not sure if I understand your question correctly.

                   

                  When you start jboss server, it deploy all the war files, including the human task war. The human task war contains a servlet which is loaded on startup. And it has the logic to fire up HornetQ task server by default. So you dont need to start up the task server, just deploying the war file starts it up.

                  If you are looking to create a web application of some sort then you have 2 options to use the human task service :

                  a) Either you use the Servlet in your project and load it on start up.

                  b) Or you use the human task war directly and modify the persistence.xml inside for data sources and a few other modifications.

                   

                  If you wanna use the human task war then you can follow https://community.jboss.org/people/roxy1987/blog/2013/02/19/web-application-with-human-task-war for modification.

                   

                  Lemme know if that answers your query. Also you might wanna mark the discussion as answered if your issues are resolved.

                  Regards.

                   

                   

                  • 6. Re: Startup of task service
                    dmwpepper

                    Hi, my question about starting up the human task service is based on the following snippet out of the install.html doc (in the jbpm install directory) :

                     

                    Starting

                    Startup database:
                    ant start.h2

                    Startup JBoss AS:
                    ant start.jboss

                    Startup task service:
                    ant start.human.task

                    Startup eclipse:
                    ant start.eclipse

                     

                    Notice that is says you can start up the task service by typing in "ant start.human.task".  However, I've found that the application doesn't work correctly when it's started by itself with ant. I know what you're saying about using the .war, but I'm wondering why then install.html says you can start it this way. Is that a mistake? 

                    • 7. Re: Startup of task service
                      roxy1987

                      Well to start up human task using ant, all you need to run is start.h2 before it. Or the target data base server should be runnning in case you have migrated it to another db.

                      If you run the ant scripts in the sequence

                       

                      ant start.h2

                      ant start.jboss

                      ant start.human.task

                      ant start.eclipse

                       

                      Then I believe you will get a conflict with the address:port usage as the script ant start.jboss  has already started task service. I dont remember correctly but If I am not wrong, in the very first draft of jbpm 5, task service was required to start up this way. STarting up jboss did not start human task service with that version. And quite a lot of documentation has not been modified with the upgrades. I am not sure about it though.

                       

                      Well All you need to do is

                       

                      ant start.h2

                      ant start.human.task

                       

                      Regards.

                      1 of 1 people found this helpful