6 Replies Latest reply on Jan 17, 2014 12:39 AM by Xiang Lai

    newDefaultInMemoryBuilder does not work in jBPM6

    Xiang Lai Newbie

      Hi,

       

      I would like to write a simple example to run jBPM6 without persistence. I have followed the user guide to write the code but meet exceptions.

       

      The code piece:

      RuntimeEnvironment env = RuntimeEnvironmentBuilder.Factory.get()

        .newDefaultInMemoryBuilder()

        .get();

        return RuntimeManagerFactory.Factory.get().

        newSingletonRuntimeManager(env);

       

      The exception:

      Exception in thread "main" javax.persistence.PersistenceException: [PersistenceUnit: org.jbpm.persistence.jpa] Unable to build EntityManagerFactory

        at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:930)

        at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:904)

        at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:72)

        at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:63)

        at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:47)

        at org.jbpm.runtime.manager.impl.DefaultRuntimeEnvironment.init(DefaultRuntimeEnvironment.java:72)

        at org.jbpm.runtime.manager.impl.RuntimeEnvironmentBuilder.get(RuntimeEnvironmentBuilder.java:314)

        at org.jbpm.runtime.manager.impl.RuntimeEnvironmentBuilder.get(RuntimeEnvironmentBuilder.java:56)

        at com.sample.ProcessMain.createMemoryRuntimeManager(ProcessMain.java:67)

        at com.sample.ProcessMain.main(ProcessMain.java:28)

      Caused by: org.hibernate.service.jndi.JndiException: Unable to lookup JNDI name [jdbc/jbpm-ds]

        at org.hibernate.service.jndi.internal.JndiServiceImpl.locate(JndiServiceImpl.java:68)

        at org.hibernate.service.jdbc.connections.internal.DatasourceConnectionProviderImpl.configure(DatasourceConnectionProviderImpl.java:116)

        at org.hibernate.service.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:75)

        at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:159)

        at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:131)

        at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.buildJdbcConnectionAccess(JdbcServicesImpl.java:223)

        at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:89)

        at org.hibernate.service.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:75)

        at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:159)

        at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:131)

        at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:78)

        at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2295)

        at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2291)

        at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1760)

        at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:94)

        at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:920)

        ... 9 more

      Caused by: javax.naming.NameNotFoundException: unable to find a bound object at name 'jdbc/jbpm-ds'

        at bitronix.tm.jndi.BitronixContext.lookup(BitronixContext.java:83)

        at bitronix.tm.jndi.BitronixContext.lookup(BitronixContext.java:67)

        at javax.naming.InitialContext.lookup(InitialContext.java:396)

        at org.hibernate.service.jndi.internal.JndiServiceImpl.locate(JndiServiceImpl.java:65)

        ... 24 more

       

       

      I have checked code, it is quite strange in org.jbpm.runtime.manager.impl.DefaultRuntimeEnvironment.init()

      Capture2.JPG

      If I don't configure EMF, it will try to create a default one regardless of this.usePersistence. And the exception is thrown in here.

      Does anyone meet same problem? or i have miss some configurations?

       

      Best Regards

      Xiang