10 Replies Latest reply on Dec 19, 2008 8:18 AM by kukeltje

    nulpointer in slightly complicated process

    erciped

      Hi

      I have a process definition as shown in the link below.

      http://www.freeimagehosting.net/uploads/4963a9f1b7.jpg

      When I run it with all nodes set to "async" and all joins with lock="UPGRADE" and with multiple or single job executors I get a nullpointer exception. It fails wwhen exectuting the action in F.

      Below is the stack trace. Has anyone experienced this before or is the graph too complicated. I can post the acual process definition xml if you want it and maybe a test case


      org.jbpm.graph.def.GraphElement.executeAction(GraphElement.java:267) 2008-12-18 12:10:31,617 [JbpmJobExecutor:1] ERROR - action threw exception: null
      java.lang.NullPointerException
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:261)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
      at org.jbpm.instantiation.Delegation.instantiate(Delegation.java:145)
      at org.jbpm.instantiation.Delegation.getInstance(Delegation.java:126)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:197)
      at org.jbpm.instantiation.Delegation_$$_javassist_4.getInstance(Delegation_$$_javassist_4.java)
      at org.jbpm.graph.def.Action.execute(Action.java:128)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:197)
      at org.jbpm.graph.def.Action_$$_javassist_61.execute(Action_$$_javassist_61.java)
      at org.jbpm.graph.def.GraphElement.executeAction(GraphElement.java:256)
      at org.jbpm.graph.def.Node.execute(Node.java:334)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:197)
      at org.jbpm.graph.def.Node_$$_javassist_47.execute(Node_$$_javassist_47.java)
      at org.jbpm.job.ExecuteNodeJob.execute(ExecuteNodeJob.java:27)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:197)
      at org.jbpm.job.Job_$$_javassist_52.execute(Job_$$_javassist_52.java)
      at org.jbpm.job.executor.JobExecutorThread.executeJob(JobExecutorThread.java:166)
      at org.jbpm.job.executor.JobExecutorThread.run(JobExecutorThread.java:60)

        • 1. Re: nulpointer in slightly complicated process
          erciped

          And

          A, B, C, D, G

          all execute ok.

          The rest do not execute at all and the exception is thrrown at F.

          Also, all actions are async.

          • 2. Re: nulpointer in slightly complicated process
            salaboy21

            sounds like F's ActionHandlers is not in the classloader. Make sure that you deploy it. And that is accesible by the JobExecutor.

            • 3. Re: nulpointer in slightly complicated process
              erciped

              The action class for F was missing. I added it using the Eclipse edditor but that failed to tranfer that to the xml. Stupid me was relying on the gui. I now know to always double check the xml file.

              Thanks

              PS. The nullpointer and debugging did not make it easy to identif what was missing but a good guess got me there.

              • 4. Re: nulpointer in slightly complicated process
                salaboy21

                great! look that everytime that you modify a class, in the deployment tab all(or some) classes become unchecked.

                • 5. Re: nulpointer in slightly complicated process
                  kukeltje

                  Btw, your processdefinition is illegal... not all legs of the fork arrive in the same corresponding join. There should be an additional fork after the fork but before B and C)and an additional join after F and G but before the join.... You cannot partially nest things....

                  • 6. Re: nulpointer in slightly complicated process
                    erciped

                     

                    "kukeltje" wrote:
                    Btw, your processdefinition is illegal... not all legs of the fork arrive in the same corresponding join. There should be an additional fork after the fork but before B and C)and an additional join after F and G but before the join.... You cannot partially nest things....


                    Yes, I noticed that because after fixing the error, the process runs and finishes but node E never gets executed. I think that may be a bug in the system. H should not be executed if it is dependent on E which has not executed. Is this a bug?

                    I have fixed my process to do the right thing. Thanks kukeltje

                    • 7. Re: nulpointer in slightly complicated process
                      kukeltje

                      If you 'fixed' something I can only guess you fixed it like I descrbed if you do not post a new image somewhere. If you fixed it like I described, I do not see a reason why e should not be executed

                      • 8. Re: nulpointer in slightly complicated process
                        kukeltje

                        oh... btw... your process is not slightly complicated.... look here: http://download.schabell.org/presentations/STPBPM_JFall2008.pdf, sheet 15

                        • 9. Re: nulpointer in slightly complicated process

                          Hi Ronald,

                          I am slightly confused about what when a processdefinition is illegal.

                          not all legs of the fork arrive in the same corresponding join.


                          From the functional and dependency point of view, not always be possible to add intermediate fork and joins without affecting the dependencies.

                          Is it possible to define a dependency graph like this one using parallel processing ?

                          http://www.freeimagehosting.net/uploads/519702236e.png


                          Right with my current settings it's impossible for me to execute Node5. We have been able to get rid of the SOE exceptions (we will explain how in the other thread) however, with a graph like this, we are not able to execute Node 5.

                          Is there any other mechanism we could use for having such a dependency ?


                          • 10. Re: nulpointer in slightly complicated process
                            kukeltje

                            What I get from your picture:
                            - You want 5 to only execute if 1 and 2 have finished
                            - You want 3 and 4 to execute if 1 has finished, but 2 might not have

                            What you do is use the join on the right as a milestone... A join is a kind of milestone, but a very specific one. Instead of a join create a 'dummy' state node that does nothing (e.g. call it 'wait for 1 to finish' or milestone or whatever). Create a small javaclass that on node-leave for node 1, signals this dummy node to continue to 5. That is the correct way of doing it. In jBPM 4 things might change and this pattern might be supported out of the box either with a more flexible join or with options to signal other nodes so you do not have to write some small reusable additional java classes.

                            How to signal or do something else from java in one node, related to another node see http://planetjbpm.wordpress.com/2008/10/01/implementing-milestones-in-jbpm/