14 Replies Latest reply on Jul 31, 2006 1:56 PM by rahul sood

    problem trying to deploy a simple helloworldejb.jar

    rahul sood Newbie

      Whenever I triy to deploy my helloworldejb.jar, i get the following exception - I have looked everywhere in the forum and out of forum but cannot figure out what the problem is. If someone can help me I will appreciate it. Right after the error I have also pasted the contents of my ejb-jar.xml and jboss.xml
      09:20:24,239 ERROR [MainDeployer] could not create deployment: file:/C:/jboss-3.
      2.3/server/default/deploy/HelloWorldEJB.jar
      org.jboss.deployment.DeploymentException: Verification of Enterprise Beans faile
      d, see above for error messages.
      at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:491)
      at org.jboss.deployment.MainDeployer.create(MainDeployer.java:786)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:641)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:605)
      at sun.reflect.GeneratedMethodAccessor28.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:546)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy6.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:201)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
      loop(AbstractDeploymentScanner.java:212)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
      run(AbstractDeploymentScanner.java:191)

      contents of ejb-jar.xml<?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN' 'http://java.sun.com/dtd/ejb-jar_2_0.dtd'>
      <ejb-jar>
      <display-name>
      HelloWorldEJB</display-name>
      <enterprise-beans>

      <ejb-name>Hello</ejb-name>
      examples.HelloHome
      examples.Hello
      <ejb-class>examples.HelloBean</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Container</transaction-type>

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

      contents of jboss.xml<?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 3.0//EN" "http://www.jboss.org/j2ee/dtd/jboss_3_0.dtd">



      <enterprise-beans>

      <!--
      To add beans that you have deployment descriptor info for, add
      a file to your XDoclet merge directory called jboss-beans.xml that contains
      the , and <message-driven></message-driven>
      markup for those beans.
      -->


      <ejb-name>Hello</ejb-name>
      <jndi-name>ejb/Hello</jndi-name>



      <!--
      write a merge file jboss-webservices.ent for webservice-description
      -->

      </enterprise-beans>

      <resource-managers>
      </resource-managers>

      <!--
      | for container settings, you can merge in jboss-container.xml
      | this can contain <invoker-proxy-bindings/> and <container-configurations/>
      -->

        • 1. Re: problem trying to deploy a simple helloworldejb.jar
          jaikiran pai Master

           

          org.jboss.deployment.DeploymentException: Verification of Enterprise Beans failed, see above for error messages.


          Post the entire stack trace that you are seeing. Also, post the contents of your ejb-jar.xml and jboss.xml since they did not show up properly the last time. Make sure you wrap the contents in the Code tags(use the Code button, which is provided above while posting)



          • 2. Re: problem trying to deploy a simple helloworldejb.jar
            rahul sood Newbie

             

            09:04:17,649 INFO [SARDeployer] Started jboss.system:service=ServiceDeployer
            09:04:17,649 INFO [Server] Core system initialized
            09:04:17,659 INFO [MainDeployer] Starting deployment of package: file:/C:/jboss
            -3.2.3/server/default/conf/jboss-service.xml
            09:04:20,193 INFO [Log4jService$URLWatchTimerTask] Configuring from URL: resour
            ce:log4j.xml
            09:04:25,721 INFO [STDOUT] Apache Tomcat/4.1.29
            09:04:26,843 INFO [Http11Protocol] Initializing Coyote HTTP/1.1 on port 8080
            09:04:26,873 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on port 8080
            09:04:27,103 INFO [ChannelSocket] JK2: ajp13 listening on /0.0.0.0:8009
            09:04:27,123 INFO [JkMain] Jk running ID=0 time=0/80 config=null
            09:20:24,239 ERROR [MainDeployer] could not create deployment: file:/C:/jboss-3.
            2.3/server/default/deploy/HelloWorldEJB.jar
            org.jboss.deployment.DeploymentException: Verification of Enterprise Beans faile
            d, see above for error messages.
             at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:491)
             at org.jboss.deployment.MainDeployer.create(MainDeployer.java:786)
             at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:641)
             at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:605)
             at sun.reflect.GeneratedMethodAccessor28.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:546)
             at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
             at $Proxy6.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:201)
             at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
            loop(AbstractDeploymentScanner.java:212)
             at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
            run(AbstractDeploymentScanner.java:191)


            Contents of my ejb-jar.xml

            <?xml version="1.0" encoding="UTF-8"?>
            <!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN' 'http://java.sun.com/dtd/ejb-jar_2_0.dtd'>
             <ejb-jar>
             <display-name>
             HelloWorldEJB</display-name>
             <enterprise-beans>
             <session>
             <ejb-name>Hello</ejb-name>
             <home>examples.HelloHome</home>
             <remote>examples.Hello</remote>
             <ejb-class>examples.HelloBean</ejb-class>
             <session-type>Stateless</session-type>
             <transaction-type>Container</transaction-type>
             </session>
             </enterprise-beans>
             </ejb-jar>




            contents of my jboss.xml
            <?xml version="1.0" encoding="UTF-8"?>
            <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 3.0//EN" "http://www.jboss.org/j2ee/dtd/jboss_3_0.dtd">
            
            <jboss>
            
             <enterprise-beans>
            
             <!--
             To add beans that you have deployment descriptor info for, add
             a file to your XDoclet merge directory called jboss-beans.xml that contains
             the <session></session>, <entity></entity> and <message-driven></message-driven>
             markup for those beans.
             -->
            
             <session>
             <ejb-name>Hello</ejb-name>
             <jndi-name>ejb/Hello</jndi-name>
            
             </session>
            
             <!--
             write a merge file jboss-webservices.ent for webservice-description
             -->
            
             </enterprise-beans>
            
             <resource-managers>
             </resource-managers>
            
             <!--
             | for container settings, you can merge in jboss-container.xml
             | this can contain <invoker-proxy-bindings/> and <container-configurations/>
             -->
            
            </jboss>











            • 3. Re: problem trying to deploy a simple helloworldejb.jar
              jaikiran pai Master

               

              09:20:24,239 ERROR [MainDeployer] could not create deployment: file:/C:/jboss-3.
              2.3/server/default/deploy/HelloWorldEJB.jar
              org.jboss.deployment.DeploymentException: Verification of Enterprise Beans failed, see above for error messages.


              Hmm... Strange there are no errors messages above this stacktrace.
              Traverse to C:/jboss-3.2.3/server/default/deploy/ directory from the command prompt and run the following command and post the output:

              jar -tf HelloWorldEJB.jar


              This will show the contents of the jar file. Just wanted to make sure that the packaging is proper



              • 4. Re: problem trying to deploy a simple helloworldejb.jar
                rahul sood Newbie

                Here are the contents of my jar file..as asked by you ..i ran the jar -tf command

                META-INF/MANIFEST.MF
                examples/HelloBean.class
                META-INF/ejb-jar.xml
                examples/HelloHome.class
                examples/Hello.class
                examples/
                META-INF/jboss.xml
                /


                • 5. Re: problem trying to deploy a simple helloworldejb.jar
                  rahul sood Newbie

                  Do I have to do anything with Jndi ?
                  in jboss.xml file i have said that the jndi name is jndi/Hello

                  Do I need to register this anywhere in the Java Naming Directory implementation provided by Jboss or is it done automatically?

                  • 6. Re: problem trying to deploy a simple helloworldejb.jar
                    jaikiran pai Master

                     

                    Do I need to register this anywhere in the Java Naming Directory implementation provided by Jboss or is it done automatically?


                    You dont have to do anything with that. JBoss will automatically bind your bean to that jndi name.
                    How big is that jar file? If its not huge, mail it to jai_forums2005@yahoo.co.in. Let me try it at my end.



                    • 7. Re: problem trying to deploy a simple helloworldejb.jar
                      jaikiran pai Master

                       

                      How big is that jar file? If its not huge


                      Silly me :-) Shouldn't have asked it since you already posted it contents.
                      Go ahead and mail it to my address.


                      • 9. Re: problem trying to deploy a simple helloworldejb.jar
                        jaikiran pai Master

                        Tried deploying the jar that you sent and got the following exception while deploying:

                        2006-07-31 20:19:37,842 [] WARN [org.jboss.ejb.EJBDeployer.verifier] EJB spec violation:
                         Bean : Hello
                         Section: 7.10.3
                         Warning: A Session bean must define at least one ejbCreate method.
                        
                        2006-07-31 20:19:37,889 [] ERROR [org.jboss.deployment.MainDeployer] could not create deployment: file:/E:/puthere/NewFolder/jboss-3.2.3/server/default/deploy/HelloWorldEJB.jar
                        org.jboss.deployment.DeploymentException: Verification of Enterprise Beans failed, see above for error messages.
                         at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:491)
                         at org.jboss.deployment.MainDeployer.create(MainDeployer.java:786)
                         at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:641)
                         at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:605)
                         at sun.reflect.GeneratedMethodAccessor24.invoke(Unknown Source)
                         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                         at java.lang.reflect.Method.invoke(Method.java:324)
                         at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
                         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
                         at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
                         at $Proxy6.deploy(Unknown Source)
                         at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:302)
                         at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:476)
                         at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:201)
                         at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:274)
                         at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:192)
                         at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
                         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                         at java.lang.reflect.Method.invoke(Method.java:324)
                         at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
                         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
                         at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:976)
                         at $Proxy0.start(Unknown Source)
                         at org.jboss.system.ServiceController.start(ServiceController.java:394)
                         at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
                         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                         at java.lang.reflect.Method.invoke(Method.java:324)
                         at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
                         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
                         at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
                         at $Proxy4.start(Unknown Source)
                         at org.jboss.deployment.SARDeployer.start(SARDeployer.java:226)
                         at org.jboss.deployment.MainDeployer.start(MainDeployer.java:832)
                         at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:642)
                         at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:605)
                         at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:589)
                         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                         at java.lang.reflect.Method.invoke(Method.java:324)
                         at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
                         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
                         at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
                         at $Proxy5.deploy(Unknown Source)
                         at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:384)
                         at org.jboss.system.server.ServerImpl.start(ServerImpl.java:291)
                         at org.jboss.Main.boot(Main.java:150)
                         at org.jboss.Main$1.run(Main.java:395)
                         at java.lang.Thread.run(Thread.java:534)


                        which means that you have not defined the ejbCreate method in your HelloBean class. Provide a blank implementation for the same, in your HelloBean class and deploy it:

                        public void ejbCreate()
                         {
                         }


                        That should work.



                        • 10. Re: problem trying to deploy a simple helloworldejb.jar
                          rahul sood Newbie

                          ok i will try that..here help me with the theory behind this..i used to know it..have kind of gotten confused..
                          the way it works is that create method is called by the container automatically for us...if we want to do anything special during the creation of the bean we should do that in ejbCreate which is called by create..right ?

                          • 11. Re: problem trying to deploy a simple helloworldejb.jar
                            jaikiran pai Master

                            The ejbCreate method will be called when the client invokes the create() method on the home interface. The lifecycle of the EJB is explained here:

                            http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/EJBConcepts9.html

                            As per the specs:

                            The session bean class must define one or more ejbCreate<METHOD> 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> method on the session bean?s remote home interface.
                            ? A stateless session bean must define a single ejbCreate method, with no arguments.
                            ? The throws clause may define arbitrary application exceptions, possibly including the javax.ejb.CreateException.






                            • 12. Re: problem trying to deploy a simple helloworldejb.jar
                              rahul sood Newbie

                              why was my jboss server not displaying errors...any idea.

                              • 13. Re: problem trying to deploy a simple helloworldejb.jar
                                jaikiran pai Master

                                 

                                "rsood72" wrote:
                                why was my jboss server not displaying errors...any idea.


                                Looks like some changes were made in your log4j.xml which might have disabled logging for the org.jboss.ejb.EJBDeployer class. The log4j.xml is present in %JBOSS_HOME%/server/default/conf directory.



                                • 14. Re: problem trying to deploy a simple helloworldejb.jar
                                  rahul sood Newbie

                                  Thank you for your help..i got new insights and found new things that I need to learn .