7 Replies Latest reply on Jul 19, 2007 12:58 PM by ricardomarques

    LinkageError

    ricardomarques

      Hi guys I'm having this JVM error when trying to execute a TaskInstanceEndCommand.

      Here's the trace:

      
      17:44:10,781 ERROR [STDERR] java.lang.LinkageError: loader constraints violated when linking javax/transaction/Synchronization class
      17:44:10,781 ERROR [STDERR] at org.jbpm.db.JobSession.deleteJobsForProcessInstance(JobSession.java:208)
      17:44:10,781 ERROR [STDERR] at org.jbpm.scheduler.db.DbSchedulerService.deleteTimersByProcessInstance(DbSchedulerService.java:54)
      17:44:10,781 ERROR [STDERR] at org.jbpm.graph.exe.ProcessInstance.end(ProcessInstance.java:329)
      17:44:11,203 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      17:44:11,203 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      17:44:11,203 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      17:44:11,203 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
      17:44:11,203 ERROR [STDERR] at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:147)
      17:44:11,203 ERROR [STDERR] at org.jbpm.graph.exe.ProcessInstance$$EnhancerByCGLIB$$3d4a95fa.end(<generated>)
      17:44:11,203 ERROR [STDERR] at org.jbpm.graph.exe.Token.notifyParentOfTokenEnd(Token.java:331)
      17:44:11,203 ERROR [STDERR] at org.jbpm.graph.exe.Token.end(Token.java:303)
      17:44:11,203 ERROR [STDERR] at org.jbpm.graph.exe.Token.end(Token.java:253)
      17:44:11,203 ERROR [STDERR] at org.jbpm.graph.node.EndState.execute(EndState.java:59)
      17:44:11,703 ERROR [STDERR] at org.jbpm.graph.def.Node.enter(Node.java:318)
      17:44:11,703 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      17:44:11,703 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      17:44:11,718 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      17:44:11,718 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
      17:44:11,718 ERROR [STDERR] at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:147)
      17:44:12,203 ERROR [STDERR] at org.jbpm.graph.def.Node$$EnhancerByCGLIB$$13ccf9bb.enter(<generated>)
      17:44:12,203 ERROR [STDERR] at org.jbpm.graph.def.Transition.take(Transition.java:151)
      17:44:12,203 ERROR [STDERR] at org.jbpm.graph.def.Node.leave(Node.java:393)
      17:44:12,203 ERROR [STDERR] at org.jbpm.graph.def.Node.leave(Node.java:357)
      17:44:12,218 ERROR [STDERR] at org.jbpm.graph.def.Node.execute(Node.java:349)
      17:44:12,218 ERROR [STDERR] at org.jbpm.graph.def.Node.enter(Node.java:318)
      17:44:12,218 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      17:44:12,218 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      17:44:12,218 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      17:44:12,218 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
      17:44:12,718 ERROR [STDERR] at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:147)
      17:44:12,718 ERROR [STDERR] at org.jbpm.graph.def.Node$$EnhancerByCGLIB$$13ccf9bb.enter(<generated>)
      17:44:12,718 ERROR [STDERR] at org.jbpm.graph.def.Transition.take(Transition.java:151)
      17:44:12,718 ERROR [STDERR] at org.jbpm.graph.def.Node.leave(Node.java:393)
      17:44:12,718 ERROR [STDERR] at org.jbpm.graph.exe.ExecutionContext.leaveNode(ExecutionContext.java:136)
      17:44:12,718 ERROR [STDERR] at org.jbpm.graph.node.Decision.execute(Decision.java:152)
      17:44:12,718 ERROR [STDERR] at org.jbpm.graph.def.Node.enter(Node.java:318)
      17:44:12,718 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      17:44:12,718 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      17:44:12,718 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      17:44:12,718 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
      17:44:12,718 ERROR [STDERR] at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:147)
      17:44:12,718 ERROR [STDERR] at org.jbpm.graph.def.Node$$EnhancerByCGLIB$$13ccf9bb.enter(<generated>)
      17:44:12,718 ERROR [STDERR] at org.jbpm.graph.def.Transition.take(Transition.java:151)
      17:44:12,718 ERROR [STDERR] at org.jbpm.graph.def.Node.leave(Node.java:393)
      17:44:12,718 ERROR [STDERR] at org.jbpm.graph.node.TaskNode.leave(TaskNode.java:209)
      17:44:12,718 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      17:44:12,718 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      17:44:12,718 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      17:44:12,718 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
      17:44:12,718 ERROR [STDERR] at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:147)
      17:44:12,718 ERROR [STDERR] at org.jbpm.graph.def.Node$$EnhancerByCGLIB$$13ccf9bb.leave(<generated>)
      17:44:12,718 ERROR [STDERR] at org.jbpm.graph.exe.Token.signal(Token.java:194)
      17:44:12,718 ERROR [STDERR] at org.jbpm.graph.exe.Token.signal(Token.java:139)
      17:44:12,718 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      17:44:12,718 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      17:44:12,718 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      17:44:12,718 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
      17:44:12,718 ERROR [STDERR] at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:147)
      17:44:12,718 ERROR [STDERR] at org.jbpm.graph.exe.Token$$EnhancerByCGLIB$$c05ba04f.signal(<generated>)
      17:44:12,718 ERROR [STDERR] at org.jbpm.taskmgmt.exe.TaskInstance.end(TaskInstance.java:476)
      17:44:12,718 ERROR [STDERR] at org.jbpm.taskmgmt.exe.TaskInstance.end(TaskInstance.java:390)
      17:44:12,718 ERROR [STDERR] at org.jbpm.command.TaskInstanceEndCommand.execute(TaskInstanceEndCommand.java:70)
      17:44:12,718 ERROR [STDERR] at com.pep.workflow.console.beans.JBPMEngine.execute(JBPMEngine.java:130)
      17:44:12,718 ERROR [STDERR] at com.pep.workflow.console.beans.Form.submit(Form.java:131)
      17:44:12,718 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      17:44:12,718 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      17:44:12,718 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      17:44:12,718 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
      17:44:12,718 ERROR [STDERR] at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:129)
      17:44:12,718 ERROR [STDERR] at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:63)
      17:44:12,718 ERROR [STDERR] at javax.faces.component.UICommand.broadcast(UICommand.java:106)
      17:44:12,718 ERROR [STDERR] at javax.faces.component.UIData.broadcast(UIData.java:513)
      17:44:12,718 ERROR [STDERR] at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:94)
      17:44:12,718 ERROR [STDERR] at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:168)
      17:44:13,218 ERROR [STDERR] at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:343)
      17:44:13,218 ERROR [STDERR] at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
      17:44:13,218 ERROR [STDERR] at javax.faces.webapp.FacesServlet.service(FacesServlet.java:137)
      17:44:13,218 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      17:44:13,218 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      17:44:13,218 ERROR [STDERR] at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
      17:44:13,218 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      17:44:13,218 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      17:44:13,218 ERROR [STDERR] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      17:44:13,218 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      17:44:13,218 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      17:44:13,218 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      17:44:13,218 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
      17:44:13,218 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
      17:44:13,218 ERROR [STDERR] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
      17:44:13,218 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      17:44:13,218 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      17:44:13,218 ERROR [STDERR] at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
      17:44:13,218 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
      17:44:13,218 ERROR [STDERR] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      17:44:13,218 ERROR [STDERR] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
      17:44:13,218 ERROR [STDERR] at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
      17:44:13,218 ERROR [STDERR] at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
      17:44:13,218 ERROR [STDERR] at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
      17:44:13,218 ERROR [STDERR] at java.lang.Thread.run(Thread.java:595)
      
      
      


      I'm using jboss 4.0.5 + mysql 5 + jdk 5 +jbpm 3.2.1

      Any idea of what could be causing this? I'm using this code to the call:

      
      StartWorkOnTaskCommand cmd1 = new StartWorkOnTaskCommand(taskInstanceId, false);
      TaskInstanceEndCommand cmd2 = new TaskInstanceEndCommand();
      
      Map map = new HashMap();
      Iterator i = this.variables.getElements().iterator();
      
      while(i.hasNext()) {
       askVariable var = (TaskVariable) i.next();
       map.put(var.getName(),var.getValue());
      }
      
      cmd2.setVariables(map);
      cmd2.setTaskInstanceId(taskInstanceId);
      
      getEngine().execute(cmd1);
      getEngine().execute(cmd2);
      
      


      Thanks in advance!

        • 1. Re: LinkageError
          kukeltje

          from what I read in other forums and on the internet, could be related to classsloading issues or two things accessing the same transaction. Sorry, but I hope you can investigate this a little further yourself. That would be very helpful

          • 2. Re: LinkageError
            ricardomarques

             

            "kukeltje" wrote:
            from what I read in other forums and on the internet, could be related to classsloading issues or two things accessing the same transaction. Sorry, but I hope you can investigate this a little further yourself. That would be very helpful


            yeah, but i'm following the code to a deeper level than my knowledge, so is a bit difficult, but I will be posting here any process, perhaps with some more detail and with your knowledge, we could comprehend what is happening.

            • 3. Re: LinkageError

              Ricardo,

              I'm no expert, but I'd be looking at your database and transaction configurations. What database are you using? It looks like you're running in Tomcat - yes?

              At the point that you're failing, you're probably opening a Job session for the first time. Jobs are interesting because they run on a different Hibernate session (and hence transaction and database connection) from the rest of JBPM. This probably has something to do with your problem - like for some reason I can't think of, you can't have two transactions open at once.

              On second thought... this is the only spot in the code that I see a session.getTransaction() call to Hibernate. You might look at the transaction-related properties in hibernate.cfg.xml and see if they make sense in your context. You might search around on them to get some guidance.

              -Ed

              • 4. Re: LinkageError
                ricardomarques

                 

                "estaub" wrote:
                Ricardo,
                I'm no expert, but I'd be looking at your database and transaction configurations. What database are you using? It looks like you're running in Tomcat - yes?


                i'm using jboss 4.0.5 and mysql 5

                What I think thats weird is that i'm using only the command interface, so I suppose that it's something from the core, or not :)

                I will analyze what i said.

                • 5. Re: LinkageError
                  ricardomarques

                  oops, *what you said :)

                  • 6. Re: LinkageError
                    ricardomarques

                    Here's my definition:

                    <?xml version="1.0" encoding="UTF-8"?>
                    
                    <process-definition
                     xmlns="" name="condition">
                     <swimlane name="default">
                     <assignment expression="user(grover)"></assignment>
                     </swimlane>
                     <end-state name="fim"></end-state>
                     <task-node name="which path">
                     <task name="which path to follow" swimlane="default">
                     <controller>
                     <variable name="path" access="read,write,required"></variable>
                     </controller>
                     </task>
                     <transition name="" to="decision"></transition>
                     </task-node>
                     <start-state name="start">
                     <transition name="" to="which path"></transition>
                     </start-state>
                     <decision name="decision">
                     <transition name="to right" to="right">
                     <condition expression="#{ path == 'right' }" />
                     </transition>
                     <transition name="to left" to="left">
                     <condition expression="#{ path == 'left' }" />
                     </transition>
                     </decision>
                     <node name="left">
                     <event type="node-enter">
                     <action name="action1" class="actions.NotifyLeft"></action>
                     </event>
                     <transition name="from left" to="end"></transition>
                     </node>
                     <node name="right">
                     <event type="node-enter">
                     <action name="action1" class="actions.NotifyRight"></action>
                     </event>
                     <transition name="from right" to="end"></transition>
                     </node>
                    </process-definition>
                    


                    When I come to task node and enter a value like "right" or "left", I run a TaskInstanceEndCommand to end the task and continue, when I do that the considtino is evaluated and the correct node is called (which prints a line on the console), then the Linkage Error pops up.

                    Debugging the application the error is raised on node.leave()

                    I'm trying to get a bit more detail where the error is raised, so clues and hints are welcome meantime :)

                    • 7. Re: LinkageError
                      ricardomarques

                      I'm wandering if I'm ending a task instance correctly since I can figure out the problem.

                       engine.openSession();
                       JbpmContext jbpmContext = engine.getJbpmContext();
                      
                      
                       TaskInstance taskInstance = jbpmContext.getTaskInstance(taskInstanceId);
                      
                       if (map != null && map.size() > 0) {
                       taskInstance.setVariables(map);
                       }
                      
                      
                       taskInstance.end(transition);
                      
                       engine.closeSession();
                      
                      


                      Is this code correct? is it usual to use it like this?

                      This only gives me problem's when the next node is a decision node.

                      thanks in advance