4 Replies Latest reply on Nov 5, 2008 4:05 AM by Jan van de klok

    Problem with JBPM running on Oracle

    Jan van de klok Newbie

      Hi,
      I'm a newbie for JBPM so bear with me...

      We had JBPM 3.2.3 running on JBOSS app server using Hypersonic as db.
      We had cdeployed som processes, tested them with the jbpm-console and everything seemed to work fine.

      Then we replaced the hypersonic db by an Oracle 10g database.
      When starting the app server, all the tables are created. When starting the jbpm-console we can see our pdeployed process. So far so good.

      The problem starts when we want to start an instance of the deployed process :
      Then we get the followiong exception: .

      2008-10-31 15:46:08,370 DEBUG [org.hibernate.util.JDBCExceptionReporter] could not insert: [org.jbpm.graph.exe.Token] [insert into JBPM_TOKEN (ID_, VERSION_, NAME_, START_, END_, NODEENTER_, NEXTLOGINDEX_, ISABLETOREACTIVATEPARENT_, ISTERMINATIONIMPLICIT_, ISSUSPENDED_, LOCK_, NODE_, PROCESSINSTANCE_, PARENT_, SUBPROCESSINSTANCE_) values (null, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]
      java.sql.SQLException: ORA-01400: cannot insert NULL into ("JANVDKLOK"."JBPM_TOKEN"."ID_")

      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
      at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
      at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
      at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:745)
      at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:216)
      at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:966)
      at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1170)
      at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3339)
      at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3423)
      at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeUpdate(WrappedPreparedStatement.java:365)
      at org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.executeAndExtract(IdentityGenerator.java:73)
      at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:33)
      at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2158)
      at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2638)
      at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:48)
      at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:250)
      at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:298)
      at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:181)
      at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:107)
      at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:187)
      at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:172)
      at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:94)
      at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
      at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:507)
      at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:499)
      at org.hibernate.engine.CascadingAction$1.cascade(CascadingAction.java:218)
      at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:268)
      at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:216)
      at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:169)
      at org.hibernate.engine.Cascade.cascade(Cascade.java:130)
      at org.hibernate.event.def.AbstractSaveEventListener.cascadeBeforeSave(AbstractSaveEventListener.java:431)
      at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:265)
      at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:181)
      at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:107)
      at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:187)
      at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33)
      at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:172)
      at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27)
      at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
      at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:535)
      at org.hibernate.impl.SessionImpl.save(SessionImpl.java:523)
      at org.hibernate.impl.SessionImpl.save(SessionImpl.java:519)
      at org.jbpm.persistence.db.DbPersistenceService.assignId(DbPersistenceService.java:334)
      at org.jbpm.svc.Services.assignId(Services.java:261)
      at org.jbpm.graph.exe.ProcessInstance.(ProcessInstance.java:137)
      at org.jbpm.graph.exe.ProcessInstance.(ProcessInstance.java:92)
      at org.jbpm.graph.def.ProcessDefinition.createProcessInstance(ProcessDefinition.java:124)
      at org.jbpm.jsf.core.action.StartProcessActionListener.handleAction(StartProcessActionListener.java:51)
      at org.jbpm.jsf.core.impl.JbpmActionListenerWrapper.processAction(JbpmActionListenerWrapper.java:82)
      at javax.faces.event.ActionEvent.processListener(ActionEvent.java:88)
      at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:771)
      at javax.faces.component.UICommand.broadcast(UICommand.java:372)
      at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:475)
      at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:755)
      at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
      at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
      at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
      at java.lang.Thread.run(Thread.java:595)
      2008-10-31 15:46:08,370 WARN [org.hibernate.util.JDBCExceptionReporter] SQL Error: 1400, SQLState: 23000
      2008-10-31 15:46:08,370 ERROR [org.hibernate.util.JDBCExceptionReporter] ORA-01400: cannot insert NULL into ("JANVDKLOK"."JBPM_TOKEN"."ID_")

      200


      I have no clue what so evr whats causing this!! I need some hint desperately.....

      Can someone help me please......

      Your help will be greatly appreciated.

      Jan van de Klok

        • 1. Re: Problem with JBPM running on Oracle
          Osvaldo Pina Newbie


          Did you change the hibernate.dialect property in your hibernate.cfg.xml? If not, you should change it for your specific database (for example: org.hibernate.dialect.OracleDialect).


          • 2. Re: Problem with JBPM running on Oracle
            Ronald van Kuijk Master

             

            We had JBPM 3.2.3 running on JBOSS app server using Hypersonic as db.


            In production? I hope not

            And the most likely cause is indeed the hibernate dialect


            • 3. Re: Problem with JBPM running on Oracle
              Jan van de klok Newbie

              Thanks for the hint. I'll check it.

              • 4. Re: Problem with JBPM running on Oracle
                Jan van de klok Newbie

                Since the jboss seam console (jbpm-enterprise.ear) does not contain a hibernate.cfg.xml file, it is my assumption that seam/hibernate takes the dialect from the <type-mapping> in the jbpm-ds.xml which contains in my case :
                <type-mapping>Oracle9i</type-mapping>

                I can see in the log file that the oracle 10G dialect is used for datasource java:/JbpmDS :

                2008-11-05 08:18:58,128 INFO [org.hibernate.util.NamingHelper] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
                2008-11-05 08:18:58,128 INFO [org.hibernate.connection.DatasourceConnectionProvider] Using datasource: java:/JbpmDS
                2008-11-05 08:18:58,331 INFO [org.hibernate.cfg.SettingsFactory] RDBMS: Oracle, version: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
                With the Partitioning, OLAP and Data Mining options
                2008-11-05 08:18:58,331 INFO [org.hibernate.cfg.SettingsFactory] JDBC driver: Oracle JDBC driver, version: 10.2.0.4.0
                2008-11-05 08:18:58,347 INFO [org.hibernate.dialect.Dialect] Using dialect: org.hibernate.dialect.Oracle10gDialect
                2008-11-05 08:18:58,347 INFO [org.hibernate.transaction.TransactionFactoryFactory] Transaction strategy: org.hibernate.transaction.JTATransactionFactory
                )


                BUT ... then further in the log I see this:

                2008-11-05 08:20:16,184 DEBUG [org.jbpm.persistence.db.DbPersistenceServiceFactory] building hibernate session factory
                2008-11-05 08:20:16,184 DEBUG [org.jbpm.db.hibernate.HibernateHelper] creating hibernate configuration resource 'hibernate.cfg.xml'
                2008-11-05 08:20:16,184 INFO [org.hibernate.cfg.Configuration] configuring from resource: hibernate.cfg.xml
                2008-11-05 08:20:16,184 INFO [org.hibernate.cfg.Configuration] Configuration resource: hibernate.cfg.xml
                2008-11-05 08:20:16,184 DEBUG [org.hibernate.util.DTDEntityResolver] trying to resolve system-id [http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd]
                2008-11-05 08:20:16,184 DEBUG [org.hibernate.util.DTDEntityResolver] recognized hibernate namespace; attempting to resolve on classpath under org/hibernate/
                2008-11-05 08:20:16,184 DEBUG [org.hibernate.util.DTDEntityResolver] located [http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd] in classpath
                2008-11-05 08:20:16,184 DEBUG [org.hibernate.cfg.Configuration] hibernate.dialect=org.hibernate.dialect.HSQLDialect2008-11-05 08:20:16,184 DEBUG [org.hibernate.cfg.Configuration] hibernate.cache.provider_class=org.hibernate.cache.HashtableCacheProvider
                2008-11-05 08:20:16,184 DEBUG [org.hibernate.cfg.Configuration] hibernate.connection.datasource=java:comp/env/jdbc/JbpmDataSource

                Which raises my question:

                Is defining the jbpm datasource xml not enough for the jbpm-console to specify the database to use??? What more do we need to change / add???

                (We do have deployed an application build with seam in the same app.server that does contain a hibernate.cfg.xml but that one is pointing to a DB2 database (with a DB2Dialect))

                Any help would be appriciated!

                Jan