1 Reply Latest reply on May 4, 2006 1:33 PM by Alejandro Guizar

    MSSQL Server 2000 + jbpm-BPEL: Contraints violation deployin

    njipwo Bertrand Newbie

      Hi @all,

      i'm facing the following problem wenn i'm deploy the bpel-process-definition to jBoss.

      First my configuration:

      JBoss AS 4.0.3 SP1
      MS SQL Server 2000 + SP4
      jbpm-bpel-1.0-alpha4
      jbpm-3.0.2
      (Seems to not need)

      I have all successfully
      1- execute "ant build.service.403" (Build successful)
      2- deploy the jbpm-bpel.sar to jboss (successful)
      3- alter the build.properties from the hello example directory
      4- execute "ant create-schema" (Build seems successful)
      5- execute "ant pack-definition" (Build successful)
      9- execute "ant deploy-definition" (Head deack).

      Now to my Problem wenn i try to deploy the packed process-definition to Jboss i become the following error:

      12:24:38,736 WARN [EhCacheProvider] Could not find configuration [org.jbpm.bpel.exe.Fault]; using defaults.
      12:24:38,816 WARN [EhCacheProvider] Could not find configuration [org.jbpm.bpel.service.exe.CorrelationSetInstance]; using defaults.
      12:24:38,816 WARN [EhCacheProvider] Could not find configuration [org.jbpm.bpel.service.def.CorrelationSetDefinition]; using defaults.
      12:24:41,079 INFO [SessionFactoryObjectFactory] Not binding factory to JNDI, no JNDI name configured
      12:24:44,674 INFO [SessionFactoryImpl] Checking 0 named queries
      12:24:44,674 INFO [JbpmService] binding JbpmSessionFactory 'java:/jbpm/BpelSessionFactory' into JNDI...
      12:24:44,684 INFO [TomcatDeployer] deploy, ctxPath=/jbpm-bpel, warUrl=.../tmp/deploy/tmp11622jbpm-bpel.sar-contents/jbpm-bpel-exp.war/
      12:25:05,813 INFO [Dialect] Using dialect: org.hibernate.dialect.SQLServerDialect
      12:25:05,823 INFO [Configuration] processing extends queue
      12:25:05,823 INFO [Configuration] processing collection mappings
      12:25:05,823 INFO [Configuration] processing association property references
      12:25:05,823 INFO [Configuration] processing foreign key constraints
      12:25:05,823 INFO [Configuration] processing extends queue
      12:25:05,823 INFO [Configuration] processing collection mappings
      12:25:05,823 INFO [Configuration] processing association property references
      12:25:05,823 INFO [Configuration] processing foreign key constraints
      12:25:05,863 INFO [SchemaExport] Running hbm2ddl schema export
      12:25:05,873 INFO [SchemaExport] exporting generated schema to database
      12:25:05,873 INFO [NamingHelper] JNDI InitialContext properties:{}
      12:25:05,873 INFO [DatasourceConnectionProvider] Using datasource: java:/JbpmBpelDS
      12:25:06,594 INFO [SchemaExport] schema export complete
      12:25:06,604 WARN [JDBCExceptionReporter] SQL Warning: 0, SQLState:
      12:25:06,604 WARN [JDBCExceptionReporter] [Microsoft][SQLServer 2000 Driver for JDBC]Database changed to jbpm1
      12:25:06,604 WARN [JDBCExceptionReporter] SQL Warning: 5701, SQLState: 01000
      12:25:06,604 WARN [JDBCExceptionReporter] [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Der Datenbankkontext wurde auf 'jbpm1' geõndert.
      12:25:06,604 WARN [JDBCExceptionReporter] SQL Warning: 0, SQLState:
      12:25:06,604 WARN [JDBCExceptionReporter] [Microsoft][SQLServer 2000 Driver for JDBC]Language changed to Deutsch
      12:25:06,604 WARN [JDBCExceptionReporter] SQL Warning: 5703, SQLState: 01000
      12:25:06,604 WARN [JDBCExceptionReporter] [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Die Spracheneinstellung wurde auf Deutsch geõndert.
      12:25:06,614 INFO [[/jbpm-bpel]] DBSchemaServlet: completed database schema operation: create
      12:51:08,210 INFO [[/jbpm-bpel]] DeployServlet: deploying process archive: file:/C:/OrdnerHyrarchie/MyCourses/Diplomarbeit/KOM/jBPM/Engine/jbpm-bpel-1.0-alpha4/doc/examples/hello/build/hello-definition.par
      12:51:08,891 INFO [BpelReader] read wsdl definitions: hello.wsdl
      12:51:08,991 INFO [BpelReader] read bpel process: hello.bpel
      12:51:10,142 WARN [JDBCExceptionReporter] SQL Error: 2627, SQLState: 23000
      12:51:10,142 ERROR [JDBCExceptionReporter] [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Verletzung der UNIQUE KEY-Einschrõnkung 'UQ__JBPM_NODE__4C2C2D6D'. Ein doppelter Schl³ssel kann in das JBPM_NODE-Objekt nicht eingef³gt werden.
      ------------------------ Means primary key constrains violation .........
      
      12:51:10,142 WARN [JDBCExceptionReporter] SQL Error: 3621, SQLState: HY000
      12:51:10,142 ERROR [JDBCExceptionReporter] [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Die Anweisung wurde beendet.
      12:51:10,142 ERROR [GraphSession] org.hibernate.exception.ConstraintViolationException: could not insert: [org.jbpm.bpel.def.Sequence]
      12:51:10,192 WARN [JDBCExceptionReporter] SQL Warning: 0, SQLState:
      12:51:10,192 WARN [JDBCExceptionReporter] [Microsoft][SQLServer 2000 Driver for JDBC]Database changed to jbpm1
      12:51:10,192 WARN [JDBCExceptionReporter] SQL Warning: 5701, SQLState: 01000
      12:51:10,192 WARN [JDBCExceptionReporter] [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Der Datenbankkontext wurde auf 'jbpm1' geõndert.
      12:51:10,192 WARN [JDBCExceptionReporter] SQL Warning: 0, SQLState:
      12:51:10,192 WARN [JDBCExceptionReporter] [Microsoft][SQLServer 2000 Driver for JDBC]Language changed to Deutsch
      12:51:10,192 WARN [JDBCExceptionReporter] SQL Warning: 5703, SQLState: 01000
      12:51:10,192 WARN [JDBCExceptionReporter] [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Die Spracheneinstellung wurde auf Deutsch geõndert.
      12:51:10,192 WARN [JbpmSession] can't pop current session: are you calling Jbpm
      Session.close() multiple times ?
      12:51:10,192 ERROR [[DeployServlet]] Servlet.service() for servlet DeployServlet threw exceptionjava.lang.RuntimeException: couldn't save process definition 'BpelDefinition(helloWorld)'
       at org.jbpm.db.GraphSession.saveProcessDefinition(GraphSession.java:35)
       at org.jbpm.jpdl.par.ProcessArchiveDeployer.deployProcessDefinition(ProcessArchiveDeployer.java:77)
       at org.jbpm.jpdl.par.ProcessArchiveDeployer.deployProcessDefinition(ProcessArchiveDeployer.java:51)
       at org.jbpm.bpel.web.deploy.DeployServlet.doGet(DeployServlet.java:48)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
       at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
       at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
       at java.lang.Thread.run(Thread.java:595)
      Caused by: org.hibernate.exception.ConstraintViolationException: could not insert: [org.jbpm.bpel.def.Sequence]
       at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:69)
       at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
       at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:1985)
       at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2404)
       at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:37)
       at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:243)
       at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:269)
       at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:167)
       at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:101)
       at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:186)
       at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:175)
       at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:98)
       at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
       at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:501)
      
       at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:495)
       at org.hibernate.engine.CascadingAction$1.cascade(CascadingAction.java:134)
       at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:213)
       at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:157)
       at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:108)
       at org.hibernate.engine.Cascade.cascade(Cascade.java:248)
       at org.hibernate.event.def.AbstractSaveEventListener.cascadeAfterSave(AbstractSaveEventListener.java:409)
       at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:298)
       at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:167)
       at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:101)
       at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:186)
       at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:175)
       at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:98)
       at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
       at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:501)
      
       at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:495)
       at org.hibernate.engine.CascadingAction$1.cascade(CascadingAction.java:134)
       at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:213)
       at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:157)
       at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:108)
       at org.hibernate.engine.Cascade.cascadeCollectionElements(Cascade.java:290)
       at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java:185)
       at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:160)
       at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:108)
       at org.hibernate.engine.Cascade.cascade(Cascade.java:248)
       at org.hibernate.event.def.AbstractSaveEventListener.cascadeAfterSave(AbstractSaveEventListener.java:409)
       at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:298)
       at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:167)
       at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:101)
       at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:186)
       at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33)
       at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:175)
       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:524)
       at org.hibernate.impl.SessionImpl.save(SessionImpl.java:514)
       at org.hibernate.impl.SessionImpl.save(SessionImpl.java:510)
       at org.jbpm.db.GraphSession.saveProcessDefinition(GraphSession.java:31)
       ... 24 more
      Caused by: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Verletzung der UNIQUE KEY-Einschrõnkung 'UQ__JBPM_NODE__4C2C2D6D'. Ein doppelter Schl³ssel kann in das JBPM_NODE-Objekt nicht eingef³gt werden.
       at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
       at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
       at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processErrorToken(Unknown Source)
       at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReplyToken(Unknown Source)
       at com.microsoft.jdbc.sqlserver.tds.TDSRPCRequest.processReplyToken(Unknown Source)
       at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReply(Unknown Source)
       at com.microsoft.jdbc.sqlserver.SQLServerImplStatement.getNextResultType(Unknown Source)
       at com.microsoft.jdbc.base.BaseStatement.commonTransitionToState(Unknown Source)
       at com.microsoft.jdbc.base.BaseStatement.postImplExecute(Unknown Source)
      
       at com.microsoft.jdbc.base.BasePreparedStatement.postImplExecute(Unknown Source)
       at com.microsoft.jdbc.base.BaseStatement.commonExecute(Unknown Source)
       at com.microsoft.jdbc.base.BaseStatement.executeInternal(Unknown Source)
      
       at com.microsoft.jdbc.base.BasePreparedStatement.execute(Unknown Source)
      
       at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.execute(WrappedPreparedStatement.java:183)
       at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:1952)
       ... 73 more
      
      .

      After running create-schema with ant i got the following warning:

      Ant says:
      C:\OrdnerHyrarchie\MyCourses\Diplomarbeit\KOM\jBPM\Engine\jbpm-bpel-1.0-alpha4\doc\examples\hello>ant -f build.xml create-schema
      Buildfile: build.xml
      
      create-schema:
      [webdbschema] db schema url: http://localhost:8080/jbpm-bpel/dbschema?operation=create
      [webdbschema] got response code: 200
      
      BUILD SUCCESSFUL
      Total time: 2 seconds
      
      Jboss says:
      
      12:25:05,823 INFO [Configuration] processing extends queue
      12:25:05,823 INFO [Configuration] processing collection mappings
      12:25:05,823 INFO [Configuration] processing association property references
      12:25:05,823 INFO [Configuration] processing foreign key constraints
      12:25:05,823 INFO [Configuration] processing extends queue
      12:25:05,823 INFO [Configuration] processing collection mappings
      12:25:05,823 INFO [Configuration] processing association property references
      12:25:05,823 INFO [Configuration] processing foreign key constraints
      12:25:05,863 INFO [SchemaExport] Running hbm2ddl schema export
      12:25:05,873 INFO [SchemaExport] exporting generated schema to database
      12:25:05,873 INFO [NamingHelper] JNDI InitialContext properties:{}
      12:25:05,873 INFO [DatasourceConnectionProvider] Using datasource: java:/JbpmBpelDS
      12:25:06,594 INFO [SchemaExport] schema export complete
      12:25:06,604 WARN [JDBCExceptionReporter] SQL Warning: 0, SQLState:
      12:25:06,604 WARN [JDBCExceptionReporter] [Microsoft][SQLServer 2000 Driver for JDBC]Database changed to jbpm1
      
      ------------------------------------------------------------------Warnung -----------------------------------------------------------------------------------------------------
      
      --------------------------------------->12:25:06,604 WARN [JDBCExceptionReporter] SQL Warning: 5701, SQLState: 01000<----------------------------------------------
      
      ------------------------------------------------------------------Warnung -----------------------------------------------------------------------------------------------------
      
      12:25:06,604 WARN [JDBCExceptionReporter] [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Der Datenbankkontext wurde auf 'jbpm1' geõndert.
      12:25:06,604 WARN [JDBCExceptionReporter] SQL Warning: 0, SQLState:
      12:25:06,604 WARN [JDBCExceptionReporter] [Microsoft][SQLServer 2000 Driver for JDBC]Language changed to Deutsch
      12:25:06,604 WARN [JDBCExceptionReporter] SQL Warning: 5703, SQLState: 01000
      12:25:06,604 WARN [JDBCExceptionReporter] [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Die Spracheneinstellung wurde auf Deutsch geõndert.
      12:25:06,614 INFO [[/jbpm-bpel]] DBSchemaServlet: completed database schema operation: create
      


      In my respository ({$JBPM-BPEL}/src/resources/jbpm-bpel.sar/) my configuration are for:


      hibernante.property:

      hibernate.dialect=org.hibernate.dialect.SQLServerDialect
      hibernate.connection.datasource=java:/JbpmBpelDS


      jbpm-bpel-ds:


      <datasources>
       <local-tx-datasource>
       <jndi-name>JbpmBpelDS</jndi-name>
       <!--jndi-name>MSSQL2000DS</jndi-name-->
       <connection-url>jdbc:microsoft:sqlserver://localhost:1433;SelectMethod=cursor;DatabaseName=jbpm1</connection-url>
       <driver-class>com.microsoft.jdbc.sqlserver.SQLServerDriver</driver-class>
       <!--connection-url>jdbc:jtds:sqlserver://localhost:1433;SelectMethod=cursor;DatabaseName=jbpm</connection-url>
       <driver-class>net.sourceforge.jtds.jdbc.Driver</driver-class-->
       <user-name>jbpm1user</user-name>
       <password>jbpm1user</password>
      
       <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
       <metadata>
       <type-mapping>MS SQLSERVER2000</type-mapping>
       </metadata>
       </local-tx-datasource>
      
      </datasources>
      .

      I have already lost much time to configure jBoss. I have started with the jboss configuration starterkit-3.1 where every thing goes fine till the "WSCOMPILE" and i found out i need to switch to JBoss AS 4.0.3.

      Could some one have an idea what's wrong in my configuration to solve this constrains violation on primary key.

      NB:

      1)- I found out "Google" this problem could be related to an old version of MS SQL server 2000. In my configuration i have allready install the SP4 and therefore this solution can be excluded.

      2)- In my respository {JBOSS_HOME}/server/default/deploy i have just deployed (copy) the jbpm-bpel.sar file there and don't need (think, hope, :) ) to deploy there some datasource file (JbpmBpel-ds.xml). And if i did it and jboss told me that the deployed jbpmBpel datasource is allready in use.

      I hope some one has encountered the same problem like me and give feedback.

      Thanks for your contribution


      Bests Regards


      Bertrand Njipwo

        • 1. Re: MSSQL Server 2000 + jbpm-BPEL: Contraints violation depl
          Alejandro Guizar Master

          For some reason SQL Server is always problematic. Let's proceed in the following way.

          When any problem happens before you even get to run a process, wipe out the database and the JMS queues. You are dealing with stateful components here, and stale data is a real problem.
          Old Microsoft SQL Server drivers used to suck. The new ones are far better. Make sure you get the latest.
          The schema creation seems to run fine. I googled around for these 5701 and 5703 warnings and found the following information.
          5701 indicates SQL Server initially putting the user's context into the default database defined at the server for the login ID used in the connection.
          5703 indicates the language being used on the server
          None of them seems harmful. However, before proceeding, open your management console and verify that the jBPM BPEL tables have been created and they contain columns, just to be sure.
          Hot deployment does not seem to work well right now. When you change something in the configuration, you should bring JBoss down and apply your changes in the cold.
          The previous point does not apply to individual processes; you can freely bring them up and down on the flight.