我创建了一个jBPM项目,选择添加一个包含Human Tasks管理的默认示例。改变了方法JBPMHelper.startTaskService();通过这些说明
EntityManagerFactory emf = Persistence.createEntityManagerFactory("org.jbpm.task");
TaskService taskService = new TaskService(emf,`enter code here `SystemEventListenerFactory.getSystemEventListener());
MinaTaskServer server = new MinaTaskServer( taskService );
Thread thread = new Thread( server );
thread.start();
but when i try to excecute 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 it dosn't complete
start.human.task:
[javac] C:\jbpm-5.2.0.Final-installer-full\jbpm-installer\build.xml:647: war
ning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; se
t to false for repeatable builds
[java] Task service registered usergroup callback ...
[java] Task service started correctly!
[java] Task service running ...
答案 0 :(得分:1)
使用安装程序启动任务服务似乎工作正常(当您看起来“正在运行任务服务...”时,它正确启动)。请注意,这是在命令中运行的普通Java进程,因此它不会返回,它将保持活动状态,并在该控制台中显示日志信息。关闭命令提示符(或按Ctrl-C)将终止任务服务。从jBPM 5.2开始,您还可以使用可以部署到应用程序服务器的war来在服务器上作为服务运行任务服务。
关于您遇到的其他错误,您似乎缺少持久性配置文件中的“hibernate.dialect”属性。您是否只是尝试执行生成的样本,或者您是否修改了它(如果是,为什么/如何)?
克里斯
答案 1 :(得分:0)
有时当我使用ant start.demo命令启动服务器时,部署失败。您可以检查战争文件是否在dir中正确部署:jboss-as-7.0.2.Final \ standalone \ deployments。例如,如果部署了jbpm控制台,则应该具有以下部署文件:jbpm-gwt-console.war.deployed。有时服务器无法部署其中一个。在这种情况下,只需删除失败的部署文件,然后重新开始。在大多数情况下,问题已经解决了。
Hunor