6 Replies Latest reply on Aug 2, 2010 2:39 AM by june20100606

    Why I can't run jbpm4.3 examples on oracle server?

    june20100606

      I was so much confused. I am only going to finish one demo using a process manager, fork two services, then join the two results. I chose jbpm4.3. But, up to now , I can't even  run the examples on oracle.

      First, I run "ant create.jbpm.schema", unsuccessful. I read the script, found varchar2(255 char) was not supported in oracle. So i rewrote the script. Schema was created. I could see them using oracle client.

      Second, I configured the file 'jbpm.hibernate.cfg.xml' , making jdbc to my oracle server, then run one example. Errors below:

      10:29:51,515 FIN | [BaseJbpmTestCase] === starting testAsyncActivity =============================
      10:29:52,625 FIN | [WireContext] eagerly initializing org.jbpm.pvm.internal.id.DatabaseIdComposer
      10:29:52,703 INF | [Environment] Hibernate 3.3.1.GA
      10:29:52,718 INF | [Environment] hibernate.properties not found
      10:29:52,718 INF | [Environment] Bytecode provider name : javassist
      10:29:52,734 INF | [Environment] using JDK 1.4 java.sql.Timestamp handling
      10:29:52,906 INF | [Configuration] configuring from resource: jbpm.hibernate.cfg.xml
      10:29:52,906 INF | [Configuration] Configuration resource: jbpm.hibernate.cfg.xml
      10:29:53,062 INF | [Configuration] Reading mappings from resource : jbpm.repository.hbm.xml
      10:29:53,593 INF | [Configuration] Reading mappings from resource : jbpm.execution.hbm.xml
      10:29:54,218 INF | [Configuration] Reading mappings from resource : jbpm.history.hbm.xml
      10:29:54,625 INF | [Configuration] Reading mappings from resource : jbpm.task.hbm.xml
      10:29:54,890 INF | [Configuration] Reading mappings from resource : jbpm.identity.hbm.xml
      10:29:55,093 INF | [Configuration] Configured SessionFactory: null
      10:29:55,187 INF | [DriverManagerConnectionProvider] Using Hibernate built-in connection pool (not for production use!)
      10:29:55,187 INF | [DriverManagerConnectionProvider] Hibernate connection pool size: 20
      10:29:55,187 INF | [DriverManagerConnectionProvider] autocommit mode: false
      10:29:55,406 INF | [DriverManagerConnectionProvider] using driver: oracle.jdbc.driver.OracleDriver at URL: jdbc:oracle:thin:@192.168.1.227:1521:jbpm

      10:29:55,421 INF | [DriverManagerConnectionProvider] connection properties: {user=jbpm, password=****}
      10:30:00,046 INF | [Dialect] Using dialect: org.hibernate.dialect.Oracle10gDialect
      10:30:00,062 INF | [TransactionFactoryFactory] Using default transaction strategy (direct JDBC transactions)
      10:30:00,078 INF | [TransactionManagerLookupFactory] No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
      10:30:00,125 INF | [ASTQueryTranslatorFactory] Using ASTQueryTranslatorFactory
      10:30:00,281 INF | [SessionFactoryImpl] building session factory
      10:30:04,296 INF | [SessionFactoryObjectFactory] Not binding factory to JNDI, no JNDI name configured
      10:30:04,343 INF | [SchemaExport] Running hbm2ddl schema export
      10:30:04,343 INF | [SchemaExport] exporting generated schema to database
      10:30:06,312 SEV | [SchemaExport] Unsuccessful: create table JBPM4_DEPLOYMENT (DBID_ number(19,0) not null, NAME_ clob, TIMESTAMP_ number(19,0), STATE_ varchar2(255 char), primary key (DBID_))
      10:30:06,312 SEV | [SchemaExport] ORA-00907: 缺少右括号

       

       

      Why the example drop the exitent schema and create new?Which java file does this operation?

       

      I could not see the schema using oracle client.

       

      I didn't learn about junit. Where can I find one java application using jbpm? Maybe I will learn the deploying process more clearly.

        • 1. Re: Why I can't run jbpm4.3 examples on oracle server?
          swiderski.maciej

          Hibernate for unit tests is configured to drop and create database to ensure its correctness. If you want to run it against real data base is not good idea to do it from unit test. I would recommend you to deploy them and then use console to execute them.

          If you really want to run them from unit test then you must remove/change following property in hibernate config file:

           

          <property name="hibernate.hbm2ddl.auto">create-drop</property>
          

           

          please take a look at already prepared configuration file in distribution package/install/src/cfg/hibernate/jdbc

           

          BTW, please use parent forum for this type of questions

          • 2. Re: Why I can't run jbpm4.3 examples on oracle server?
            june20100606

            Thank you!

            I will try a console application.  Where can I find console examples?

            • 3. Re: Why I can't run jbpm4.3 examples on oracle server?
              rebody

              Hi zhang,

               

              you could follow the installation chapter of user guide to install console and examples to your computer.http://docs.jboss.com/jbpm/v4/userguide/html_single/#installation

               

              And here is a chinese translation version : http://www.family168.com/tutorial/jbpm4.0/html/installation.html

              • 4. Re: Why I can't run jbpm4.3 examples on oracle server?
                june20100606

                I removed the  property in hibernate config file:

                 

                 

                <property name="hibernate.hbm2ddl.auto">create-drop</property>

                Then, the oracle server didn't drop and create new tables. However, some script (when I debuged the statement :

                deploymentId = repositoryService.createDeployment()
                        .addResourceFromClasspath("org/jbpm/examples/java/process.jpdl.xml")
                        .deploy();

                )still tried to update the table in oracle. Oracle error still took place.

                Another question, I run the examples on hsqldb-server. The statement below:

                ProcessInstance processInstance = executionService.startProcessInstanceByKey("Java", variables);

                I could not find out how the  processInstance executed by key "java".

                I wrote a console with the same statement. Came out an exception "no instance with key named 'java'".

                • 5. Re: Why I can't run jbpm4.3 examples on oracle server?
                  mwohlf

                  Hi zhang

                  I removed the  property in hibernate config file:

                  <property name="hibernate.hbm2ddl.auto">create-drop</property>

                  Then, the oracle server didn't drop and create new tables. However, some script (when I debuged the statement :

                  deploymentId = repositoryService.createDeployment()
                          .addResourceFromClasspath("org/jbpm/examples/java/process.jpdl.xml")
                          .deploy();

                  )still tried to update the table in oracle.

                  I am not sure what exactly you mean by "update the table"

                  • "update the content of a table" (update) is perfectly normal in this case since this statement is supposed to put a workflow definition into the database
                  • "update the structure of a database table" (alter table) shouldn't happen here, are you seeing this?

                   

                  Oracle error still took place.

                  can you show us the stacktrace please?

                   

                  Another question, I run the examples on hsqldb-server. The statement below:

                  ProcessInstance processInstance = executionService.startProcessInstanceByKey("Java", variables);

                  this should start a workflow with the name "Java" if you previously deployed such a workflow

                   

                  I could not find out how the  processInstance executed by key "java".

                  I wrote a console with the same statement. Came out an exception "no instance with key named 'java'".

                  make sure you deployed a workflow with the name "java", or is it "Java"?

                  • 6. Re: Why I can't run jbpm4.3 examples on oracle server?
                    june20100606

                    Below is a part of the stack trace. Script was going to update the content of the oracle table., but some fields can't be retrieved.

                    Has the script been tested on Oracle?

                    Where is the sql statement from?

                     

                    16:23:21,750 FIN | [SQL]
                        update
                            JBPM4_LOB
                        set
                            DEPLOYMENT_=?,
                            NAME_=?
                        where
                            DBID_=?
                    16:23:21,765 FST | [LongType] binding '1' to parameter: 1
                    16:23:21,765 FST | [TextType] binding 'org/jbpm/examples/java/process.jpdl.xml' to parameter: 2
                    16:23:21,765 FST | [LongType] binding '2' to parameter: 3
                    16:23:21,781 FIN | [SQL]
                    .............
                    16:23:22,140 FIN | [SQL]
                        select
                            resources0_.DEPLOYMENT_ as DEPLOYMENT4_1_,
                            resources0_.DBID_ as DBID1_1_,
                            resources0_.NAME_ as NAME5_1_,
                            resources0_.DBID_ as DBID1_5_0_,
                            resources0_.DBVERSION_ as DBVERSION2_5_0_,
                            resources0_.BLOB_VALUE_ as BLOB3_5_0_
                        from
                            JBPM4_LOB resources0_
                        where
                            resources0_.DEPLOYMENT_=?
                    16:23:22,140 FST | [LongType] binding '1' to parameter: 1
                    16:23:22,156 FST | [LongType] returning '2' as column: DBID1_5_0_
                    16:23:22,156 FST | [IntegerType] returning '0' as column: DBVERSION2_5_0_
                    16:23:22,156 FST | [LongType] returning '1' as column: DEPLOYMENT4_1_
                    16:23:22,171 FST | [LongType] returning '2' as column: DBID1_1_
                    16:23:22,187 INF | [TextType] could not read column value from result set: NAME5_1_; IOException occurred reading text
                    16:23:22,203 WRN | [JDBCExceptionReporter] SQL Error: 17401, SQLState: null
                    16:23:22,203 SEV | [JDBCExceptionReporter] 违反协议
                    ### EXCEPTION ###########################################
                    16:23:22,203 SEV | [LazyInitializationException] illegal access to loading collection
                    org.hibernate.LazyInitializationException: illegal access to loading collection
                    at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:363)
                    at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:108)
                    at org.hibernate.collection.AbstractPersistentCollection.readElementByIndex(AbstractPersistentCollection.java:183)
                    at org.hibernate.collection.PersistentMap.get(PersistentMap.java:169)
                    at org.jbpm.pvm.internal.repository.DeploymentImpl.getBytes(DeploymentImpl.java:180)
                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                    at java.lang.reflect.Method.invoke(Unknown Source)
                    at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:197)
                    at org.jbpm.pvm.internal.repository.DeploymentImpl_$$_javassist_27.getBytes(DeploymentImpl_$$_javassist_27.java)
                    at org.jbpm.pvm.internal.repository.DeploymentClassLoader.findResource(DeploymentClassLoader.java:52)
                    at java.lang.ClassLoader.getResource(Unknown Source)
                    at java.lang.ClassLoader.getResourceAsStream(Unknown Source)
                    at de.odysseus.el.ExpressionFactoryImpl.loadProperties(ExpressionFactoryImpl.java:136)
                    at de.odysseus.el.ExpressionFactoryImpl.<init>(ExpressionFactoryImpl.java:83)
                    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
                    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
                    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
                    at java.lang.reflect.Constructor.newInstance(Unknown Source)
                    at java.lang.Class.newInstance0(Unknown Source)
                    at java.lang.Class.newInstance(Unknown Source)
                    at javax.el.FactoryFinder.newInstance(FactoryFinder.java:64)
                    at javax.el.FactoryFinder.find(FactoryFinder.java:124)
                    at javax.el.ExpressionFactory.newInstance(ExpressionFactory.java:154)
                    at javax.el.ExpressionFactory.newInstance(ExpressionFactory.java:125)
                    at com.sun.script.juel.JuelScriptEngine.<init>(JuelScriptEngine.java:95)
                    at com.sun.script.juel.JuelScriptEngineFactory.getScriptEngine(JuelScriptEngineFactory.java:241)
                    at javax.script.ScriptEngineManager.getEngineByName(Unknown Source)
                    at org.jbpm.pvm.internal.script.ScriptManager.evaluate(ScriptManager.java:111)
                    at org.jbpm.pvm.internal.script.ScriptManager.evaluateExpression(ScriptManager.java:90)
                    at org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor.construct(ObjectDescriptor.java:180)
                    at org.jbpm.pvm.internal.wire.WireContext.construct(WireContext.java:469)
                    at org.jbpm.pvm.internal.wire.WireContext.create(WireContext.java:448)
                    at org.jbpm.pvm.internal.wire.WireContext.create(WireContext.java:258)
                    at org.jbpm.pvm.internal.util.ReflectUtil.instantiateUserCode(ReflectUtil.java:310)
                    at org.jbpm.pvm.internal.wire.usercode.UserCodeReference.getObject(UserCodeReference.java:63)
                    at org.jbpm.pvm.internal.wire.usercode.UserCodeReference.getObject(UserCodeReference.java:47)
                    at org.jbpm.jpdl.internal.activity.JavaActivity.perform(JavaActivity.java:57)
                    at org.jbpm.jpdl.internal.activity.JpdlAutomaticActivity.execute(JpdlAutomaticActivity.java:15)
                    at org.jbpm.pvm.internal.model.op.ExecuteActivity.perform(ExecuteActivity.java:60)
                    at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperationSync(ExecutionImpl.java:656)
                    at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperation(ExecutionImpl.java:616)
                    at org.jbpm.pvm.internal.model.ExecutionImpl.start(ExecutionImpl.java:217)
                    at org.jbpm.pvm.internal.cmd.StartProcessInstanceInLatestCmd.execute(StartProcessInstanceInLatestCmd.java:65)
                    at org.jbpm.pvm.internal.cmd.StartProcessInstanceInLatestCmd.execute(StartProcessInstanceInLatestCmd.java:38)
                    at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
                    at org.jbpm.pvm.internal.tx.StandardTransactionInterceptor.execute(StandardTransactionInterceptor.java:54)
                    at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)
                    at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)
                    at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)
                    at org.jbpm.pvm.internal.svc.SkipInterceptor.execute(SkipInterceptor.java:43)
                    at org.jbpm.pvm.internal.svc.ExecutionServiceImpl.startProcessInstanceByKey(ExecutionServiceImpl.java:70)
                    at org.jbpm.examples.java.JavaInstantiateTest.testJavaInstantiate(JavaInstantiateTest.java:57)
                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                    at java.lang.reflect.Method.invoke(Unknown Source)
                    at junit.framework.TestCase.runTest(TestCase.java:164)
                    at org.jbpm.test.BaseJbpmTestCase.runTest(BaseJbpmTestCase.java:80)
                    at junit.framework.TestCase.runBare(TestCase.java:130)
                    at junit.framework.TestResult$1.protect(TestResult.java:106)
                    at junit.framework.TestResult.runProtected(TestResult.java:124)
                    at junit.framework.TestResult.run(TestResult.java:109)
                    at junit.framework.TestCase.run(TestCase.java:120)
                    at junit.framework.TestSuite.runTest(TestSuite.java:230)
                    at junit.framework.TestSuite.run(TestSuite.java:225)
                    at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
                    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)