10 Replies Latest reply on May 3, 2010 3:56 PM by amy3k

    error on serialization object

    amy3k

      hello,

       

      i new to jbpm and i have a little (but for me is big and urgent problem)

       

      i have 2 web service - one is for "core"(WScomponents) and the second one is for creating a JBPM workflow(WSprincipal) that manage an application

       

      in WS principal i appeal one method from WScomponents that return a list of a custom object named "folder" (=> List<folder>), this list i've tried to put this in a jbpm variable like this:

       

      <java g="270,290,92,52" method="getAllFolders" name="getAllFolders" var="folders">
            <arg><object expr="#{pathID}"/></arg>
            <arg><object expr="#{username}"/></arg>
            <transition g="-62,-35" name="to preluareVar" to="preluareVar"/>
      </java>

       

      but in the method getAllFolders i've get an error like this:

       

      org.jbpm.pvm.internal.wire.WireException: couldn't invoke method getAllFolders: couldn't serialize '[wscomponents.Folder@129e910]'
              at org.jbpm.jpdl.internal.activity.JavaActivity.perform(JavaActivity.java:97)
              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:637)
              at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperation(ExecutionImpl.java:597)
              at org.jbpm.pvm.internal.model.ExecutionImpl.start(ExecutionImpl.java:201)
              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.execute(EnvironmentInterceptor.java:46)
              at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)
              at org.jbpm.pvm.internal.svc.ExecutionServiceImpl.startProcessInstanceByKey(ExecutionServiceImpl.java:78)
              at workflow.PrincipalProcess.start(PrincipalProcess.java:57)
              at workflow.principalWS.launch(principalWS.java:22)  .....and more

       

       

      any help/suggestion is appreciated!!

      10x,

      a.

        • 1. Re: error on serialization object
          rebody

          Hi Rana,

            Did you let wscomponents.Folder.class implement java.io.Serializable?

          • 2. Re: error on serialization object
            amy3k

            yes i did that!

             

            my class looks like this:

            public class folder  implements Serializable{
                public static final long serialVersionUID = 1L;

             


                private String name;
                private String author;
              (...and more)}

             

             

            ps : and i'm using jbpm 4.1

             

            10x for your attention

            • 3. Re: error on serialization object
              rebody

              Hi  r ana,

                I checked jBPM 4.1 and this problem seems caused in org.jbpm.pvm.internal.type.converter.SerializableToBytesConverter.convert().  The exception information that you provided was not enough,  so I can't go further.

               

                First, I suggest you use the latest version of jBPM 4,  jBPM 4.3.

               

                Then if the problem cannot be solved, please show us the full exception stack trace.  You'd better give us a testcase, so we could reproduce this problem and find out a solution.

               

                Thank you.

              • 4. Re: error on serialization object
                amy3k

                i've tried with jbpm 4.3 but still the same problem..

                 

                i'll attach the error, code and jpdl

                 

                10x for all your help,

                ana

                • 5. Re: error on serialization object
                  swiderski.maciej

                  Hi,

                   

                  just went through your attachment and it looks like you did not deploy your class that should be invoked for java activity.

                   

                  Please deploy it same was as you do it with *.jpdl.xml file.

                   

                  In general, make sure that your class is available on classpath for jbpm process engine.

                   

                  HTH

                  Maciej

                  • 6. Re: error on serialization object
                    amy3k

                    ok here it is my class form the WScomponents

                    • 7. Re: error on serialization object
                      swiderski.maciej

                      Could you post complete set of classes for your case?

                       

                      It is difficult to find all information from these snippets you posted.

                       

                      Cheers

                      Maciej

                      • 8. Re: error on serialization object
                        amy3k

                        it is very large..because i use an other 2 components..jackrabbit and a server lotus notes for email and autherntification

                         

                        so i can't do that..i know that this is very annoying.. but i've told you what my classes are returning..

                        the only method that i didn't exposed was getAllFolders - public List<folder> getAllFolders(String id, String idUtilizator) {(.. here is some jackrabbit code.. that works fine )}

                         

                        i hope you can help me even so,

                        10x

                        • 9. Re: error on serialization object
                          swiderski.maciej

                          Inside that class you have two members:

                           

                          ComponetsService servComp;
                          Componets portComp;
                          
                          
                          

                          are those two serializable? Or do you need them to be serialized? If not mark them as transient.

                           

                          I understand that your project can be large but I meant to have complete set of classes that interacts with jBPM not all of you components.

                           

                          Cheers,

                          Maciej

                          • 10. Re: error on serialization object
                            amy3k
                            this is the correct answer at my question:
                            "you Folder class, that is generated from wsdl is  not serializable. You need to use some wrappers. Please use some kind of  DTOs as return value of a java activity instead of Folder class. Of  course that would mean to rewrite all values.
                            At this point you return List<Folder> and Folder is not  possible to serialize in regular way (java.io) but only with JAXB.
                            HTH

                            Maciej "

                             

                            10x for this all your attention!!!

                            ana