2 Replies Latest reply on Feb 15, 2008 6:21 PM by Alejandro Guizar

    BPEL GA on Oracle: ElementType causing problem while running

    Meghana Joglekar Novice

      Hi,

      With Oracle 10G, jBPM/BPEL 1.1 GA.

      During the running of a BPEL process, I got:

      13:58:26,218 ERROR [StartListener] request delivery failed due to non-recoverable exception, givi
      ng up
      org.hibernate.exception.GenericJDBCException: could not load an entity: [org.jbpm.bpel.graph.basic.assign.From#15]
       at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
       at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
       at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
       at org.hibernate.loader.Loader.loadEntity(Loader.java:1798)
       at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:48)
       at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:42)
       at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:2977)
       at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:393)
       at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:374)
       at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:137)
       at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:96)
       at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:878)
       at org.hibernate.impl.SessionImpl.immediateLoad(SessionImpl.java:836)
       at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:66)
       at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:111)
       at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:198)
       at org.jbpm.bpel.graph.basic.assign.From_$$_javassist_1.extract(From_$$_javassist_1.java)
       at org.jbpm.bpel.graph.basic.assign.Copy.execute(Copy.java:34)
       at org.jbpm.bpel.graph.basic.Assign.execute(Assign.java:45)
       at org.jbpm.bpel.graph.def.Activity.enter(Activity.java:117)
       at org.jbpm.graph.def.Transition.take(Transition.java:151)
       at org.jbpm.graph.def.Node.leave(Node.java:394)
       at org.jbpm.bpel.graph.def.Activity.leave(Activity.java:210)
       at org.jbpm.bpel.graph.basic.Receive.messageReceived(Receive.java:53)
       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.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:205)
       at org.jbpm.bpel.graph.basic.Receive_$$_javassist_19.messageReceived(Receive_$$_javassist_19.java)
       at org.jbpm.bpel.integration.def.ReceiveAction.deliverMessage(ReceiveAction.java:99)
       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.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:205)
       at org.jbpm.bpel.integration.def.ReceiveAction_$$_javassist_93.deliverMessage(ReceiveAction_$$_javassist_93.java
      )
       at org.jbpm.bpel.integration.jms.StartListener.deliverRequest(StartListener.java:222)
       at org.jbpm.bpel.integration.jms.StartListener.onMessage(StartListener.java:168)
       at org.jboss.mq.SpyMessageConsumer.run(SpyMessageConsumer.java:696)
       at java.lang.Thread.run(Thread.java:595)
      Caused by: java.sql.SQLException: Stream has already been closed
       at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
       at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
       at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:208)
       at oracle.jdbc.driver.LongRawAccessor.getBinaryStream(LongRawAccessor.java:341)
       at oracle.jdbc.driver.OracleResultSetImpl.getBinaryStream(OracleResultSetImpl.java:886)
       at oracle.jdbc.driver.OracleResultSet.getBinaryStream(OracleResultSet.java:1700)
       at org.jboss.resource.adapter.jdbc.WrappedResultSet.getBinaryStream(WrappedResultSet.java:354)
       at org.jbpm.bpel.persistence.db.type.ElementType.nullSafeGet(ElementType.java:91)
       at org.hibernate.type.CustomType.nullSafeGet(CustomType.java:105)
       at org.hibernate.type.AbstractType.hydrate(AbstractType.java:81)
       at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2031)
       at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1371)
       at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1299)
       at org.hibernate.loader.Loader.getRow(Loader.java:1197)
       at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:568)
       at org.hibernate.loader.Loader.doQuery(Loader.java:689)
       at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
       at org.hibernate.loader.Loader.loadEntity(Loader.java:1784)
       ... 37 more
      


      In jbpm.ga/bpel/library/src/main/java/org/jbpm/bpel/graph/basic/assign/From.hbm.xml

      The last two mappings are:
      <subclass name="org.jbpm.bpel.graph.basic.assign.FromElement" discriminator-value="M">
      
      <property name="literal" type="element" column="ELEMENT_" length="4000" />
      
      </subclass>
      
      
      <subclass name="org.jbpm.bpel.graph.basic.assign.FromText" discriminator-value="T">
      
      <property name="literal" column="TEXT_" length="4000" />
      
      </subclass>
      
      

      Once the table is created in Oracle,

      ELEMENT_ LONG RAW
      TEXT_ VARCHAR2(4000 CHAR)


      I found some discussion saying the solution is to move the long raw column as the last mapping, which will make it got selected first, thus the stream would not be closed. But that did not work for me.

      And suggestion? We know that to use LOB, instead of Long Raw, would be a solution, but we prefer a solution without JBPM source code change. Thanks a lot in advance.

      Jay.




        • 1. Re: BPEL GA on Oracle: ElementType causing problem while run
          Meghana Joglekar Novice

          Hello,

          We were able to run BPEL processes on this same Oracle db server when we were on BPEL beta 3.

          Thanks,
          Meghana.

          • 2. Re: BPEL GA on Oracle: ElementType causing problem while run
            Alejandro Guizar Master

            For the sake of isolating the error, can you reduce the column length to 2000 (the max size for a RAW column), repackage and redeploy the application?

            If downsizing causes the data to exceed the column length, locate the following entry in jbpm.cfg.xml and set it to a value greater than 0. Note that changing this setting has the side effect of enlarging small byte chunks (say, 100-200 bytes) so use it with care.

            <!-- see java.util.zip.Deflater for details on the compression level -->
            <int name="jbpm.bpel.element.deflate.level" value="0" singleton="true" />


            Anywhere you see length="4000" in the mapping documents, we mean "arbitrary length". For both jPDL and BPEL we'd have really liked to use BLOB/CLOB instead of VARBINARY/VARCHAR column, but support for the former varies greatly from vendor to vendor.

            In 1.1.Beta3, the length was not specified, which resulted in the database picking a default length. In some cases the default was as small as 255 chars/bytes, which was unacceptable. Unfortunately, it is hard to pick a value that works for all databases, drivers, versions, etc.