3 Replies Latest reply on Dec 27, 2005 7:55 PM by Elmo

    JbpmSessionFactory error

    Nakul Rajurkar Newbie

      I am using jBPM in a EJB. While calling this EJB it gives the following error...

      java.rmi.RemoteException: com.sap.engine.services.ejb.exceptions.BaseRemoteException: Exception in method listOpenTasks.
      at com.test.bpm.ejb.BpmEJBObjectImpl0.listOpenTasks(BpmEJBObjectImpl0.java:174)
      at com.test.bpm.ejb.BpmEJBObjectImpl0p4_Skel.dispatch(BpmEJBObjectImpl0p4_Skel.java:216)
      at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:294)
      at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:183)
      at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:119)
      at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
      at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
      at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
      at java.security.AccessController.doPrivileged(Native Method)
      at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:95)
      at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:160)
      Caused by: com.sap.engine.services.ejb.exceptions.BaseRuntimeException: Cannot create an instance of the stateless bean.
      at com.sap.engine.services.ejb.session.stateless_sp5.BeanFactory.getActiveBean(BeanFactory.java:192)
      at com.sap.engine.services.ejb.session.stateless_sp5.StatelessContainerFP.getActiveBean(StatelessContainerFP.java:183)
      at com.test.bpm.ejb.BpmEJBObjectImpl0.listOpenTasks(BpmEJBObjectImpl0.java:167)
      ... 10 more
      Caused by: java.lang.NoClassDefFoundError: org/jbpm/db/JbpmSessionFactory
      at com.test.bpm.dao.BpmDAO.(BpmDAO.java:35)
      at com.test.bpm.ejb.BpmEJBBean.(BpmEJBBean.java:21)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
      at com.sap.engine.services.ejb.session.stateless_sp5.BeanFactory.createObject(BeanFactory.java:106)
      at com.sap.engine.services.ejb.util.pool.ContainerPoolImpl.doResizeOneStepUp(ContainerPoolImpl.java:374)
      at com.sap.engine.services.ejb.util.pool.ContainerPoolImpl.ensureNotEmpty(ContainerPoolImpl.java:343)
      at com.sap.engine.services.ejb.util.pool.ContainerPoolImpl.pop(ContainerPoolImpl.java:291)
      at com.sap.engine.services.ejb.session.stateless_sp5.BeanFactory.getActiveBean(BeanFactory.java:188)
      ... 12 more

      ; nested exception is:
      java.lang.RuntimeException: com.sap.engine.services.ejb.exceptions.BaseRuntimeException: Cannot create an instance of the stateless bean.
      at com.sap.engine.services.ejb.session.stateless_sp5.BeanFactory.getActiveBean(BeanFactory.java:192)
      at com.sap.engine.services.ejb.session.stateless_sp5.StatelessContainerFP.getActiveBean(StatelessContainerFP.java:183)
      at com.test.bpm.ejb.BpmEJBObjectImpl0.listOpenTasks(BpmEJBObjectImpl0.java:167)
      at com.test.bpm.ejb.BpmEJBObjectImpl0p4_Skel.dispatch(BpmEJBObjectImpl0p4_Skel.java:216)
      at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:294)
      at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:183)
      at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:119)
      at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
      at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
      at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
      at java.security.AccessController.doPrivileged(Native Method)
      at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:95)
      at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:160)
      Caused by: java.lang.NoClassDefFoundError: org/jbpm/db/JbpmSessionFactory
      at com.test.bpm.dao.BpmDAO.(BpmDAO.java:35)
      at com.test.bpm.ejb.BpmEJBBean.(BpmEJBBean.java:21)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
      at com.sap.engine.services.ejb.session.stateless_sp5.BeanFactory.createObject(BeanFactory.java:106)
      at com.sap.engine.services.ejb.util.pool.ContainerPoolImpl.doResizeOneStepUp(ContainerPoolImpl.java:374)
      at com.sap.engine.services.ejb.util.pool.ContainerPoolImpl.ensureNotEmpty(ContainerPoolImpl.java:343)
      at com.sap.engine.services.ejb.util.pool.ContainerPoolImpl.pop(ContainerPoolImpl.java:291)
      at com.sap.engine.services.ejb.session.stateless_sp5.BeanFactory.getActiveBean(BeanFactory.java:188)
      ... 12 more


      at com.sap.engine.services.ejb.exceptions.BaseRemoteException.writeReplace(BaseRemoteException.java:276)
      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:324)
      at java.io.ObjectStreamClass.invokeWriteReplace(ObjectStreamClass.java:896)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1011)
      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
      at com.sap.engine.services.rmi_p4.DispatchImpl.throwException(DispatchImpl.java:135)
      at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:296)
      at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:183)
      at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:119)
      at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
      at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
      at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
      at java.security.AccessController.doPrivileged(Native Method)
      at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:95)
      at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:160)
      Caused by: java.lang.RuntimeException: com.sap.engine.services.ejb.exceptions.BaseRuntimeException: Cannot create an instance of the stateless bean.
      at com.sap.engine.services.ejb.session.stateless_sp5.BeanFactory.getActiveBean(BeanFactory.java:192)
      at com.sap.engine.services.ejb.session.stateless_sp5.StatelessContainerFP.getActiveBean(StatelessContainerFP.java:183)
      at com.test.bpm.ejb.BpmEJBObjectImpl0.listOpenTasks(BpmEJBObjectImpl0.java:167)
      at com.test.bpm.ejb.BpmEJBObjectImpl0p4_Skel.dispatch(BpmEJBObjectImpl0p4_Skel.java:216)
      at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:294)
      at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:183)
      at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:119)
      at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
      at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
      at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
      at java.security.AccessController.doPrivileged(Native Method)
      at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:95)
      at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:160)
      Caused by: java.lang.NoClassDefFoundError: org/jbpm/db/JbpmSessionFactory
      at com.test.bpm.dao.BpmDAO.(BpmDAO.java:35)
      at com.test.bpm.ejb.BpmEJBBean.(BpmEJBBean.java:21)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
      at com.sap.engine.services.ejb.session.stateless_sp5.BeanFactory.createObject(BeanFactory.java:106)
      at com.sap.engine.services.ejb.util.pool.ContainerPoolImpl.doResizeOneStepUp(ContainerPoolImpl.java:374)
      at com.sap.engine.services.ejb.util.pool.ContainerPoolImpl.ensureNotEmpty(ContainerPoolImpl.java:343)
      at com.sap.engine.services.ejb.util.pool.ContainerPoolImpl.pop(ContainerPoolImpl.java:291)
      at com.sap.engine.services.ejb.session.stateless_sp5.BeanFactory.getActiveBean(BeanFactory.java:188)
      ... 12 more


      at com.sap.engine.services.ejb.exceptions.BaseRuntimeException.writeReplace(BaseRuntimeException.java:273)
      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:324)
      at java.io.ObjectStreamClass.invokeWriteReplace(ObjectStreamClass.java:896)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1011)
      at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1332)
      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1304)
      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
      ... 11 more


      My jbpm.properties file looks like this :

      jbpm.scheduler.service.factory=org.jbpm.scheduler.impl.SchedulerServiceImpl
      jbpm.task.instance.class=org.jbpm.taskmgmt.exe.TaskInstance

      # uncomment the next line if JbpmSessionFactory.getInstance()
      # should lookup the singleton instance from JNDI instead of creating
      # a default one.
      #
      jbpm.session.factory.jndi.name=java:/jbpm/JbpmSessionFactory

      # uncomment the next line to use the file system instead of the database for
      # storing files related to a process definition
      #
      # jbpm.files.dir=c:/jbpm.data

      # resource path to a properties file that will overwrite all the hibernate
      # properties. For database specific builds in db project there is a different
      # hibernate.properties file on the classpath for each database. You could change
      # the default database for any testing runs by uncommenting the next line and
      # adding a hibernate.properties file in the basedir.
      #
      jbpm.hibernate.cfg.xml=hibernate.cfg.xml
      jbpm.hibernate.properties=hibernate.properties


      Any kind of help will be appreciated... Thanks in advance
      Nakul

        • 2. Re: JbpmSessionFactory error
          Nakul Rajurkar Newbie

          Somehow I am not understanding how to resolve this issue :
          "Caused by: java.lang.NoClassDefFoundError: org/jbpm/db/JbpmSessionFactory"

          • 3. Re: JbpmSessionFactory error
            Elmo Novice

            Have you checked that the libraries are in the correct path?
            What version of jbpm are you using? What is your application server? When starting up the server, have you seen the hibernate mappings? This is the first indication that hibernate maps correctly and your factory is in place.

            If you plan to use the web application in jbpm 3.02, the easiest is to run it in Jboss bec. it makes use of mbeans (check the sar file). If you know how to configure it in other app servers thats fine, otherwise you have to devise your own way. Since JbpmSessionFactory must be loaded only once (for performance reasons), maybe you can be creative and use BMP instead or make your own JbpmSessionFactory, at least it will work in other app servers. You can use static but as we know its use is discouraged in managed environments.

            If you dont want to do any of those things, and you want something simpler, check the 3.1 version instead. But, again, I don't know if it works in other app servers cause its pretty much JBoss-specific.

            Regards,

            Elmo