title: Object null in my RMI server
body: <p>I send object on my RMI but , i find a null value.</p>
  
  <p>Client.java :</p>
  
  <pre><code>service.InterfaceMathML stub = (service.InterfaceMathML) Naming.lookup("rmi://localhost:1099/BK");
  
  System.out.println("id : " +this.MTI_creerFichier.getId()); // Show 10
  
  
           int ValRetour = stub.Create(this.MTI_creerFichier, this.MTI_creerFichier.getId(),  "CreateFichier");
  </code></pre>
  
  <p>My Interface : </p>
  
  <pre><code>import java.rmi.Remote;
  import java.rmi.RemoteException;
  
  public interface InterfaceMathML extends Remote{
      public int Create(Object unObject,String user, String unType)throws RemoteException;
  }
  </code></pre>
  
  <p>My Server :</p>
  
  <pre><code>public int Create(Object unObject, String user, String unType) throws RemoteException {
          // TODO Auto-generated method stub
  
          switch(unType)
          {
          case "CreateFichier" : 
                          System.out.println("Create Fichier");
              System.out.println((CreateFichier)unObject.getId());  // show Null
  ystem.out.println(user);  // show userTest
                  FichierImpl = new JDBCDAO_Fichier();
                  this.validation = FichierImpl.Validation_ADD((CreateFichier)unObject, user);
                  if ( this.validation == 1)   { this.entier = FichierImpl.add((CreateFichier)unObject, user); }
                  else  { this.entier = this.validation; }
              break;
  </code></pre>
  
  <p>so Why I can't my Object is null on the server ? </p>
  
  <p>Please for help.</p>
  
  <p><strong>EDIT</strong> 
  In my MAINTestServer.java ( on my serverRMI)</p>
  
  <pre><code> od = new MathMLServiceImpl() CreateFichier fi  = new  CreateFichier();
              fi.setLogin("test");            fi.setDossierParent("dossierparenttest");
              fi.setNomFichier("nomfichiertest");
              fi.setContenuFichier("essaie");
  
              int  val = od.Create(fi, "test", "CreateFichier"); System.out.println(val);
  </code></pre>
  
  <p>It's work</p>
  
  <p>my RMI Server </p>
  
  <pre><code>public static void main(String[] args) {
          // TODO Auto-generated method stub
          String url = "rmi://localhost:1099/BK";
  
          try {
              LocateRegistry.createRegistry(1099);
              MathMLServiceImpl od = new MathMLServiceImpl();
  
              // je met a dispo un objet dans un url 
              Naming.rebind("rmi://localhost:1099/BK", od);
              System.out.println("Service pret");
          } catch (Exception e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          }
  
      }
  </code></pre>
  
  <p>My CLientRMI :
  I use Polymorphism to lanch class detect my class : </p>
  
  <pre><code>Class&lt;?&gt; actionClass = Class.forName("metierToInte." + nomDto + "Action");
              System.out.println(actionClass);
  
  
              Constructor&lt;?&gt; actionConstructe = actionClass.getConstructor(dto.getClass()); //dto.getClass()
              System.out.println("constructeur : " + actionConstructe.toString());
              ActionInteToMetier uneActione = (ActionInteToMetier) actionConstructe.newInstance(dto);
  
  
              System.out.println("action : " + uneActione.toString());
              //System.out.println("action : " + uneActione.toString());
              uneActione.executer();
  </code></pre>
  
  <p>It's work , for exemple my class "CreateFichierAction", I can send String it's work, but not my object</p>
  
  <pre><code>this.MTI_creerFichier =  creerFichier;
  service.InterfaceMathML stub = (service.InterfaceMathML) Naming.lookup("rmi://localhost:1099/BK");
  
  System.out.println("id : " +this.MTI_creerFichier.getId()); // Show 10
           int ValRetour = stub.Create(this.MTI_creerFichier, this.MTI_creerFichier.getLogin(),  "CreateFichier");
           System.out.println("valeur retour rmi " + ValRetour);
  </code></pre>
  
  <p>soucr : CreerFichier </p>
  
  <pre><code>package dto.metierToInte;
  
  import java.io.Serializable;
  
  @XmlAccessorType(XmlAccessType.FIELD)
  @XmlType(name = "")
  @XmlRootElement(name = "CreateFichier")
  public class CreateFichier
      extends Fichier
      implements Serializable
  {
  
      private static final long serialVersionUID = 1L;
      @XmlAttribute(name = "id")
      protected int id;
  
       public String getId() {
          return id;
      }
   }
  </code></pre>
  
  <p>It's work but , Not if my RMI CLIENT</p>