0 Replies Latest reply on Oct 24, 2007 8:41 AM by Ajit Pokharkar

    Error while deploying Processdefinition thru a servlet

    Ajit Pokharkar Newbie

      Hi
      I am using 'jbpm 3.1.3' on 'JBOSS AS 4.0.5.GA'
      I am executing following code in a servlet

      JbpmConfiguration jbpmconfig = JbpmConfiguration.parseXmlString(
       "<jbpm-configuration>" +
      
       // A jbpm-context mechanism separates the jbpm core
       // engine from the services that jbpm uses from
       // the environment.
      
       " <jbpm-context>" +
       " <service name='persistence' " +
       " factory='org.jbpm.persistence.db.DbPersistenceServiceFactory' />" +
       " </jbpm-context>" +
       "<jbpm-context>" +
       "<service name='persistence'>" +
       "<factory>" +
       "<bean class='org.jbpm.persistence.db.DbPersistenceServiceFactory'>" +
       "<field name='isTransactionEnabled'>" +"<false/>" +"</field>" +
       "</bean>" +
       "</factory>" +
       "</service>" +
       "<service name='tx' factory='org.jbpm.tx.TxServiceFactory' />" +
       "<service name='message' factory='org.jbpm.msg.db.DbMessageServiceFactory' />" +
       "<service name='scheduler' factory='org.jbpm.scheduler.db.DbSchedulerServiceFactory' />" +
       "<service name='logging' factory='org.jbpm.logging.db.DbLoggingServiceFactory' />" +
       "<service name='authentication' factory='org.jbpm.security.authentication.DefaultAuthenticationServiceFactory' />" +
       "</jbpm-context>" +
      
      
       // Also all the resource files that are used by jbpm are
       // referenced from the jbpm.cfg.xml
      
       " <string name='resource.hibernate.cfg.xml' " +
       " value='hibernate.cfg.xml' />" +
       " <string name='resource.business.calendar' " +
       " value='org/jbpm/calendar/jbpm.business.calendar.properties' />" +
       " <string name='resource.default.modules' " +
       " value='org/jbpm/graph/def/jbpm.default.modules.properties' />" +
       " <string name='resource.converter' " +
       " value='org/jbpm/db/hibernate/jbpm.converter.properties' />" +
       " <string name='resource.action.types' " +
       " value='org/jbpm/graph/action/action.types.xml' />" +
       " <string name='resource.node.types' " +
       " value='org/jbpm/graph/node/node.types.xml' />" +
       " <string name='resource.varmapping' " +
       " value='org/jbpm/context/exe/jbpm.varmapping.xml' />" +
       "</jbpm-configuration>"
       );
       JbpmContext jbpmContext = jbpmconfig.createJbpmContext();
       ProcessDefinition processDefinition = ProcessDefinition.parseXmlResource("processes/WorkFlowTest/processdefinition.xml");
       jbpmContext.deployProcessDefinition(processDefinition);


      In have kept 'processdefinition.xml' under processes/WorkFlowTest under WEB-INF
      and I am getting the following error.

      17:49:09,500 ERROR [[TestServlet]] Servlet.service() for servlet TestServlet thr
      ew exception
      org.jbpm.JbpmException: couldn't instantiate bean 'null' of type 'org.jbpm.tx.Tx
      ServiceFactory'
       at org.jbpm.configuration.BeanInfo.createObject(BeanInfo.java:88)
       at org.jbpm.configuration.JbpmContextInfo.createObject(JbpmContextInfo.j
      ava:126)
       at org.jbpm.configuration.ObjectFactoryImpl.getObject(ObjectFactoryImpl.
      java:146)
       at org.jbpm.configuration.ObjectFactoryImpl.createObject(ObjectFactoryIm
      pl.java:103)
       at org.jbpm.configuration.ObjectFactoryImpl.createObject(ObjectFactoryIm
      pl.java:78)
       at org.jbpm.JbpmConfiguration.createJbpmContext(JbpmConfiguration.java:3
      43)
       at org.jbpm.JbpmConfiguration.createJbpmContext(JbpmConfiguration.java:3
      39)
       at com.test.JavaCallFlow.setjBpmConfig(JavaCallFlow.java:69)
       at com.test.TestServlet.service(TestServlet.java:20)
       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:96)
       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.SecurityAssociationValve.invoke(Securit
      yAssociationValve.java:175)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValv
      e.java:74)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
      ava:126)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
      ava:105)
       at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConne
      ctionValve.java:156)
       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
      :869)
       at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.p
      rocessConnection(Http11BaseProtocol.java:664)
       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)
      Caused by: org.jbpm.JbpmException: couldn't load class 'org.jbpm.tx.TxServiceFac
      tory'
       at org.jbpm.configuration.ObjectFactoryImpl.loadClass(ObjectFactoryImpl.
      java:164)
       at org.jbpm.configuration.BeanInfo.createObject(BeanInfo.java:85)
       ... 28 more
      Caused by: java.lang.ClassNotFoundException: org.jbpm.tx.TxServiceFactory
       at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa
      der.java:1355)
       at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa
      der.java:1201)
       at org.jbpm.configuration.ObjectFactoryImpl.loadClass(ObjectFactoryImpl.
      java:162)
       ... 29 more


      I feel it's crashing at the line
      JbpmContext jbpmContext = jbpmconfig.createJbpmContext();
      Pls tell what am I missing ?? It's urgent..
      thanks