2 Replies Latest reply on Sep 16, 2006 2:07 PM by christophe.laumond

    "An SLSB doesn't have a home interface anymore" ?

    christophe.laumond

      Hi all,

      I'm using Seam1.0.1GA with the JBoss AS 4.0.4GA provided with JEMSInstaller and for testing I'm using the testng-jdk15.jar provided with the TestNG Eclipse plugin.

      I have found this article describing EJB 3.0 in general :
      http://www.javaworld.com/javaworld/jw-08-2004/jw-0809-ejb-p2.html

      Below the part this post is about :


      An SLSB doesn't have a home interface anymore?in fact, no EJB type requires it. The bean class may or may not implement a business interface. If it does not implement any business interfaces, a business interface will be generated using all the public methods.


      When I read that I think : "This is wonderful !"

      I have generated DAO class using the Hibernate tools in Eclipse.

      For example :
      @Stateless
      public class AccountantHome {
      
       private static final Log log = LogFactory.getLog(AccountantHome.class);
      
       @PersistenceContext
       private EntityManager entityManager;
      
       public void persist(Accountant transientInstance) {
       ...
       }
      
       public void remove(Accountant persistentInstance) {
       ...
       }
      
       public Accountant merge(Accountant detachedInstance) {
       ...
       }
      
       public Accountant findById(long id) {
       ...
       }
      }
      


      So this generated class is perfect according to what it said in the article.

      But when I deploy it I get :


      bean class has no local, webservice, or remote interfaces defined and does not implement at least one business interface


      I don't understand why this occure.
      It fails in both JBoss AS and the Microcontainer + Embeddable EJB3 of TestNG.
      I had to create an interface and add the annotation @Local to the interface in order to get a correct deploy.

      Could you tell me what I have missed please ?

      Regards,
      Christophe Laumond,
      M-ITC Ltd,
      Mauritius

        • 1. Re:
          anders.hedstrom

          I haven't read the article @ javaworld you're referring to and I don't really understabd your question.

          But anyway, in EJB 3.0 the home interface is removed but still you need either a Local or Remote business interface or a web service interface to your bean class.

          here's a good place to start: http://trailblazer.demo.jboss.com/EJB3Trail/

          • 2. Re:
            christophe.laumond

            Thanks for you feedback Anders !

            Sorry if I haven't been clear enough in my post.

            If I have well understood what is required and what is not, the generated class is not correct because it's declared as an EJB without implementing Local neither Remote interface.

            So without one of this interface, this EJB is useless.
            Can someone confirm please ?

            I will try to update the Hibernate tool Eclipse plugin and see if this change the generated class.

            Regards,
            Christophe