0 Replies Latest reply on Nov 11, 2005 9:54 AM by shi jimeng

    a exception for java.lang.NullPointerException in instance.s

    shi jimeng Newbie

      this is exception:

      22:39:44,093 DEBUG GraphElement : event 'process-start' on 'ProcessDefinition(leave)' for 'Token(/)'
      instance value: org.jbpm.graph.exe.ProcessInstance@1feca64
      Instance is in start state start:start
      Message variable should not exist yet null
      instance.getId(): 0
      instance.getRootToken(): Token(/)
      instance.getStart(): Fri Nov 11 22:39:44 CST 2005
      22:39:44,109 DEBUG GraphElement : event 'before-signal' on 'StartState(start)' for 'Token(/)'
      22:39:44,109 DEBUG GraphElement : event 'node-leave' on 'StartState(start)' for 'Token(/)'
      22:39:44,109 DEBUG GraphElement : event 'transition' on 'Transition(manager_aduit_transition)' for 'Token(/)'
      22:39:44,109 DEBUG GraphElement : event 'node-enter' on 'TaskNode(manager audit)' for 'Token(/)'
      22:39:44,109 DEBUG JbpmConfiguration : jbpm.hibernate.properties=hibernate.properties
      java.lang.NullPointerException
       at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:261)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
       at org.jbpm.instantiation.ClassLoaderUtil.loadClass(ClassLoaderUtil.java:16)
       at org.jbpm.taskmgmt.exe.TaskMgmtInstance.getTaskInstanceClass(TaskMgmtInstance.java:41)
       at org.jbpm.taskmgmt.exe.TaskMgmtInstance.instantiateNewTaskInstance(TaskMgmtInstance.java:174)
       at org.jbpm.taskmgmt.exe.TaskMgmtInstance.createTaskInstance(TaskMgmtInstance.java:74)
       at org.jbpm.graph.node.TaskNode.execute(TaskNode.java:136)
       at org.jbpm.graph.def.Node.enter(Node.java:284)
       at org.jbpm.graph.def.Transition.take(Transition.java:92)
       at org.jbpm.graph.def.Node.leave(Node.java:349)
       at org.jbpm.graph.node.StartState.leave(StartState.java:73)
       at org.jbpm.graph.exe.Token.signal(Token.java:127)
       at org.jbpm.graph.exe.Token.signal(Token.java:92)
       at org.jbpm.graph.exe.ProcessInstance.signal(ProcessInstance.java:201)
       at com.bpm.oa.leave.ManagerAuditTest.testSimpleProcess(ManagerAuditTest.java:89)
       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 junit.framework.TestCase.runTest(TestCase.java:154)
       at junit.framework.TestCase.runBare(TestCase.java:127)
       at junit.framework.TestResult$1.protect(TestResult.java:106)
       at junit.framework.TestResult.runProtected(TestResult.java:124)
       at junit.framework.TestResult.run(TestResult.java:109)
       at junit.framework.TestCase.run(TestCase.java:118)
       at junit.framework.TestSuite.runTest(TestSuite.java:208)
       at junit.framework.TestSuite.run(TestSuite.java:203)
       at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
       at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
       at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)


      the source:

      ProcessDefinition processDefinition =
       ProcessDefinition.parseXmlResource("leave.par/processdefinition.xml");
       assertNotNull("Definition should not be null", processDefinition);
      
       // Create an instance of the process definition.
       ProcessInstance instance = new ProcessInstance(processDefinition);
       assertEquals(
       "Instance is in start state",
       instance.getRootToken().getNode().getName(),
       "start");
       assertNull(
       "Message variable should not exist yet",
       instance.getContextInstance().getVariable("item"));
       System.out.println("instance value: "+instance);
       System.out.println(
       "Instance is in start state "+
       instance.getRootToken().getNode().getName()+
       ":start");
       System.out.println(
       "Message variable should not exist yet "+
       instance.getContextInstance().getVariable("item"));
      
       // Move the process instance from its start state to the first state.
       // The configured action should execute and the appropriate message
       // should appear in the message process variable.
       System.out.println("instance.getId(): "+instance.getId());
       System.out.println("instance.getRootToken(): "+instance.getRootToken());
       System.out.println("instance.getStart(): "+instance.getStart());
      // instance.signal("manager_aduit_transition");
       instance.signal();