4 Replies Latest reply on Jun 2, 2003 9:49 AM by pipo

    EJB Deployement Error

    pipo Newbie

      Hello,

      I try to develop a simple EJB example (the Helloworld example). But I have got errors (see the end of this message) when I put my jar file in the deploy directory of JBoss. I dont' know where it is wrong!

      (BTW I havn't use xdoclet or ant to generate my files)
      Thank you for your kind assistance.


      11:57:33,171 INFO [MainDeployer] Starting deployment of package: file:/C:/Java/
      jboss-3.2.1_tomcat-4.1.24/server/default/deploy/HelloWorld.jar
      11:57:33,406 WARN [verifier] EJB spec violation:
      Bean : HelloWorld
      Section: 16.2
      Warning: The Bean Provider must specify the fully-qualified name of the Java cla
      ss that implements the enterprise bean's business methods.

      11:57:33,406 WARN [verifier] EJB spec violation:
      Bean : HelloWorld
      Section: 16.2
      Warning: The Bean Provider must specify the fully-qualified name of the enterpri
      se bean's home interface in the home element.

      11:57:33,406 WARN [verifier] EJB spec violation:
      Bean : HelloWorld
      Section: 16.2
      Warning: The Bean Provider must specify the fully-qualified name of the enterpri
      se bean's remote interface in the remote element.

      11:57:33,406 ERROR [MainDeployer] could not create deployment: file:/C:/Java/jbo
      ss-3.2.1_tomcat-4.1.24/server/default/deploy/HelloWorld.jar
      org.jboss.deployment.DeploymentException: Verification of Enterprise Beans faile
      d, see above for error messages.
      at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:487)
      at org.jboss.deployment.MainDeployer.create(MainDeployer.java:784)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:639)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:613)
      at sun.reflect.GeneratedMethodAccessor34.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
      nDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy7.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymen
      tScanner.java:302)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentS
      canner.java:476)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
      doScan(AbstractDeploymentScanner.java:200)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
      loop(AbstractDeploymentScanner.java:211)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
      run(AbstractDeploymentScanner.java:190)
      11:57:33,421 ERROR [URLDeploymentScanner] Failed to deploy: org.jboss.deployment
      .scanner.URLDeploymentScanner$DeployedURL@8ed79a62{ url=file:/C:/Java/jboss-3.2.
      1_tomcat-4.1.24/server/default/deploy/HelloWorld.jar, deployedLastModified=0 }
      org.jboss.deployment.DeploymentException: Verification of Enterprise Beans faile
      d, see above for error messages.
      at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:487)
      at org.jboss.deployment.MainDeployer.create(MainDeployer.java:784)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:639)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:613)
      at sun.reflect.GeneratedMethodAccessor34.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
      nDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy7.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymen
      tScanner.java:302)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentS
      canner.java:476)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
      doScan(AbstractDeploymentScanner.java:200)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
      loop(AbstractDeploymentScanner.java:211)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
      run(AbstractDeploymentScanner.java:190)

        • 1. Re: EJB Deployement Error
          Jon Barnett Master

          The deployer is complaining because you have not provided fully qualified names for the interfaces of your EJB. This is required to be placed in a file called ejb-jar.xml located in META-INF of the bean's jar. An example of a simple EJB declaration is:

          <?xml version="1.0"?>
          <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/j2ee/dtds/ejb-jar_2_0.dtd">
          <ejb-jar>
          Cards Bean
          <enterprise-beans>

          <display-name>Cards</display-name>
          Cards Bean
          <ejb-name>Cards</ejb-name>
          com.amity.cards.CardsHome
          com.amity.cards.Cards
          <ejb-class>com.amity.cards.CardsBean</ejb-class>
          <session-type>Stateless</session-type>
          <transaction-type>Bean</transaction-type>

          </enterprise-beans>
          </ejb-jar>

          Note that you have fully qualified class names (package name is appended to the class name) for the Home and Remote interfaces as well as the Bean's implementation class (ejb-class). There should be an example for your HelloWorld tutorial on constructing the ejb-jar.xml file.

          • 2. Re: EJB Deployement Error
            pipo Newbie

            Thank you for your reply
            but here is my xml file:

            <?xml version="1.0" ?>
            <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/j2ee/dtds/ejb-jar_2_0.dtd">


            <ejb-jar>

            <enterprise-beans>
            JBoss Hello World Application
            <display-name>Hello World EJB</display-name>




            <ejb-name>HelloWorld</ejb-name>
            TestJBOSS.HelloWorldHome
            TestJBOSS.HelloWorld
            <ejb-class>TestJBOSS.HelloWorldBean</ejb-class>
            <session-type>Stateless</session-type>
            <transaction-type>Bean</transaction-type>



            </enterprise-beans>

            </ejb-jar>

            apparently it seems to be correct ??

            I have put all my files in TestJBOSS directory and in TestJBOSS/META-INF directory the ejb-jar.xml.

            Thank you

            • 3. Re: EJB Deployement Error
              Jon Barnett Master

              The ejb-jar.xml looks well-formed but from what you say, is in the wrong place.

              In the Java source for your Bean classes do you declare the package as TestJBOSS?

              e.g.

              package TestJBOSS;

              Your directory structure in the jar should be

              |- META-INF
              | +- ejb-jar.xml
              |
              |-TestJBOSS
              +- HelloWorld
              +- HelloWorldHome
              +- HelloWorldBean

              That is, the META-INF is from the root of the jar, not from TestJBOSS.

              • 4. Re: EJB Deployement Error
                pipo Newbie

                Thank you that was the reason of my error :)