I created a jBPM project choosing to add a default example which includes Human Tasks management. I changed the method JBPMHelper.startTaskService()
by these instructions:
EntityManagerFactory emf = Persistence.createEntityManagerFactory("org.jbpm.task");
TaskService taskService = new TaskService(emf,SystemEventListenerFactory.getSystemEventListener());
MinaTaskServer server = new MinaTaskServer( taskService );
Thread thread = new Thread( server );
thread.start();
But when I try to execute this simple example I get this error
Exception in thread "main" javax.persistence.PersistenceException: [PersistenceUnit: org.jbpm.task] Unable to build EntityManagerFactory
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:677)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:126)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:52)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:34)
at com.sample.ProcessMain.main(ProcessMain.java:24)
Caused by: org.hibernate.HibernateException: 'hibernate.dialect' must be set when no Connection avalable
at org.hibernate.dialect.resolver.DialectFactory.buildDialect(DialectFactory.java:107)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:134)
at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2119)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2115)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1339)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669)
Knowing that when I type ant start.demo
I get all the tools (jboss 7, eclipse, h2) but the human task not start. The message in the console is that it is not completed
start.human.task:
[javac] C:\jbpm-5.2.0.Final-installer-full\jbpm-installer\build.xml:647:
warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last;
set to false for repeatable builds
[java] Task service registered usergroup callback ...
[java] Task service started correctly!
[java] Task service running ...