java - 在 Java 的 AS7(和 JBPM 6.2)中使用的正确事务管理器是什么?

标签 java mysql jbpm bitronix

我希望有人能在我花几个小时试图弄清楚之前回答这个问题!

我正在使用 PoolingDataSource 类来实例化我的事务管理器。但是,我并没有取得太大的成功。

MySQL 是我的默认数据库。我正在使用:

 PoolingDataSource ds = new PoolingDataSource();

   ds.setUniqueName("java:jboss/datasources/jbpmDS");
   ds.setClassName("bitronix.tm.resource.jdbc.lrc.LrcXADataSource");
  ds.setMaxPoolSize(3);
  ds.setAllowLocalTransactions(true);
  ds.getDriverProperties().put("user", "root");
  ds.getDriverProperties().put("password", "rootpass");
  ds.getDriverProperties().put("URL", "jdbc:mysql://localhost:3306/jbpm6");
  ds.getDriverProperties().put("driverClassName", "com.mysql.Driver");

  ds.init();
当我运行代码时,我得到了这个:
bitronix.tm.resource.ResourceConfigurationException: cannot create JDBC datasource named java:jboss/datasources/jbpmDS
  at bitronix.tm.resource.jdbc.PoolingDataSource.init(PoolingDataSource.java:92)
  at com.sample.ProcessTest.testProcess(ProcessTest.java:67)
  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.InvokeMethod.evaluate(InvokeMethod.java:17)
  at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
  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)
Caused by: bitronix.tm.utils.PropertyException: no writeable property 'URL' in class 'bitronix.tm.resource.jdbc.lrc.LrcXADataSource'
  at bitronix.tm.utils.PropertyUtils.getSetter(PropertyUtils.java:318)
  at bitronix.tm.utils.PropertyUtils.setDirectProperty(PropertyUtils.java:217)
  at bitronix.tm.utils.PropertyUtils.setProperty(PropertyUtils.java:83)
  at bitronix.tm.resource.common.XAPool.createXAFactory(XAPool.java:304)
  at bitronix.tm.resource.common.XAPool.<init>(XAPool.java:63)
  at bitronix.tm.resource.jdbc.PoolingDataSource.buildXAPool(PoolingDataSource.java:101)
  at bitronix.tm.r esource.jdbc.PoolingDataSource.init(PoolingDataSource.java:88)
  ... 26 more

最佳答案

Caused by: bitronix.tm.utils.PropertyException: no writeable property 'URL' ...



这是因为正确的属性名称是“url”(小写)

关于java - 在 Java 的 AS7(和 JBPM 6.2)中使用的正确事务管理器是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29707678/

相关文章:

linux - 错误 : Creating directories for/. niogit/system.git 在 Wildfly-8.1.0.Final 上部署 jbpm-console.war 失败

java - 将 groupId 值包装在 Maven 依赖规范中

java - 在运行时创建的引用对象

MySQL 将自定义格式的日期与现在进行比较

MySQL 非常长的查询

oracle - Tomcat 6 上的配置 Realm ,Oracle 11g 异常

java - Gradle fat jar 不包含库

java - 调度问题的现有算法?

php - 如何将当前记录移动到另一个表并删除当前记录

java - JBPM 到 Drools Flow - 是否有记录的迁移路径?