5 Replies Latest reply on Nov 18, 2004 6:55 AM by Jordi Domingo

    Deploying application in JBoss 4.0.0 - Spec Violation proble

    Peter Slater Newbie

      Has anybody else had this problem?

      I have a very small application that I use to deploy on application servers as a learning experience for myself.
      At the moment this app. contains just a stateless session bean and a single entity bean using CMP.

      When deploying under JBoss 3.2.2 and later 3.2.5 it worked fine... the session and entity beans were deployed as expected and worked.

      However, when I deploy it under 4.0.0 in the standard configuration, I get deployment errors.

      JBoss reports that I have a spec violation for both beans (22.2 in the spec) . Something to do with <ejb-class> should define the path to the bean implementation.

      Does this sound familar to anybody because it is drivign me crazy :)

      Sorry for the vague details - I am writing from my place of work and have for the application with me.

        • 1. Re: Deploying application in JBoss 4.0.0 - Spec Violation pr
          Peter Slater Newbie

          Hello again,

          I am still getting this problem and I don't understand why.
          In case anybody out there can help - I am posting a copy of my ejb-jar file to provide further insight into what i am deploying.

          Thanks again.

          Pete

          <?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 xmlns="http://java.sun.com/xml/ns/j2ee"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
          http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd"
          version="2.1">
          <enterprise-beans>

          <ejb-name>LoginEJB</ejb-name>
          com.peteslater.template.business.ejb.login.LoginHome
          com.peteslater.template.business.ejb.login.LoginRemote
          <ejb-class>com.peteslater.template.business.ejb.login.LoginEJB</ejb-class>
          <session-type>Stateless</session-type>
          <transaction-type>Container</transaction-type>
          <ejb-ref>
          <ejb-ref-name>ejb/CustomerEJB</ejb-ref-name>
          <ejb-ref-type>Entity</ejb-ref-type>
          com.peteslater.template.business.ejb.customer.CustomerHome
          com.peteslater.template.business.ejb.customer.CustomerRemote
          </ejb-ref>


          <ejb-name>CustomerEJB</ejb-name>
          com.peteslater.template.business.ejb.customer.CustomerHome
          com.peteslater.template.business.ejb.customer.CustomerRemote
          <ejb-class>com.peteslater.template.business.ejb.customer.CustomerEJB</ejb-class>
          <persistence-type>Container</persistence-type>
          <prim-key-class>java.lang.Integer</prim-key-class>
          False
          <cmp-version>2.x</cmp-version>
          <abstract-schema-name>Customer</abstract-schema-name>
          <cmp-field><field-name>id</field-name></cmp-field>
          <cmp-field><field-name>firstName</field-name></cmp-field>
          <cmp-field><field-name>lastName</field-name></cmp-field>
          <primkey-field>id</primkey-field>
          <security-identity><use-caller-identity/></security-identity>

          </enterprise-beans>
          <assembly-descriptor>
          <container-transaction>

          <ejb-name>CustomerEJB</ejb-name>
          <method-name>*</method-name>

          <trans-attribute>Supports</trans-attribute>
          </container-transaction>
          </assembly-descriptor>
          </ejb-jar>

          • 2. Re: Deploying application in JBoss 4.0.0 - Spec Violation pr
            Darran Lofthouse Master

            Can you post the actual error and stack trace as well.

            Are all of the classes you use in the jar file you are deploying? Also do any of the classes in your jar refer to classes outside the jar?

            • 3. Re: Deploying application in JBoss 4.0.0 - Spec Violation pr
              Peter Slater Newbie

              OK, i will attach the pertinent area of the stack trace to the bottom of this post.

              All the classes I use are in my business.jar file which is in the ear file I am deploying. As this is just a small test application that I use to learn about new application servers - it references only the MySQL connector jar which I have included in the presentation layers WEB-INF/lib directory.

              What bothers me is that this app works fine in previous jboss versions. I was testing again last night in 3.2.5 to ensure I wasn't going mad but it worked fine. For some reason though, 4.0.0 doesn't like it.

              The error I get during deployment is

              org.jboss.deployment.DeploymentException: Verification of Enterprise Beans failed, see above for error messages.
              at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:553)

              The cause of this seems to be this

              10:48:42,519 WARN [verifier] EJB spec violation:
              Bean : LoginEJB
              Section: 22.2
              Warning: The Bean Provider must specify the fully-qualified name of the Java class that implements the enterprise bean's business methods in the <ejb-class> element.
              Info : Class not found on 'com.peteslater.template.business.ejb.login.LoginEJB': Unexpected error during load of: com.peteslater.template.business.ejb.login.LoginEJB, msg=javax/ejb/SessionBean

              The really annoying thing is - I haven't got an EJB Spec violation from looking at my deployment. I am very confused.

              Regards,

              Pete

              • 4. Re: Deploying application in JBoss 4.0.0 - Spec Violation pr
                Peter Slater Newbie

                It would appear that my problem lies in how i start jboss 4.

                When i deploy my ear file to the standard servers deploy directory and start the server using jboss-ide in eclipse - i get verification errors.

                When i start the server in a shell - it works fine.

                Annoying for sure - but at least it now works.

                Pete

                • 5. Re: Deploying application in JBoss 4.0.0 - Spec Violation pr
                  Jordi Domingo Newbie

                  <ejb-name>LoginEJB</ejb-name>
                  com.peteslater.template.business.ejb.login.LoginHome
                  com.peteslater.template.business.ejb.login.LoginRemote
                  <ejb-class>com.peteslater.template.business.ejb.login.LoginEJB</ejb-class>

                  You should put Home & Remote in its own tag <local-home>XXX</local-home> or whatever

                  Jordi Domingo