0 Replies Latest reply on Sep 23, 2010 8:14 PM by showping.tong

    BlazeDS ASObject cover to JAVA Object error

    showping.tong

      hi,there:

       

      I have a problem when debug flex application,like follow:

      [FaultEvent fault=[RPC Fault faultString="Cannot invoke method 'addBug'." faultCode="Server.ResourceUnavailable" faultDetail="The expected argument types are (com.gamesavor.pojo.PlayerBug) but the supplied types were (flex.messaging.io.amf.ASObject) and converted to (null)."] messageId="9B76B2D2-6D09-5D1C-5284-0B55FDDE49CE" type="fault" bubbles=false cancelable=true eventPhase=2]

       

      In BlazeDS,cover AS3Object to JAVAObject is automatric.But when I use IModuleInfo to load a module to main Application.It show the error.

      My AS3VO class:

      package com.sf.pl.modules.gm.model.vo
      {
          import com.sf.pl.core.modulebase.VOBase;
         
          [RemoteClass(alias="com.gamesavor.pojo.PlayerBug")]
          [Bindable]
         
          public class BugVO extends VOBase
          {
              public var id:int;
              public var title:String;
              public var desc:String;
             
              public function BugVO(obj:Object=null)
              {
                  super(obj);
              }
          }
      }

      My JAVA Pojo class:

      package com.gamesavor.pojo;

       

      import java.io.Serializable;

       

      public class PlayerBug implements Serializable {
         
          private static final long serialVersionUID = 1L;
         
          private int id;
          private String title;
          private String desc;
         
          public int getId() {
              return id;
          }
          public void setId(int id) {
              this.id = id;
          }
          public String getTitle() {
              return title;
          }
          public void setTitle(String title) {
              this.title = title;
          }
          public String getDesc() {
              return desc;
          }
          public void setDesc(String desc) {
              this.desc = desc;
          }
      }

       

      My IModuleInfo load code:

      moduleInfo.addEventListener(ModuleEvent.READY, readyHandler);
                  moduleInfo.addEventListener(ModuleEvent.ERROR, errorHandler);
                  moduleInfo.addEventListener(ModuleEvent.PROGRESS,progressHandler)
                  moduleInfo.load(ApplicationDomain.currentDomain);

       

      How can I do to resovle the error?

      Thanks.