0 Replies Latest reply on Jun 9, 2014 8:47 AM by quintes.van.aswegen

    Issue running sample project - jBPM 6.0.1 Final testEvaluationProcess demo

    quintes.van.aswegen

      Hi All

       

      I have downloaded and installed 6.0.1 full and the jboss instance and web console are running

       

      The eclipse project "evaluation" when run as a junit app is giving me this error

       

      java.lang.NullPointerException

          at org.jbpm.test.JbpmJUnitBaseTestCase.cleanupSingletonSessionId(JbpmJUnitBaseTestCase.java:695)

          at org.jbpm.test.JbpmJUnitBaseTestCase.setUp(JbpmJUnitBaseTestCase.java:186)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

          at java.lang.reflect.Method.invoke(Method.java:606)

          at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)

          at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)

          at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)

          at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)

          at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)

          at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)

          at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)

          at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)

          at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)

          at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)

          at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)

          at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)

          at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)

          at org.junit.runners.ParentRunner.run(ParentRunner.java:309)

          at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)

          at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)

          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)

          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)

          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)

          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

       

       

      1. what is the issue here?

      2. Why does the jbpm-test-6.0.1-20140120.jar need to be referenced for the solution to work?

      3. Because of question 2 giving me problems I googled some and found this Issue running sample project - jBPM 6.0.1 Final, this comment in particular: Re: Issue running sample project - jBPM 6.0.1 Final

          As per that post  Re: Re: Issue running sample project - jBPM 6.0.1 Final, created the persistence.xml (attached) but the test code still didnt work.

          I copied the code and tried to run the code as follows in a main() with an EntityManager as recommended in the post (as attached Run.java)

       

          Then i get this

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

       

          Most likely the persistence.xml in the test jar mentioned in (2), so i remove it from includes and rerun

       

          Exception on Run.java line 67

          Exception in thread "main" javax.persistence.PersistenceException: No Persistence provider for EntityManager named org.jbpm.persistence.jpa

       

          Then i try to swap my boolean old to false to run the code with an EntityManager defined (Run.java line 40):

       

            Exception raised on EntityManager

       

      Exception in thread "main" javax.persistence.PersistenceException: [PersistenceUnit: org.jbpm.persistence.jpa.updated] 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 com.sample.Run.main(Run.java:41)

      Caused by: org.hibernate.service.jndi.JndiException: Error parsing JNDI name [java:jboss/datasources/jbpmDS]

          at org.hibernate.service.jndi.internal.JndiServiceImpl.parseName(JndiServiceImpl.java:92)

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

          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)

          ... 5 more

      Caused by: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file:  java.naming.factory.initial

          at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:662)

          at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:307)

          at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:344)

          at javax.naming.InitialContext.getNameParser(InitialContext.java:499)

          at org.hibernate.service.jndi.internal.JndiServiceImpl.parseName(JndiServiceImpl.java:86)

       

       

      So how do i get it to point to the data source defined in the demo ( <jta-data-source>java:jboss/datasources/jbpmDS</jta-data-source>)?

       

      Thanks in advance,

       

        q

       

      I have sent this to the user group.

      Edit2: is this comment on Re: Re: Issue running sample project - jBPM 6.0.1 Final accurate ?