14 Replies Latest reply on Mar 2, 2011 1:34 PM by candy_633

    Eclipse -jBPM5/CR1 - Human Task View

    bpmn2user

      Following error gets generated while trying to use the refresh button.

      It perhaps looking for the older drools class instead of using 'org.jbpm.task.service.Command'.

      Any comments?

       

       

       

      Caused by: java.lang.ClassNotFoundException: org.drools.task.service.Command
          at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
          at java.security.AccessController.doPrivileged(Native Method)
          at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
          at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
          at java.lang.Class.forName0(Native Method)
          at java.lang.Class.forName(Class.java:247)

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

      Here is the test code snippet:

      import javax.persistence.EntityManagerFactory;
      import javax.persistence.Persistence;

       

      import org.drools.SystemEventListenerFactory;
      import org.jbpm.task.service.TaskService;
      import org.jbpm.task.service.TaskServiceSession;
      import org.jbpm.task.service.mina.MinaTaskServer;
      import org.jbpm.task.User;

       

      public class TestJBPMHumanTask {
         
          @SuppressWarnings("unchecked")
          public static void main(String[] args) throws InterruptedException {
              EntityManagerFactory emf = Persistence.createEntityManagerFactory("org.jbpm.task");
              TaskService taskService = new TaskService(emf, SystemEventListenerFactory.getSystemEventListener());
              TaskServiceSession taskSession = taskService.createSession();
            
              taskSession.addUser(new User("Administrator"));
             
              // start server
              MinaTaskServer server = new MinaTaskServer(taskService);
              Thread thread = new Thread(server);
              thread.start();
              System.out.println("Server started ...");
              Thread.sleep(5000);
               //taskSession.dispose();
          }
         
         
      }

        • 1. Re: Eclipse -jBPM5/CR1 - Human Task View
          krisverlaenen

          The Eclipse Task View is a Drools-based plugin, that depended on Drools Flow and thus will not work for jBPM5 CR1.  We recently updated Drools to use jBPM5 as well so this error should now be fixed.  You'll have to update your eclipse to the latest Drools snapshot plugin however.

           

          Kris

          • 2. Re: Eclipse -jBPM5/CR1 - Human Task View
            bpmn2user

            Thanks! Snapshot plug-in is good .

             

            Here is an example I used.

            • 3. Eclipse -jBPM5/CR1 - Human Task View
              bpmn2user

              Though SNAPSHOT of plug-in works fine with the jbpm-human-task-5.0-CR1.jar, it is not working (i.e, tasks are not shown in the Eclipse's 'Human Task View') with lastest  jbpm-human-task-5.0-SNAPSHOT.jar (downladed from https://hudson.jboss.org/hudson/job/jBPM5/lastSuccessfulBuild/artifact/target/jbpm-5.0-SNAPSHOT-pre-binhttps://hudson.jboss.org/hudson/job/jBPM5/lastSuccessfulBuild/artifact/target/jbpm-5.0-SNAPSHOT-pre-bin/) . It throws an exception 'Could not conect to task server, refresh first'

              • 4. Eclipse -jBPM5/CR1 - Human Task View
                krisverlaenen

                You are correct, I'll look into this:

                https://issues.jboss.org/browse/JBPM-3020

                 

                Probably a recent change in the human task service is not backwards compatible.

                 

                Kris

                • 5. Eclipse -jBPM5/CR1 - Human Task View
                  candy_633

                  I also meet some problem when implement Human Task:

                  1) At first, I meet the following errors when I run Human Task:  (then, according to the error message, I update slf4j-api-1.6.0.jar to slf4j-log4j12-1.6.1.jar

                   

                  SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".

                  SLF4J: Defaulting to no-operation (NOP) logger implementation

                  SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

                  javax.persistence.PersistenceException: [PersistenceUnit: org.jbpm.task] Unable to build EntityManagerFactory

                      at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:677)

                      at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:126)

                      at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:52)

                      at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:34)

                      at com.sample.ProcessTest.main(ProcessTest.java:57)

                  Caused by: org.hibernate.HibernateException: JDBC Driver class not found: org.h2.Driver

                      at org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:89)

                      at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:137)

                      at org.hibernate.ejb.InjectionSettingsFactory.createConnectionProvider(InjectionSettingsFactory.java:29)

                      at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:89)

                      at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2101)

                      at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1325)

                      at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)

                      at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669)

                      ... 4 more

                  Caused by: java.lang.ClassNotFoundException: org.h2.Driver

                      at java.net.URLClassLoader$1.run(Unknown Source)

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

                      at java.net.URLClassLoader.findClass(Unknown Source)

                      at java.lang.ClassLoader.loadClass(Unknown Source)

                      at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

                      at java.lang.ClassLoader.loadClass(Unknown Source)

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

                      at java.lang.Class.forName(Unknown Source)

                      at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:123)

                      at org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:84)

                   

                  2) After I update to slf4j-log4j12-1.6.1.jar, another error still shows:

                   

                  "java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory

                      at org.hibernate.cfg.Configuration.<clinit>(Configuration.java:151)

                      at org.hibernate.ejb.Ejb3Configuration.<clinit>(Ejb3Configuration.java:107)

                      at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:124)

                      at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:52)

                      at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:34)

                      at com.sample.ProcessTest.main(ProcessTest.java:57)

                  Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory

                      at java.net.URLClassLoader$1.run(Unknown Source)

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

                      at java.net.URLClassLoader.findClass(Unknown Source)

                      at java.lang.ClassLoader.loadClass(Unknown Source)

                      at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

                      at java.lang.ClassLoader.loadClass(Unknown Source)

                      ... 6 more

                  http://community.jboss.org/message/581435#581435? "

                   

                   

                  The problem is with this line:

                    EntityManagerFactory emf = Persistence.createEntityManagerFactory("org.jbpm.task");

                   

                  Is there anything wrong with the path of this jar?

                   

                  3) where to You'll have to update your eclipse to the latest Drools snapshot plugin?

                   

                  I appreciate your help so much!

                  • 6. Eclipse -jBPM5/CR1 - Human Task View
                    krisverlaenen

                    The first error is simply because you are using a H2 database but the h2 jar is not in your classpath.  You should make sure the database driver jar is part of your classpath. (Updating the slf4j seems to have caused another issue so that the first issue doesn't show up yet, probably because you need to update all slf4j dependencies to the new version if you update one).

                     

                    The Drools build system builds an eclipse artefact that is a local update site.  So you can always download that and use it to install the latest snapshot version.  But I suggest you download the latest Drools 5.2.M1 release, that works fine with jBPM 5.0.0.

                    http://www.jboss.org/drools/downloads

                     

                    Kris

                    • 7. Re: Eclipse -jBPM5/CR1 - Human Task View
                      candy_633

                      Hello, Kris,

                      I am not sure how to use latest Drools 5.2.M1 release to make a working configuration, so I download an reinstall the latest snapshot version. But the same problem exist.

                       

                      Besides, as you remind, I copy h2.jar from \jbpm-installer\db\driver to \jbpm-installer\runtime\lib, ( changing classpath, are you meaning this?)

                       

                      The error message is:

                       

                      SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".

                      SLF4J: Defaulting to no-operation (NOP) logger implementation

                      SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

                      Server started ...

                      Exception in thread "Thread-4" java.lang.RuntimeException: Server Exception with class class org.jbpm.task.service.mina.MinaTaskServer using port 9123

                          at org.jbpm.task.service.mina.BaseMinaTaskServer.run(BaseMinaTaskServer.java:53)

                          at java.lang.Thread.run(Unknown Source)

                      Caused by: java.net.BindException: Address already in use: bind

                          at sun.nio.ch.Net.bind(Native Method)

                          at sun.nio.ch.ServerSocketChannelImpl.bind(Unknown Source)

                          at sun.nio.ch.ServerSocketAdaptor.bind(Unknown Source)

                          at org.apache.mina.transport.socket.nio.NioSocketAcceptor.open(NioSocketAcceptor.java:251)

                          at org.apache.mina.transport.socket.nio.NioSocketAcceptor.open(NioSocketAcceptor.java:48)

                          at org.apache.mina.core.polling.AbstractPollingIoAcceptor.registerHandles(AbstractPollingIoAcceptor.java:523)

                          at org.apache.mina.core.polling.AbstractPollingIoAcceptor.access$200(AbstractPollingIoAcceptor.java:65)

                          at org.apache.mina.core.polling.AbstractPollingIoAcceptor$Acceptor.run(AbstractPollingIoAcceptor.java:407)

                          at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)

                          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)

                          at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

                          ... 1 more

                      Registered human task listener

                      [2011:02:54 22:02:875:debug] Message receieved on client : AddTaskResponse

                      [2011:02:54 22:02:875:debug] Arguments : [javax.persistence.RollbackException: Error while commiting the transaction]

                       

                      The following is my project:

                      1.bmp

                       

                       

                       

                      I tried a lot of ways, but still not work. Hope that you can offer me some help!

                       

                      I appreciate your help so much!

                       

                      Best Regards,

                       

                      Candy

                      • 8. Eclipse -jBPM5/CR1 - Human Task View
                        bpmn2user

                        It looks like you have another instance of MinaTaskServer running and you might want to shutdown the other one.

                         

                        org.jbpm.task.service.mina.MinaTaskServer using port 9123

                            at org.jbpm.task.service.mina.BaseMinaTaskServer.run(BaseMinaTaskServer.java:53)

                            at java.lang.Thread.run(Unknown Source)

                        Caused by: java.net.BindException: Address already in use: bind

                            at sun.nio.ch.Net.bind(Native Method)

                        • 9. Re: Eclipse -jBPM5/CR1 - Human Task View
                          candy_633

                          Hello, bpmn2user,

                          Thank you so much for your remind. I close another human tasks initialized in scripts. And then the error message is like this:

                          SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".

                          SLF4J: Defaulting to no-operation (NOP) logger implementation

                          SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

                          Server started ...

                          Registered human task listener

                          [2011:02:55 11:02:171:debug] Message receieved on server : RegisterForEventRequest

                          [2011:02:55 11:02:171:debug] Arguments : [org.jbpm.task.event.TaskEventKey@12d0a744, false, org.drools.process.workitem.wsht.WSHumanTaskHandler]

                          [2011:02:55 11:02:171:debug] Message receieved on server : RegisterForEventRequest

                          [2011:02:55 11:02:171:debug] Arguments : [org.jbpm.task.event.TaskEventKey@80e237a, false, org.drools.process.workitem.wsht.WSHumanTaskHandler]

                          [2011:02:55 11:02:171:debug] Message receieved on server : RegisterForEventRequest

                          [2011:02:55 11:02:171:debug] Arguments : [org.jbpm.task.event.TaskEventKey@254ae884, false, org.drools.process.workitem.wsht.WSHumanTaskHandler]

                          [2011:02:55 11:02:171:debug] Message receieved on server : AddTaskRequest

                          [2011:02:55 11:02:171:debug] Arguments : [org.jbpm.task.Task@836d3d75, org.jbpm.task.service.ContentData@7bd46a]

                          [2011:02:55 11:02:234:debug] Message receieved on client : AddTaskResponse

                          [2011:02:55 11:02:234:debug] Arguments : [1]

                           

                          It seems that the original problem is still there. How did u solve the JAR classpath or plug-in version problem before? Do you have human-task project working correctly?

                           

                          I appreicate your help so much!

                          • 10. Eclipse -jBPM5/CR1 - Human Task View
                            bpmn2user

                            I do not have this issue any more with the latest jBPM5 install (http://kverlaen.blogspot.com/2011/01/jbpm-50-released.html). This install downloads all the dependant libraries.

                            • 11. Eclipse -jBPM5/CR1 - Human Task View
                              bpmn2user

                              Here are the main steps involved in configuring Eclipse plugin. Follow these steps and let us know if you still have problems

                               

                              http://community.jboss.org/people/bpmn2user/blog/2011/02/27/eclipse-plug-in-installation-for-jbpm5

                              • 12. Eclipse -jBPM5/CR1 - Human Task View
                                bpmn2user
                                • 13. Eclipse -jBPM5/CR1 - Human Task View
                                  krisverlaenen

                                  Based on that output, your task service seems to be working correctly.  If you're worried about that SLF4J warning, that is just a warning where it cannot find a specific configuration so defaults to logging to the console, you can safely ignore that.

                                   

                                  Kris

                                  • 14. Re: Eclipse -jBPM5/CR1 - Human Task View
                                    candy_633

                                    Hello, Kris and bpmn2user,

                                    I appreciate your help so much! Finally got human task view works.

                                     

                                    By the way, if I want to write some parameters from web console, and those parameters will be input to my node(Service Task) of JBPM. Do I need use human task or something else?

                                     

                                    Best Regards,

                                     

                                    Shanshan