1 Reply Latest reply on Nov 16, 2006 8:56 PM by Russ

    Deploying EJBs to JBOSS 4.0.5

    Russ Newbie

      We are trying to port the source code for a EJB project to MyEclipse. What we have done is taken the source code and created an XDoclet for generating the stubs and skeltons classes. We are able to compile and build/deploy projects, but when the server starts up we get this error:

      15:58:33,779 INFO [EARDeployer] Init J2EE application: file:/C:/jboss-4.0.5.GA/server/default/deploy/Project.ear/
      15:58:36,076 WARN [verifier] EJB spec violation:
      Bean : _SessionBean_Stub
      Section: 7.10.3
      Warning: A Session bean must define at least one ejbCreate method.
      15:58:36,623 ERROR [MainDeployer] Could not create deployment: file:/C:/jboss-4.0.5.GA/server/default/deploy/PowerImage.ear/ProjectEJB.jar/
      org.jboss.deployment.DeploymentException: Verification of Enterprise Beans failed, see above for error messages.
       at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:610)

      Where we go looking for answers I get this explaination to my problem:

      Your session bean class must contain the following method:
      public void ejbCreate() throws CreateException{
      Copied and pasted from the ejb spec section 7.10.3
      7.10.3 ejbCreate methods
      The session bean class must define one or more ejbCreate(...) methods whose signatures
      must follow these rules:
      Â? The method name must have ejbCreate as its prefix.
      Â? The method must be declared as public.
      Â? The method must not be declared as final or static.
      Â? The return type must be void.
      Â? The method arguments must be legal types for RMI/IIOP if there is a create<
      METHOD>(...) corresponding to the ejbCreate(...) method on the
      session beanÂ?s remote home interface.
      Â? The throws clause may define arbitrary application exceptions, possibly including the
      Compatibility Note: EJB 1.0 allowed the ejbCreate method to throw the java.rmi.RemoteException
      to indicate a non-application exception. This practice was deprecated in EJB 1.1Â?an EJB 1.1 or
      EJB 2.0 compliant enterprise bean should throw the javax.ejb.EJBException or another RuntimeException
      to indicate non-application exceptions to the Container (see Section 18.2.2). An EJB 2.0 compliant
      enterprise bean should not throw the java.rmi.RemoteException from the ejbCreate method .
      Kabir Khan
      JBoss AOP Lead
      JBoss, a division of Red Hat

      The session section for XDoclet is checked.

      Can you shed some light on this?

      We added the ejbCreate method with the throws CreateException in the Session Beans and I am still getting the error.

      I am at a lost on how to proceed? Any suggestions?