3 Replies Latest reply on Nov 14, 2013 5:14 PM by swiderski.maciej

    jbpm6, web-service task in a process

    nickel

      Hello everyone!

      Maybe someone can help my with my problem.

      I create process with Web Service task, but I can't manage with it. It's OK when my WS returns String, but when I try to use any other object instead of String I get NotSerializableException.

      That is what I get when trying return array or list for example:

       

      Caused by: java.io.NotSerializableException: defaultnamespace.XsdStringArray

        at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1183) [rt.jar:1.7.0_45]

        at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:347) [rt.jar:1.7.0_45]

        at java.util.ArrayList.writeObject(ArrayList.java:742) [rt.jar:1.7.0_45]

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_45]

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_45]

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_45]

        at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_45]

        at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:988) [rt.jar:1.7.0_45]

        at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1495) [rt.jar:1.7.0_45]

        at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1431) [rt.jar:1.7.0_45]

        at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177) [rt.jar:1.7.0_45]

        at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:347) [rt.jar:1.7.0_45]

        at org.drools.core.marshalling.impl.SerializablePlaceholderResolverStrategy$SerializablePlaceholderStrategyContext.write(SerializablePlaceholderResolverStrategy.java:97) [drools-core-6.0.0.CR5.jar:6.0.0.CR5]

        at org.drools.core.marshalling.impl.PersisterHelper.writeStrategiesIndex(PersisterHelper.java:214) [drools-core-6.0.0.CR5.jar:6.0.0.CR5]

        at org.drools.core.marshalling.impl.PersisterHelper.writeToStreamWithHeader(PersisterHelper.java:194) [drools-core-6.0.0.CR5.jar:6.0.0.CR5]

        at org.jbpm.marshalling.impl.ProtobufProcessMarshaller.writeWorkItem(ProtobufProcessMarshaller.java:285) [jbpm-flow-6.0.0.CR5.jar:6.0.0.CR5]

       

      What am I doing wrong?

      Thanks!

        • 1. Re: jbpm6, web-service task in a process
          swiderski.maciej

          if you would like to store objects returned by web service as process variables you need to ensure these objects are serializable (implements java.io.Serializable interface). Once this requirement is met you will be able to successfully store such objects as part of the process instance.

           

          HTH

          • 2. Re: jbpm6, web-service task in a process
            nickel

            Thank you for you answer, Maciej !

            Yes, my class is serializable. I got this exception in any case. I use standard WS task: pass to it WSDL link and other params. It use org.jbpm.process.workitem.webservice.WebServiceWorkItemHandler. As I understand the handler generates WS-client itself and than use it for calling WS. So I have only serialazible A class on the web-server side, but I don't know what is generated on the client side by WebServiceWorkItemHandler.

            • 3. Re: jbpm6, web-service task in a process
              swiderski.maciej

              check out here as I described how to use some special files that are read by CXF to corse the generated classes to be serializable.

               

              HTH