0 Replies Latest reply on Mar 1, 2006 4:56 PM by Johan Hedin

    Need help with JBoss-4.0.4RC1, EJB3-RC5 and jBPM 3.1

    Johan Hedin Newbie

      We need help with getting jBPM 3.1 to start on JBoss-4.0.4RC1 with EJB3-RC5 added as described in the installation docs. The jBPM code will be run mostly from within EJBs, and hence, CMT is what we want to use. The startup is done in a UserTransaction. We can't get the schema updates to work, and thereby, we do not know if rest of the code works. It did work on JBoss 3.0.3 with jBPM 3.0.2. We're using Sun JDK 1.5.0_06 on Gentoo Linux on x86.

      22:41:36,485 INFO [HbmBinder] Mapping collection: org.jbpm.taskmgmt.def.TaskMgmtDefinition.tasks -> JBPM_TASK
      22:41:36,597 INFO [NamingHelper] JNDI InitialContext properties:{}
      22:41:36,598 INFO [DatasourceConnectionProvider] Using datasource: java:/DefaultDS
      22:41:36,599 INFO [SettingsFactory] RDBMS: MySQL, version: 4.1.14-log
      22:41:36,600 INFO [SettingsFactory] JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-3.1.12 ( $Date: 2005-11-17 15:53:48 +0100 (Thu, 17 Nov 2005) $, $Revision$ )
      22:41:36,631 INFO [Dialect] Using dialect: org.hibernate.dialect.MySQLInnoDBDialect
      22:41:36,641 INFO [TransactionFactoryFactory] Transaction strategy: org.hibernate.transaction.CMTTransactionFactory
      22:41:36,646 INFO [TransactionManagerLookupFactory] instantiating TransactionManagerLookup: org.hibernate.transaction.JBossTransactionManagerLookup
      22:41:36,664 INFO [TransactionManagerLookupFactory] instantiated TransactionManagerLookup
      22:41:36,665 INFO [SettingsFactory] Automatic flush during beforeCompletion(): enabled
      22:41:36,665 INFO [SettingsFactory] Automatic session close at end of transaction: disabled
      22:41:36,665 INFO [SettingsFactory] JDBC batch size: 15
      22:41:36,665 INFO [SettingsFactory] JDBC batch updates for versioned data: disabled
      22:41:36,666 INFO [SettingsFactory] Scrollable result sets: enabled
      22:41:36,666 INFO [SettingsFactory] JDBC3 getGeneratedKeys(): enabled
      22:41:36,666 INFO [SettingsFactory] Connection release mode: after_statement
      22:41:36,668 INFO [SettingsFactory] Maximum outer join fetch depth: 2
      22:41:36,668 INFO [SettingsFactory] Default batch fetch size: 1
      22:41:36,668 INFO [SettingsFactory] Generate SQL with comments: disabled
      22:41:36,668 INFO [SettingsFactory] Order SQL updates by primary key: disabled
      22:41:36,668 INFO [SettingsFactory] Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
      22:41:36,673 INFO [ASTQueryTranslatorFactory] Using ASTQueryTranslatorFactory
      22:41:36,673 INFO [SettingsFactory] Query language substitutions: {}
      22:41:36,674 INFO [SettingsFactory] Second-level cache: enabled
      22:41:36,674 INFO [SettingsFactory] Query cache: disabled
      22:41:36,674 INFO [SettingsFactory] Cache provider: org.hibernate.cache.HashtableCacheProvider
      22:41:36,676 INFO [SettingsFactory] Optimize cache for minimal puts: disabled
      22:41:36,676 INFO [SettingsFactory] Structured second-level cache entries: disabled
      22:41:36,686 INFO [SettingsFactory] Statistics: disabled
      22:41:36,686 INFO [SettingsFactory] Deleted entity synthetic identifier rollback: disabled
      22:41:36,686 INFO [SettingsFactory] Default entity-mode: pojo
      22:41:36,739 INFO [SessionFactoryImpl] building session factory
      22:41:39,934 INFO [SessionFactoryObjectFactory] Not binding factory to JNDI, no JNDI name configured
      22:41:39,939 INFO [SchemaUpdate] Running hbm2ddl schema update
      22:41:39,939 INFO [SchemaUpdate] fetching database metadata
      22:41:39,940 ERROR [SchemaUpdate] could not get database metadata
      java.sql.SQLException: You cannot commit during a managed transaction!
       at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.jdbcCommit(BaseWrapperManagedConnection.java:496)
       at org.jboss.resource.adapter.jdbc.WrappedConnection.commit(WrappedConnection.java:334)
       at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:129)
       at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:295)
       at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1176)
       at org.jbpm.persistence.db.DbPersistenceServiceFactory.getSessionFactory(DbPersistenceServiceFactory.java:90)
       at org.jbpm.persistence.db.DbPersistenceService.getSessionFactory(DbPersistenceService.java:74)
       at org.jbpm.persistence.db.DbPersistenceService.getSession(DbPersistenceService.java:78)
       at org.jbpm.persistence.db.DbPersistenceService.getGraphSession(DbPersistenceService.java:216)
       at org.jbpm.JbpmContext.getGraphSession(JbpmContext.java:427)
       at org.jbpm.JbpmContext.deployProcessDefinition(JbpmContext.java:166)
       at se.ecare.common.gop.ProcessModel.deployProcess(ProcessModel.java:230)
       at se.ecare.common.gop.ProcessModel.deployProcesses(ProcessModel.java:173)
       at se.ecare.weblogger.gop.ProcessModel.deployProcesses(ProcessModel.java:77)
       at se.ecare.weblogger.core.WebloggerCoreService.start(WebloggerCoreService.java:83)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:260)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:991)
       at $Proxy0.start(Unknown Source)
       at org.jboss.system.ServiceController.start(ServiceController.java:417)
       at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:260)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:190)
       at $Proxy4.start(Unknown Source)
       at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1007)
       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:997)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:808)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771)
       at sun.reflect.GeneratedMethodAccessor42.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:260)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:190)
       at $Proxy8.deploy(Unknown Source)
       at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:334)
       at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:522)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:207)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:280)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
       at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:260)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:974)
       at $Proxy0.start(Unknown Source)
       at org.jboss.system.ServiceController.start(ServiceController.java:417)
       at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:260)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:190)
       at $Proxy4.start(Unknown Source)
       at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1007)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:808)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:755)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:260)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:190)
       at $Proxy5.deploy(Unknown Source)
       at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:477)
       at org.jboss.system.server.ServerImpl.start(ServerImpl.java:357)
       at org.jboss.Main.boot(Main.java:200)
       at org.jboss.Main$1.run(Main.java:464)
       at java.lang.Thread.run(Thread.java:595)
      22:41:39,974 ERROR [SchemaUpdate] could not complete schema update
      java.sql.SQLException: You cannot commit during a managed transaction!
       at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.jdbcCommit(BaseWrapperManagedConnection.java:496)
       at org.jboss.resource.adapter.jdbc.WrappedConnection.commit(WrappedConnection.java:334)
       at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:129)
       at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:295)
       at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1176)
       at org.jbpm.persistence.db.DbPersistenceServiceFactory.getSessionFactory(DbPersistenceServiceFactory.java:90)
       at org.jbpm.persistence.db.DbPersistenceService.getSessionFactory(DbPersistenceService.java:74)
       at org.jbpm.persistence.db.DbPersistenceService.getSession(DbPersistenceService.java:78)
       at org.jbpm.persistence.db.DbPersistenceService.getGraphSession(DbPersistenceService.java:216)
       at org.jbpm.JbpmContext.getGraphSession(JbpmContext.java:427)
       at org.jbpm.JbpmContext.deployProcessDefinition(JbpmContext.java:166)
       at se.ecare.common.gop.ProcessModel.deployProcess(ProcessModel.java:230)
      


      The jbpm.cfg.xml
      <jbpm-configuration>
      
       <jbpm-context>
       <service name="persistence">
       <factory>
       <bean class="org.jbpm.persistence.db.DbPersistenceServiceFactory">
       <field name="isTransactionEnabled"><boolean value="false"/></field>
       </bean>
       </factory>
       </service>
      
       <service name="message" factory="org.jbpm.msg.db.DbMessageServiceFactory"/>
       <service name="scheduler" factory="org.jbpm.scheduler.db.DbSchedulerServiceFactory"/>
       <service name="logging" factory="org.jbpm.logging.db.DbLoggingServiceFactory"/>
       <service name="authentication" factory="org.jbpm.security.authentication.DefaultAuthenticationServiceFactory"/>
       </jbpm-context>
      
       <!-- configuration resource files pointing to default configuration files in jbpm-{version}.jar -->
       <string name="resource.hibernate.cfg.xml" value="hibernate.cfg.xml"/>
       <!-- <string name="resource.hibernate.properties" value="hibernate.properties" /> -->
       <string name="resource.business.calendar" value="org/jbpm/calendar/jbpm.business.calendar.properties"/>
       <string name="resource.default.modules" value="org/jbpm/graph/def/jbpm.default.modules.properties"/>
       <string name="resource.converter" value="org/jbpm/db/hibernate/jbpm.converter.properties"/>
       <string name="resource.action.types" value="org/jbpm/graph/action/action.types.xml"/>
       <string name="resource.node.types" value="org/jbpm/graph/node/node.types.xml"/>
       <string name="resource.parsers" value="org/jbpm/jpdl/par/jbpm.parsers.xml"/>
       <string name="resource.varmapping" value="org/jbpm/context/exe/jbpm.varmapping.xml"/>
      
       <bean name="jbpm.task.instance.factory" class="org.jbpm.taskmgmt.impl.DefaultTaskInstanceFactoryImpl"
       singleton="true"/>
       <bean name="jbpm.variable.resolver" class="org.jbpm.jpdl.el.impl.JbpmVariableResolver" singleton="true"/>
       <long name="jbpm.msg.wait.timout" value="5000" singleton="true"/>
      
      </jbpm-configuration>
      


      The file hibernate.cfg.xml
      <?xml version='1.0' encoding='utf-8'?>
      
      <!DOCTYPE hibernate-configuration PUBLIC
       "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
       "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
      
      <hibernate-configuration>
       <session-factory>
      
       <!-- jdbc connection properties -->
       <property name="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>
       <property name="hibernate.connection.datasource">java:/DefaultDS</property>
       <!--
       <property name="hibernate.transaction.manager_lookup_class">
       org.hibernate.transaction.JBossTransactionManagerLookup</property>
       -->
       <property name="hibernate.transaction.factory_class">org.hibernate.transaction.CMTTransactionFactory</property>
       <property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</property>
       <property name="hibernate.connection.release_mode">after_statement</property>
       <property name="hibernate.transaction.flush_before_completion">true</property>
       <property name="hibernate.transaction.auto_close_session">false</property>
       <property name="hibernate.query.factory_class">org.hibernate.hql.ast.ASTQueryTranslatorFactory</property>
      
       <property name="hibernate.hbm2ddl.auto">update</property>
       <property name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
       <!--property name="hibernate.jndi.java.naming.factory.initial">org.jnp.interfaces.NamingContextFactory</property>
       <property name="hibernate.jndi.java.naming.factory.url.pkgs">org.jboss.naming:org.jnp.interfaces</property-->
      
       <!-- other hibernate properties
       <property name="hibernate.show_sql">true</property>
       <property name="hibernate.format_sql">true</property>
       -->
      
      Default config below...