6 Replies Latest reply on Apr 12, 2013 10:24 AM by tunnaruto

    I18NText with Oracle

    Kiran A Newbie

      I am using JBM-5.2.0-SNAPSHOT with Oracle10g and Hibernate 3.6.0.Final.

      Task Service was throwing a java.lang.ClassCastException: $Proxy88 cannot be cast to oracle.sql.CLOB while saving the task.

       

      I had to modify the source for org.jbpm.task.I18NText to include the StringClobType (Didn't try the MaterializedClobType but I guess that would work too)

       

          @Lob

          @Type(type = "org.hibernate.type.StringClobType")

          private String text;

       

       

      Would be great to use a hibernate text instead of Lob.

       

      Regards

      --K

        • 1. Re: I18NText with Oracle
          Diego Leal Newbie

          Hello

          I have a similar problem with this field. When i´m running over the in-memory database, and try to complete a Human task everything works fine, but when i´m running over Oracle, I got the following exception. Dou you have any clue? Or did you have a similar problem? Thx

          Diego

           

          19:32:42,984 INFO  [STDOUT] 19:32:42,984 WARN  [LoggingFilter] EXCEPTION :

          org.apache.mina.filter.codec.ProtocolEncoderException: java.lang.NullPointerException

                  at org.apache.mina.filter.codec.ProtocolCodecFilter.filterWrite(ProtocolCodecFilter.java:355)

                  at org.apache.mina.core.filterchain.DefaultIoFilterChain.callPreviousFilterWrite(DefaultIoFilterChain.java:509)

                  at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1400(DefaultIoFilterChain.java:46)

                  at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.filterWrite(DefaultIoFilterChain.java:808)

                  at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.filterWrite(DefaultIoFilterChain.java:734)

                  at org.apache.mina.core.filterchain.DefaultIoFilterChain.callPreviousFilterWrite(DefaultIoFilterChain.java:509)

                  at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireFilterWrite(DefaultIoFilterChain.java:501)

                  at org.apache.mina.core.session.AbstractIoSession.write(AbstractIoSession.java:490)

                  at org.apache.mina.core.session.AbstractIoSession.write(AbstractIoSession.java:435)

                  at org.jbpm.task.service.mina.MinaSessionWriter.write(MinaSessionWriter.java:31)

                  at org.jbpm.task.service.TaskServerHandler.messageReceived(TaskServerHandler.java:101)

                  at org.jbpm.task.service.mina.MinaTaskServerHandler.messageReceived(MinaTaskServerHandler.java:41)

                  at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.messageReceived(DefaultIoFilterChain.java:716)

                  at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)

                  at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46)

                  at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:796)

                  at org.apache.mina.filter.codec.ProtocolCodecFilter$ProtocolDecoderOutputImpl.flush(ProtocolCodecFilter.java:427)

                  at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:245)

                  at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)

                  at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46)

                  at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:796)

                  at org.apache.mina.filter.logging.LoggingFilter.messageReceived(LoggingFilter.java:177)

                  at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)

                  at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46)

                  at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:796)

                  at org.apache.mina.core.filterchain.IoFilterAdapter.messageReceived(IoFilterAdapter.java:119)

                  at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)

                  at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireMessageReceived(DefaultIoFilterChain.java:426)

                  at org.apache.mina.core.polling.AbstractPollingIoProcessor.read(AbstractPollingIoProcessor.java:692)

                  at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:645)

                  at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:634)

                  at org.apache.mina.core.polling.AbstractPollingIoProcessor.access$400(AbstractPollingIoProcessor.java:66)

                  at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:1078)

                  at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)

                  at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

                  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

                  at java.lang.Thread.run(Thread.java:662)

          Caused by: java.lang.NullPointerException

                  at java.io.ObjectOutputStream$BlockDataOutputStream.getUTFLength(ObjectOutputStream.java:2106)

                  at java.io.ObjectOutputStream$BlockDataOutputStream.writeUTF(ObjectOutputStream.java:1977)

                  at java.io.ObjectOutputStream.writeUTF(ObjectOutputStream.java:849)

                  at org.jbpm.task.I18NText.writeExternal(I18NText.java:49)

                  at org.jbpm.task.utils.CollectionUtils.writeI18NTextList(CollectionUtils.java:235)

                  at org.jbpm.task.Task.writeExternal(Task.java:93)

                  at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1429)

                  at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1398)

                  at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)

                  at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)

                  at java.util.ArrayList.writeObject(ArrayList.java:570)

                  at sun.reflect.GeneratedMethodAccessor272.invoke(Unknown Source)

                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                  at java.lang.reflect.Method.invoke(Method.java:597)

                  at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)

                  at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1469)

                  at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)

                  at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)

                  at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)

                  at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)

                  at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)

                  at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)

                  at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)

                  at org.apache.mina.core.buffer.AbstractIoBuffer.putObject(AbstractIoBuffer.java:2011)

                  at org.apache.mina.filter.codec.serialization.ObjectSerializationEncoder.encode(ObjectSerializationEncoder.java:80)

                  at org.apache.mina.filter.codec.ProtocolCodecFilter.filterWrite(ProtocolCodecFilter.java:322)

                  ... 36 more

          • 2. Re: I18NText with Oracle
            Paul Kenny Newbie

            Hi Diego,

             

            I got the above error and solved it by adding a comment to the comment field of the human task properties in the designer. I am guessing that it is an undocumented mandotory field.

             

              Cheers,

                 Paul

            • 3. Re: I18NText with Oracle
              gigazhang Newbie

              there's the same problem in 5.3.0.Final

               

              comment field must be filled,,

               

              but in 5.3.0.Final, filled the comment field, throws other exception:

               

              2012-06-27 17:34:46,634 INFO [org.apache.mina.filter.logging.LoggingFilter] - <SENT: HeapBuffer[pos=0 lim=0 cap=0: empty]>

              java.lang.NullPointerException

                  at org.jbpm.process.workitem.wsht.AsyncGenericHTWorkItemHandler$GetCompletedTaskResponseHandler.execute(AsyncGenericHTWorkItemHandler.java:241)

                  at org.jbpm.task.service.TaskClientHandler.messageReceived(TaskClientHandler.java:81)

                  at org.jbpm.task.service.mina.MinaTaskClientHandler.messageReceived(MinaTaskClientHandler.java:47)

                  at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.messageReceived(DefaultIoFilterChain.java:716)

                  at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)

                  at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46)

                  at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:796)

                  at org.apache.mina.filter.codec.ProtocolCodecFilter$ProtocolDecoderOutputImpl.flush(ProtocolCodecFilter.java:427)

                  at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:245)

                  at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)

                  at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46)

                  at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:796)

                  at org.apache.mina.core.filterchain.IoFilterAdapter.messageReceived(IoFilterAdapter.java:119)

                  at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)

                  at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireMessageReceived(DefaultIoFilterChain.java:426)

                  at org.apache.mina.core.polling.AbstractPollingIoProcessor.read(AbstractPollingIoProcessor.java:692)

                  at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:645)

                  at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:634)

                  at org.apache.mina.core.polling.AbstractPollingIoProcessor.access$400(AbstractPollingIoProcessor.java:66)

                  at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:1078)

                  at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)

                  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)

                  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)

                  at java.lang.Thread.run(Thread.java:722)

              • 4. Re: I18NText with Oracle
                Andrey Trakhirov Newbie

                I have the same problem.

                 

                My temporary solution:

                 

                public class HumanTaskWorkItemHandler extends AsyncGenericHTWorkItemHandler {

                 

                 

                    public HumanTaskWorkItemHandler(KnowledgeRuntime session) {

                        super(session);

                    }

                 

                 

                    @Override

                    protected Task createTaskBasedOnWorkItemParams(WorkItem workItem) {

                        Task task = super.createTaskBasedOnWorkItemParams(workItem);

                        addDefaultDescriptionToText(task.getNames());

                        addDefaultDescriptionToText(task.getSubjects());

                        addDefaultDescriptionToText(task.getDescriptions());

                        return task;

                    }

                 

                 

                    private void addDefaultDescriptionToText(List<I18NText> textList) {

                        for(I18NText text: textList) {

                            if (text.getText() == null || text.getText().equals("")) {

                                text.setText(" ");

                            }

                        }

                    }

                }

                • 5. Re: I18NText with Oracle
                  Babu V Newbie

                  Hi Andrey,

                   

                  I am facing the same issue and followed your suggestion i.e. implemented the WorkItemHandler to insert a space when comment field is empty/null.

                   

                  In fact I filled comment field in the process definition, but still I am facing the same issue.

                   

                  I am trying to integrate jBPM5.3 with existing legacy app which is using JPA/local TX and I have configured JPA for both process/session related table and also task related table.

                  When I run the applicaiton and start the workflow process, it is inserting data in session and process related table, but it is failing while inserting I18NText data and unable to rollback the Tx.

                   

                  do you have any further suggestions to fix this issue?

                   

                  Appreciate your help.

                  -Babu

                  • 6. Re: I18NText with Oracle
                    tunnaruto Newbie

                    Thank you so much.