1 Reply Latest reply on Feb 8, 2016 8:11 AM by Tony Cattlin

    HELP ! Unable to build entity manager factory... unable to find a bound object at name 'java:jboss/datasources/jbpmDS'

    Tony Cattlin Newbie

      JBPM 6.3.0

      Wildfly 8.1.0 Standalone


      I hope someone out there can help me out. I have been tearing my hair out for a few days now on this one...


      I am writing a jbpm console and want to get a list of tasks assigned to a user. Once I have the task service I will be off and running but I am getting the error below when running the code to create the EntityManagerFactory. All deploys fine and I see the hibernate introspection of JBPM tables (if I had the JNDI name wrong this wouldn't work, right ?).


      - I have the Datasource configured in Wildfly as can be seen in Standalone.xml and the Wildfly admin console

      - I have the Datasource referenced in Persistence.xml

      - Do I need to do something else ?


      Any help very much appreciated.




      Snippets below:



      public TaskService getTaskService() {

      org.kie.api.runtime.manager.RuntimeEnvironmentBuilder builder = RuntimeEnvironmentBuilder.Factory.get().newDefaultBuilder().entityManagerFactory(Persistence.createEntityManagerFactory("com.mypackage.persistence.jpa")).persistence(true);


      RuntimeManagerFactory mf = RuntimeManagerFactory.Factory.get();

      RuntimeManager runtimeManager = mf.newSingletonRuntimeManager(builder.get());

      return runtimeManager.getRuntimeEngine(EmptyContext.get()).getTaskService();





      <persistence-unit name="com.mypackage.persistence.jpa" transaction-type="JTA"> 








      <datasource jta="true" jndi-name="java:jboss/datasources/jbpmDS" pool-name="H2DS" enabled="true" use-java-context="true" use-ccm="true">










      2016-02-04 08:59:24,175 INFO  [org.hibernate.jpa.internal.util.LogHelper] (default task-1) HHH000204: Processing PersistenceUnitInfo [name: com.mypackage.persistence.jpa
      2016-02-04 08:59:24,261 ERROR [stderr] (default task-1) javax.persistence.PersistenceException: Unable to build entity manager factory

      2016-02-04 08:59:24,269 ERROR [stderr] (default task-1)  at org.hibernate.jpa.HibernatePersistenceProvider.createEntityManagerFactory(HibernatePersistenceProvider.java:83)

      2016-02-04 08:59:24,285 ERROR [stderr] (default task-1)  at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:55)

      2016-02-04 08:59:24,293 ERROR [stderr] (default task-1)  at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:39)


      Caused by: org.hibernate.engine.jndi.JndiException: Unable to lookup JNDI name [java:jboss/datasources/jbpmDS]


      Caused by: javax.naming.NameNotFoundException: unable to find a bound object at name 'java:jboss/datasources/jbpmDS'