1 Reply Latest reply on Jul 25, 2008 7:21 AM by Ronald van Kuijk

    Latest Error in running JBPM Application

    subhajit sidhanta Newbie

      Hi,

      I have solved the previous datasource error I was ghetting in my JBPM application---thanks to you all.But now I am getting a new error.

      The server console log is as follows:


      19:15:44,079 DEBUG [DefaultSaveOrUpdateEventListener] saving transient instance
      19:15:44,079 DEBUG [AbstractBatcher] about to open PreparedStatement (open Prepa
      redStatements: 0, globally: 0)
      19:15:44,079 DEBUG [SQL]
      select
      hibernate_sequence.nextval
      from
      dual
      19:15:44,079 INFO [STDOUT] Hibernate:
      select
      hibernate_sequence.nextval
      from
      dual
      19:15:44,079 DEBUG [AbstractBatcher] preparing statement
      19:15:44,079 DEBUG [SequenceGenerator] Sequence identifier generated: 125
      19:15:44,079 DEBUG [AbstractBatcher] about to close PreparedStatement (open Prep
      aredStatements: 1, globally: 1)
      19:15:44,079 DEBUG [AbstractBatcher] closing statement
      19:15:44,079 DEBUG [AbstractSaveEventListener] generated identifier: 125, using
      strategy: org.hibernate.id.SequenceGenerator
      19:15:44,079 DEBUG [AbstractSaveEventListener] saving [org.jbpm.context.def.Vari
      ableAccess#125]
      19:15:44,079 DEBUG [CascadingAction] cascading to saveOrUpdate: org.jbpm.context
      .def.VariableAccess
      19:15:44,095 DEBUG [IdentifierValue] id unsaved-value: 0
      19:15:44,095 DEBUG [AbstractSaveEventListener] transient instance of: org.jbpm.c
      ontext.def.VariableAccess
      19:15:44,095 DEBUG [DefaultSaveOrUpdateEventListener] saving transient instance
      19:15:44,095 DEBUG [AbstractBatcher] about to open PreparedStatement (open Prepa
      redStatements: 0, globally: 0)
      19:15:44,095 DEBUG [SQL]
      select
      hibernate_sequence.nextval
      from
      dual
      19:15:44,095 INFO [STDOUT] Hibernate:
      select
      hibernate_sequence.nextval
      from
      dual
      19:15:44,095 DEBUG [AbstractBatcher] preparing statement
      19:15:44,095 DEBUG [SequenceGenerator] Sequence identifier generated: 126
      19:15:44,095 DEBUG [AbstractBatcher] about to close PreparedStatement (open Prep
      aredStatements: 1, globally: 1)
      19:15:44,095 DEBUG [AbstractBatcher] closing statement
      19:15:44,095 DEBUG [AbstractSaveEventListener] generated identifier: 126, using
      strategy: org.hibernate.id.SequenceGenerator
      19:15:44,095 DEBUG [AbstractSaveEventListener] saving [org.jbpm.context.def.Vari
      ableAccess#126]
      19:15:44,095 DEBUG [Cascade] done cascade ACTION_SAVE_UPDATE for collection: org
      .jbpm.taskmgmt.def.TaskController.variableAccesses
      19:15:44,095 DEBUG [Cascade] done processing cascade ACTION_SAVE_UPDATE for: org
      .jbpm.taskmgmt.def.TaskController
      19:15:44,095 DEBUG [Cascade] done processing cascade ACTION_SAVE_UPDATE for: org
      .jbpm.taskmgmt.def.Task
      19:15:44,095 DEBUG [Cascade] processing cascade ACTION_SAVE_UPDATE for: org.jbpm
      .taskmgmt.def.Task
      19:15:44,095 DEBUG [Cascade] done processing cascade ACTION_SAVE_UPDATE for: org
      .jbpm.taskmgmt.def.Task
      19:15:44,095 DEBUG [Cascade] done processing cascade ACTION_SAVE_UPDATE for: org
      .jbpm.taskmgmt.def.TaskMgmtDefinition
      19:15:44,095 DEBUG [Cascade] processing cascade ACTION_SAVE_UPDATE for: org.jbpm
      .taskmgmt.def.TaskMgmtDefinition
      19:15:44,111 DEBUG [Cascade] done processing cascade ACTION_SAVE_UPDATE for: org
      .jbpm.taskmgmt.def.TaskMgmtDefinition
      19:15:44,111 DEBUG [Cascade] done cascade ACTION_SAVE_UPDATE for collection: org
      .jbpm.graph.def.ProcessDefinition.definitions
      19:15:44,111 DEBUG [Cascade] done processing cascade ACTION_SAVE_UPDATE for: org
      .jbpm.graph.def.ProcessDefinition
      19:15:44,111 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
      java.lang.NullPointerException
      at com.sample.action.CallProcess.testCallProcess(CallProcess.java:28)
      at org.apache.jsp.JSP.CallMethod_jsp._jspService(org.apache.jsp.JSP.Call
      Method_jsp:58)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper
      .java:322)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:3
      14)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
      icationFilterChain.java:252)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
      ilterChain.java:173)
      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFi
      lter.java:81)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
      icationFilterChain.java:202)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
      ilterChain.java:173)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
      alve.java:213)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
      alve.java:178)
      at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrinc
      ipalValve.java:39)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(Securit
      yAssociationValve.java:159)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValv
      e.java:59)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
      ava:126)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
      ava:105)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
      ve.java:107)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
      a:148)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
      :856)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
      ssConnection(Http11Protocol.java:744)
      at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpo
      int.java:527)
      at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWor
      kerThread.java:112)
      at java.lang.Thread.run(Thread.java:595)
      19:15:48,673 DEBUG [JbpmContextInfo] creating jbpm context with service factorie
      s '[message, scheduler, logging, persistence, authentication]'
      19:15:48,689 DEBUG [StaticNotifier] woke up
      19:15:49,501 DEBUG [JbpmContext] creating JbpmContext
      19:15:49,501 DEBUG [DbPersistenceServiceFactory] creating persistence service
      19:15:49,501 DEBUG [JbpmContextInfo] creating jbpm context with service factorie
      s '[message, scheduler, logging, persistence, authentication]'
      19:15:49,501 DEBUG [DbPersistenceService] creating hibernate session
      19:15:49,501 DEBUG [JbpmContext] creating JbpmContext
      19:15:49,501 DEBUG [SessionImpl] opened session at timestamp: 4984451684356096
      19:15:49,501 DEBUG [DbPersistenceServiceFactory] creating persistence service
      19:15:49,501 DEBUG [DbPersistenceService] beginning hibernate transaction
      19:15:49,501 DEBUG [DbPersistenceService] creating hibernate session
      19:15:49,501 DEBUG [JDBCTransaction] begin
      19:15:49,501 DEBUG [SessionImpl] opened session at timestamp: 4984451684356097
      19:15:49,501 DEBUG [ConnectionManager] opening JDBC connection
      19:15:49,501 DEBUG [DbPersistenceService] beginning hibernate transaction
      19:15:49,501 DEBUG [JDBCTransaction] current autocommit status: true
      19:15:49,501 DEBUG [JDBCTransaction] begin
      19:15:49,501 DEBUG [JDBCTransaction] disabling autocommit
      19:15:49,501 DEBUG [ConnectionManager] opening JDBC connection
      19:15:49,501 DEBUG [JDBCContext] after transaction begin
      19:15:49,501 DEBUG [JDBCTransaction] current autocommit status: true
      19:15:49,501 DEBUG [SchedulerThread] checking for timers
      19:15:49,501 DEBUG [JDBCTransaction] disabling autocommit
      19:15:49,517 DEBUG [SessionImpl] iterate:

      select ti
      from org.jbpm.scheduler.exe.Timer as ti
      where ti.exception is null
      and ti.isSuspended != true
      order by ti.dueDate asc


      19:15:49,517 DEBUG [JDBCContext] after transaction begin
      19:15:49,517 DEBUG [QueryParameters] named parameters: {}
      19:15:49,517 DEBUG [SessionImpl] iterate:

      select message
      from org.jbpm.msg.Message as message
      where message.destination = :destination
      and message.isSuspended != true
      and message.exception is null


      19:15:49,517 DEBUG [QueryTranslatorImpl] compile() : The query is already compil
      ed, skipping...
      19:15:49,517 DEBUG [QueryParameters] named parameters: {destination=CMD_EXECUTOR
      }
      19:15:49,517 DEBUG [AbstractBatcher] about to open PreparedStatement (open Prepa
      redStatements: 0, globally: 0)
      19:15:49,517 DEBUG [QueryTranslatorImpl] compile() : The query is already compil
      ed, skipping...
      19:15:49,517 DEBUG [SQL]
      /* named HQL query SchedulerSession.findTimersByDueDate */ select
      timer0_.ID_ as col_0_0_
      from
      JBPM_TIMER timer0_
      where
      (
      timer0_.EXCEPTION_ is null
      )
      and timer0_.ISSUSPENDED_<>1
      order by
      timer0_.DUEDATE_ asc
      19:15:49,517 DEBUG [AbstractBatcher] about to open PreparedStatement (open Prepa
      redStatements: 0, globally: 1)
      19:15:49,517 INFO [STDOUT] Hibernate:
      /* named HQL query SchedulerSession.findTimersByDueDate */ select
      timer0_.ID_ as col_0_0_
      from
      JBPM_TIMER timer0_
      where
      (
      timer0_.EXCEPTION_ is null
      )
      and timer0_.ISSUSPENDED_<>1
      order by
      timer0_.DUEDATE_ asc
      19:15:49,517 DEBUG [SQL]
      /* named HQL query MessagingSession.findMessages */ select
      message0_.ID_ as col_0_0_
      from
      JBPM_MESSAGE message0_
      where
      message0_.DESTINATION_=?
      and message0_.ISSUSPENDED_<>1
      and (
      message0_.EXCEPTION_ is null
      )
      19:15:49,532 DEBUG [AbstractBatcher] preparing statement
      19:15:49,532 INFO [STDOUT] Hibernate:
      /* named HQL query MessagingSession.findMessages */ select
      message0_.ID_ as col_0_0_
      from
      JBPM_MESSAGE message0_
      where
      message0_.DESTINATION_=?
      and message0_.ISSUSPENDED_<>1
      and (
      message0_.EXCEPTION_ is null
      )
      19:15:49,532 DEBUG [AbstractBatcher] about to open ResultSet (open ResultSets: 0
      , globally: 0)
      19:15:49,532 DEBUG [AbstractBatcher] preparing statement
      19:15:49,532 DEBUG [IteratorImpl] exhausted results
      19:15:49,532 DEBUG [Loader] bindNamedParameters() CMD_EXECUTOR -> destination [1
      ]
      19:15:49,532 DEBUG [IteratorImpl] closing iterator
      19:15:49,532 DEBUG [StringType] binding 'CMD_EXECUTOR' to parameter: 1
      19:15:49,532 DEBUG [AbstractBatcher] about to close ResultSet (open ResultSets:
      1, globally: 1)
      19:15:49,532 DEBUG [AbstractBatcher] about to close PreparedStatement (open Prep
      aredStatements: 1, globally: 2)
      19:15:49,532 DEBUG [AbstractBatcher] closing statement
      19:15:49,548 DEBUG [JbpmContext] closing JbpmContext
      19:15:49,548 DEBUG [AbstractBatcher] about to open ResultSet (open ResultSets: 0
      , globally: 0)
      19:15:49,548 DEBUG [Services] closing service 'persistence': org.jbpm.persistenc
      e.db.DbPersistenceService@1c190a2
      19:15:49,548 DEBUG [IteratorImpl] exhausted results
      19:15:49,548 DEBUG [DbPersistenceService] committing hibernate transaction
      19:15:49,548 DEBUG [IteratorImpl] closing iterator
      19:15:49,548 DEBUG [JDBCTransaction] commit
      19:15:49,548 DEBUG [AbstractBatcher] about to close ResultSet (open ResultSets:
      1, globally: 1)
      19:15:49,548 DEBUG [SessionImpl] automatically flushing session
      19:15:49,548 DEBUG [AbstractBatcher] about to close PreparedStatement (open Prep
      aredStatements: 1, globally: 1)
      19:15:49,548 DEBUG [JDBCContext] before transaction completion
      19:15:49,548 DEBUG [AbstractBatcher] closing statement
      19:15:49,548 DEBUG [SessionImpl] before transaction completion
      19:15:49,548 DEBUG [JbpmContext] closing JbpmContext
      19:15:49,548 DEBUG [Services] closing service 'persistence': org.jbpm.persistenc
      e.db.DbPersistenceService@feba21
      19:15:49,548 DEBUG [JDBCTransaction] re-enabling autocommit
      19:15:49,548 DEBUG [DbPersistenceService] committing hibernate transaction
      19:15:49,548 DEBUG [JDBCTransaction] committed JDBC Connection
      19:15:49,548 DEBUG [JDBCTransaction] commit
      19:15:49,548 DEBUG [JDBCContext] after transaction completion
      19:15:49,548 DEBUG [SessionImpl] automatically flushing session
      19:15:49,548 DEBUG [ConnectionManager] aggressively releasing JDBC connection
      19:15:49,548 DEBUG [JDBCContext] before transaction completion
      19:15:49,548 DEBUG [ConnectionManager] closing JDBC connection [ (open PreparedS
      tatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
      19:15:49,548 DEBUG [SessionImpl] before transaction completion
      19:15:49,548 DEBUG [SessionImpl] after transaction completion
      19:15:49,548 DEBUG [DbPersistenceService] closing hibernate session
      19:15:49,548 DEBUG [JDBCTransaction] re-enabling autocommit
      19:15:49,548 DEBUG [SessionImpl] closing session
      19:15:49,548 DEBUG [JDBCTransaction] committed JDBC Connection
      19:15:49,548 DEBUG [ConnectionManager] connection already null in cleanup : no a
      ction
      19:15:49,548 DEBUG [JDBCContext] after transaction completion
      19:15:49,548 DEBUG [ConnectionManager] aggressively releasing JDBC connection
      19:15:49,548 DEBUG [ConnectionManager] closing JDBC connection [ (open PreparedS
      tatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
      19:15:49,564 DEBUG [SessionImpl] after transaction completion
      19:15:49,564 DEBUG [DbPersistenceService] closing hibernate session
      19:15:49,564 DEBUG [SessionImpl] closing session
      19:15:49,564 DEBUG [ConnectionManager] connection already null in cleanup : no a
      ction
      19:15:49,564 DEBUG [Services] closing service 'message': org.jbpm.msg.db.DbMessa
      geService@16dd645
      19:15:49,564 DEBUG [CommandExecutorThread] waiting for more messages
      19:15:49,564 DEBUG [StaticNotifier] going to wait for (CMD_EXECUTOR, java.lang.O
      bject@586403)


      The error in my Application window is as follows:

      HTTP Status 500 -

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

      type Exception report

      message

      description The server encountered an internal error () that prevented it from fulfilling this request.

      exception

      org.apache.jasper.JasperException
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:370)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)


      root cause

      java.lang.NullPointerException
      com.sample.action.CallProcess.testCallProcess(CallProcess.java:28)
      org.apache.jsp.JSP.CallMethod_jsp._jspService(org.apache.jsp.JSP.CallMethod_jsp:58)
      org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)


      note The full stack trace of the root cause is available in the Apache Tomcat/5.5 logs.



      The code in CallProcess class is :

      package com.sample.action;

      import junit.framework.TestCase;
      import org.jbpm.graph.def.ProcessDefinition;
      import org.jbpm.graph.exe.ProcessInstance;
      import org.jbpm.graph.exe.Token;
      import org.jbpm.JbpmContext;
      import org.jbpm.JbpmConfiguration;

      public class CallProcess extends TestCase{

      public CallProcess(){}

      public void testCallProcess(){
      try{
      JbpmConfiguration jbpmConfiguration = JbpmConfiguration.parseResource("jbpm.cfg.xml");
      //ProcessDefinition processDefinition=ProcessDefinition.parseXmlResource("simple.par/processdefinition.xml");
      //ProcessDefinition processDefinition=ProcessDefinition.parseXmlResource("D:/jbpm-starters-kit-3.1.2/jbpm/src/process.examples/26thJuneProject/processes/simple/processdefinition.xml");
      ProcessDefinition processDefinition=ProcessDefinition.parseXmlResource("processdefinition.xml");
      //System.out.println("processDefinition");
      //System.out.println(processDefinition);
      //parseResource("simple.par/processdefinition.xml");
      JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
      //jbpmConfiguration.createSchema();
      ProcessInstance processInstance=new ProcessInstance();
      jbpmContext.deployProcessDefinition(processDefinition);
      Token token=processInstance.getRootToken();
      assertSame(processDefinition.getStartState(), token.getNode());
      //assertSame(processDefinition.getNode("start"), token.getNode());
      token.signal();
      assertSame(processDefinition.getNode("first"), token.getNode());
      token.signal();
      /*assertSame(processDefinition.getNode("task2"), token.getNode());
      token.signal();*/
      assertSame(processDefinition.getNode("end"), token.getNode());
      }finally{
      }

      }
      /**
      * @param args
      */

      /*public static void main(String[] args) {
      // TODO Auto-generated method stub

      }*/

      }


      Thanks you all in anticipation.