2 Replies Latest reply on Feb 19, 2007 3:48 AM by Nicolas Ploquin

    Probleme java/Jboss ?

    Nicolas Ploquin Newbie

      Hello !

      I'm beginer in JBoss, and for the moment, I just want to deploy EJB that I already have...

      But, for exemple, if I use :

      package org.hello.session;
      
      import java.rmi.RemoteException;
      import javax.ejb.EJBObject;
      
      public interface HelloWorldSession extends EJBObject {
      
       public static final String CODEP[] = {"CODE", "Code"};
      
       public String getGreeting() throws RemoteException;
      
      } // end of the class ....
      


      When I copie the .jar in the deploy directory, I've the following error :

      WARN [verifier] EJB spec violation:
      Bean : HelloWorldSession
      Method : public abstract HelloWorldSession create() throws RemoteException, CreateException
      Section: ...
      Warning: The method return values in the home interface must be of valid types for RMI/IIOP.


      If I remove the line :

      public static final String CODEPLAN[] = {"CODE", "Code"};

      It work but I need this line !! How can I do ?

      Thank you !

        • 1. Re: Probleme java/Jboss ?
          Jeroen Wenting Newbie

          Don't put that there. An array isn't a valid serializable object (and putting fields in an interface is an established Bad Thing (tm) according to Josh Bloch, though sometimes handy for cases like this).

          Best change that array to 2 separate String fields (I assume they're allowed values for some parameter?).

          P.S. there's no need to mark the field public static final in the interface, it's implicit (just as methods in interfaces are implicitly public).

          • 2. Re: Probleme java/Jboss ?
            Nicolas Ploquin Newbie

            Ok,

            Thank you very much !
            This EJB work on WebLogic, but, I want use JBoss now !! I'll test with 2 separate String fields !

            So, thank you jwenting.