1 Reply Latest reply: Apr 25, 2012 10:31 AM by Stylianos Koussouris RSS

    How to set passByValue = true in ReplyTo InVMEPR

    Stylianos Koussouris Newbie

      I am currently sending an object within a custom location in the Message (lets call it input) and the service I am sending it to is configured as follows (only INVM transport is available)

       

      <service category="MainCategory" name="EntryService" invmScope="GLOBAL">
         <property name="inVMPassByValue" value="true" />
      
         <actions mep="OneWay">
      
            somewhere here I route to another service service-category="ReplyServices" service-name="StatusSetting"
      
         </actions>
      
      </service>
      
      <service category="ReplyServices" name="StatusSetting" invmScope="GLOBAL">
        <property name="inVMPassByValue" value="true" />
      
         <actions mep="RequestResponse">
      
            // I get the object from location "input" without any problems as it has been de-serialized successfully.
             MyObjectClass c = (MyObjectClass) response.getBody().get("input");
             // I enhance the object and put it back in its location
             obj.addStatus("ok");
             response.getBody().add("input", obj);
             //The Message Headers maintain the original ReplyTo and so returns successfully to client
      
      
         </actions>
      
      </service>
      
      

       

       

      On the client side when I access the object as follows

      MyObjectClassobj = (MyObjectClass) response.getBody().get("input");

       

       

      I get

       

       ClassCastException org.mypackage.MyObjectClass cannot be cast to org.mypackage.MyObjectClass

       

       

      This error is similar to the one I was getting before I managed with the service configuration to set the

       

      To: InVMEPR .... <wsa:ReferenceProperties jbossesb:passByValue : true/>  (from default false)

       

       

      Now, I believe the same has to be done for the ReplyTo but

      a) I am not sure how programmatically/configuration

      b) Also am not 100% certain if the cause of the ClassCastException is the fact that the passByValue property is false and therefore I am willing to hear your ideas on this. What other causes could there be?

       

      Thanks in advance

        • 1. Re: How to set passByValue = true in ReplyTo InVMEPR
          Stylianos Koussouris Newbie

          Ok it was the passByValue in the ReplyTo that was causing the ClassCastException I resolved it by

           

          removing the "passByValue" extension from the EPR ReplyTo

           

          reply.getAddr().removeExtentions("passByValue", "false")'

           

          and added  a new extension to the same EPR which yields "true"

           

          If there is an easier/less hacking way to do this I would appreciate if anyone can point me to it. By the way this is currently only been identified as an issue for the InVMEpr or my service I haven't tried with JMSEpr or any other as such.