2 Replies Latest reply on Oct 12, 2009 10:18 AM by Michael Lieshoff

    generic business interface

    Michael Lieshoff Newbie

      Hi all,

      i have some problems with my business interface and a extending remote interface with his implementing bean. I use jBoss 4.0.5 GA and it seems, generic typing does not work in this constallation.

      Business interface is following :

      public interface Business {
      // returns all elements of type t founded by name
      List getElementsByName(String name) throws Exception;
      }

      My remote is type for items of type Item :

      public interface ItemRemote extends EJBObject, Business {
      // returns all elements of type t founded by name
      List getElementsByName(String name) throws RemoteException;
      }

      My bean :

      public ItemBean implements SessionBean, Business {
      public List getElementsByName(String name) throws RemoteException {
      // do some magic to get list of item
      }
      }

      Deploying fails because of this reason :

      Bean must implement all remote interface methods :

      List getElementsByName(String name) throws RemoteException;

      --> it seems, generic methods are translated to object typed methods while jBoss runtime bean code generation/verifying

      Somebody knows about it and can help ?

      Thanks.

        • 1. Re: generic business interface
          jaikiran pai Master

          As you can see in your post, the generics related information in your code is lost while posting. So, while posting logs or xml content or code, please remember to wrap it in a code block by using the Code button in the message editor window. Please use the Preview button to ensure that your post is correctly formatted.

          • 2. Re: generic business interface
            Michael Lieshoff Newbie

            Thank you for fast answering, the correct signatures are here :

            Business interface is following :

            public interface Business {
             // returns all elements of type t founded by name
             List<Item> getElementsByName(String name) throws Exception;
            }
            

            My remote is type for items of type Item :
            public interface ItemRemote extends EJBObject, Business {
             // returns all elements of type t founded by name
             List<Item> getElementsByName(String name) throws RemoteException;
            }
            

            My bean :
            public ItemBean implements SessionBean, Business {
             public<Item> List getElementsByName(String name) throws RemoteException {
             // do some magic to get list of item
            }
            }
            

            Deploying fails because of this reason :

            Bean must implement all remote interface methods :
            
            List<Object> getElementsByName(String name) throws RemoteException;