10 Replies Latest reply on Jul 20, 2005 5:07 AM by darranl

    EJB Spec violation

    shankar_rao

      hi ,

      When i am deploying my ear in jboss server , it is giving the following exception ........it is unable to find Bean..anybody plz help me
      thanx in advance

      10:05:13,273 INFO [EARDeployer] Init J2EE application: file:/D:/jboss-4.0/serve
      r/default/deploy/test.ear
      10:05:14,039 WARN [verifier] EJB spec violation:
      Bean : TestSessionEJB
      Section: 22.2
      Warning: The Bean Provider must specify the fully-qualified name of the Java cla
      ss that implements the enterprise bean's business methods in the <ejb-class> ele
      ment.
      Info : Class not found on 'TestPackage.impl.TestSessionEJBBean': No ClassLoade
      rs found for: TestPackage.impl.TestSessionEJBBean

      10:05:14,039 ERROR [MainDeployer] could not create deployment: file:/D:/jboss-4.
      0/server/default/tmp/deploy/tmp14616test.ear-contents/test.jar
      org.jboss.deployment.DeploymentException: Verification of Enterprise Beans faile
      d, see above for error messages.
      at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:499)
      at org.jboss.deployment.MainDeployer.create(MainDeployer.java:818)
      at org.jboss.deployment.MainDeployer.create(MainDeployer.java:810)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:672)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:636)
      at sun.reflect.GeneratedMethodAccessor26.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.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.
      java:74)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:45)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:70)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
      java:168)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:469)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:174)
      at $Proxy7.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymen
      tScanner.java:303)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentS
      canner.java:477)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
      doScan(AbstractDeploymentScanner.java:201)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(A
      bstractDeploymentScanner.java:274)
      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:1
      92)
      at sun.reflect.GeneratedMethodAccessor9.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.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.
      java:74)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:45)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:70)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
      java:168)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:469)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceControl
      ler.java:828)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:360)
      at sun.reflect.GeneratedMethodAccessor8.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.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.

        • 1. Re: EJB Spec violation
          jaikiran

          This happens because, the container is NOT able to find, the class correponding to the entry TestPackage.impl.TestSessionEJBBean in ejb-jar.xml. Please post your application.xml, ejb-jar.xml and jboss.xml


          • 2. Re: EJB Spec violation
            shankar_rao

            i am posting my jboss.xml and appliction.xml and ejb-jar.xml


            jboss.xml

            <jboss>
             <enterprise-beans>
             <session>
             <ejb-name>TestSessionEJB</ejb-name>
             <jndi-name>TestSessionEJB</jndi-name>
             </session>
             </enterprise-beans>
            </jboss>
            
            


            application.xml
            <application>
             <display-name>new test</display-name>
             <module>
             <ejb>test.jar</ejb>
             </module>
             <module>
             <web>
             <web-uri>test.war</web-uri>
             </web>
             </module>
             </application>
            
            


            ejb-jar.xml
            <ejb-jar>
             <enterprise-beans>
             <session>
             <description>Session Bean ( Stateless )</description>
             <display-name>TestSessionEJB</display-name>
             <ejb-name>TestSessionEJB</ejb-name>
             <home>TestPackage.TestSessionEJBHome</home>
             <remote>TestPackage.TestSessionEJB</remote>
             <ejb-class>TestPackage.impl.TestSessionEJBBean</ejb-class>
             <session-type>Stateless</session-type>
             <transaction-type>Container</transaction-type>
             </session>
             </enterprise-beans>
            </ejb-jar>
            
            
            



            • 3. Re: EJB Spec violation
              jaikiran

              After seeing the log, i guess your test.jar does NOT contain TestPackage.impl.TestSessionEJBBean. Are you sure that this class file is present in the jar. (P.S.: Be sure that you havent done a typo mistake in specifying the class name in <ejb-class> entry )

              • 4. Re: EJB Spec violation
                shankar_rao

                my Test.jar containg TestPackage.impl.TestSessionEJBBean and even in my ejb-jar.xml the class name between <ejb-class > tag is also correct, where is the actul problem i am not getting......help me

                • 5. Re: EJB Spec violation
                  darranl

                  Can you execute the command 'jar -tf jarname.jar' and show the output here.

                  Also are any classes referenced by your session bean, these may not be available at runtime.

                  • 6. Re: EJB Spec violation
                    shankar_rao

                    my bean is refering to ServiceLocator class where the lookup done,

                    after executing the given command i am posting the out put

                    D:\NewTest\Project1\src>jar -tf test.jar
                    META-INF/
                    META-INF/MANIFEST.MF
                    classes/common/
                    classes/common/EJBHomeFactory.class
                    classes/common/ServiceLocator.class
                    classes/TestPackage/
                    classes/TestPackage/impl/
                    classes/TestPackage/impl/TestSessionEJBBean.class
                    classes/TestPackage/TestAction.class
                    classes/TestPackage/TestActionForm.class
                    classes/TestPackage/TestSessionEJB.class
                    classes/TestPackage/TestSessionEJBHome.class
                    META-INF/application.xml
                    META-INF/ejb-jar.xml

                    • 7. Re: EJB Spec violation
                      darranl

                      The structure of the jar file you have created is not correct, you need to remove the 'classes' folder from the root of the archive. The output from jar -tf should be: -

                      META-INF/
                      META-INF/MANIFEST.MF
                      common/
                      common/EJBHomeFactory.class
                      common/ServiceLocator.class
                      TestPackage/
                      TestPackage/impl/
                      TestPackage/impl/TestSessionEJBBean.class
                      TestPackage/TestAction.class
                      TestPackage/TestActionForm.class
                      TestPackage/TestSessionEJB.class
                      TestPackage/TestSessionEJBHome.class
                      META-INF/ejb-jar.xml

                      (Also the application.xml should not be there but that is not related to the problem).

                      • 8. Re: EJB Spec violation
                        shankar_rao

                        what shud be the dirctory structure of our working folder if we dont want to include classes folder in ***.jar file.

                        current work directory structure is

                        Newtest(root)
                        -->project1
                        /public_html/*.jsp and web-inf
                        --->project1/src/*.java and META-INF

                        • 9. Re: EJB Spec violation
                          shankar_rao

                          what shud be the dirctory structure of our working folder if we dont want to include classes folder in ***.jar file.

                          current work directory structure is

                          Newtest(root)
                          -->project1
                          -- /public_html/*.jsp and web-inf
                          -- /src/*.java and META-INF
                          -- classes/*.class

                          Is there any need to change the directory structure?

                          • 10. Re: EJB Spec violation
                            darranl

                            What are you using to create your jar file?

                            I use Ant to create all of my archives to the project structure is not too important, the jar ant target can be configured to pull contents from different locations correctly.