4 Replies Latest reply on Mar 10, 2005 1:10 PM by Darran Lofthouse

    ejbCreate with parameters for Stateless Session Bean

    enterprisejavabones Newbie

      Hi,

      I've been trying to create a Stateless Session Bean that has an ejbCreate method that takes some parameters. I'm using JBoss 3.0.8 and was wondering if this is just a version limitation or am i doing something wrong.

      my code looks something like

       public void ejbCreate(String param1, String param2 ) {
       this.param1 = param1;
       this.param2 = param2;
      
       }
      


      When i try to deploy, i get the following

      java.lang.NoSuchMethodException: org.jboss.ejb.StatelessSessionContainer.createHome(java.lang.String, java.lang.String)

      According to the EJB 2.1 Spec (Sec 7.11.3, p110), we should be able to define ejbCreate methods in Session Beans that take parameters. Is it just that 3.0.8 is based on an older version of the EJB spec that didn't allow ejbCreate methods to take arguments?

      btw, i have also provided a default ejbCreate method that takes no parameters.

      Thanks in advance

      Cheers
      Prem