5 Replies Latest reply on Jul 15, 2004 11:01 AM by nsr_250

    Deploying CMP to JBoss

    nsr_250 Newbie

      Hi,

      I got the following error messages when deploying a simple CMP to JBoss, any help will be appreciated:

      16:29:54,378 INFO [MainDeployer] Starting deployment of package: file:/C:/jboss-3.2.3/server/default/deploy/ContentManagement.ear
      16:29:54,398 INFO [EARDeployer] Init J2EE application: file:/C:/jboss-3.2.3/server/default/deploy/ContentManagement.ear
      16:29:54,769 INFO [EjbModule] Deploying UserBeanCM
      16:29:54,869 INFO [EjbModule] Deploying UserManagementBean
      16:29:58,644 WARN [ServiceController] Problem starting service jboss.j2ee:jndiName=local/UserBeanCM,service=EJB
      java.lang.NoSuchMethodError: org.apache.bcel.generic.InstructionFactory.createNewArray(Lorg/apache/bcel/generic/Type;S)Lorg/apache/bcel/generic/Instruction;
      at org.jboss.proxy.compiler.ProxyImplementationFactory.createProxyMethod(ProxyImplementationFactory.java:319)
      at org.jboss.proxy.compiler.ProxyCompiler.getCode(ProxyCompiler.java:167)
      at org.jboss.proxy.compiler.Runtime.makeProxyType(Runtime.java:66)
      at org.jboss.proxy.compiler.ProxyCompiler.(ProxyCompiler.java:76)
      at org.jboss.proxy.compiler.Proxies$Impl.newTarget(Proxies.java:603)
      at org.jboss.proxy.compiler.Proxies.newTarget(Proxies.java:78)
      at org.jboss.proxy.compiler.Proxy.newProxyInstance(Proxy.java:49)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateBeanClassInstanceCommand.(JDBCCreateBeanClassInstanceCommand.java:62)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCCommandFactory.createCreateBeanClassInstanceCommand(JDBCCommandFactory.java:123)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.startStoreManager(JDBCStoreManager.java:463)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManager.java:388)
      at org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManager.java:152)
      at org.jboss.ejb.EntityContainer.startService(EntityContainer.java:342)
      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:192)
      at sun.reflect.GeneratedMethodAccessor28.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 $Proxy14.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:394)
      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.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy79.start(Unknown Source)
      at org.jboss.ejb.EjbModule.startService(EjbModule.java:331)
      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:192)
      at sun.reflect.GeneratedMethodAccessor28.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 $Proxy14.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:394)
      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.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy12.start(Unknown Source)
      at org.jboss.ejb.EJBDeployer.start(EJBDeployer.java:544)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:832)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:824)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:642)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:605)
      at sun.reflect.GeneratedMethodAccessor19.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$ScannerThread.loop(AbstractDeploymentScanner.java:212)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:191)
      16:29:58,704 WARN [EjbUtil] Can't locate deploymentInfo for target: file:/C:/jboss-3.2.3/server/default/tmp/deploy/tmp28250ContentManagement.ear-contents/userEntity.jar
      16:29:58,925 INFO [StatefulSessionInstancePool] Started jboss.j2ee:jndiName=ejb/UserManagement,plugin=pool,service=EJB
      16:29:58,925 INFO [StatefulSessionFilePersistenceManager] Started null
      16:29:58,925 INFO [StatefulSessionContainer] Started jboss.j2ee:jndiName=ejb/UserManagement,service=EJB
      16:29:58,925 INFO [EjbModule] Started jboss.j2ee:module=UserEJB.jar,service=EjbModule
      16:29:58,925 INFO [EJBDeployer] Deployed: file:/C:/jboss-3.2.3/server/default/tmp/deploy/tmp28250ContentManagement.ear-contents/UserEJB.jar
      16:29:58,985 INFO [EARDeployer] Started J2EE application: file:/C:/jboss-3.2.3/server/default/deploy/ContentManagement.ear
      16:29:58,995 INFO [MainDeployer] Deployed package: file:/C:/jboss-3.2.3/server/default/deploy/ContentManagement.ear

      Thanks,
      Andy

        • 1. ejb-jar.xml
          nsr_250 Newbie

          <?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>user-mgmt-beans</display-name>
          <enterprise-beans>


          <display-name>UserManagementBean</display-name>
          <ejb-name>UserManagementBean</ejb-name>

          com.rickhightower.auth.UserManagementHome
          com.rickhightower.auth.UserManagement
          <ejb-class>com.rickhightower.auth.UserManagementBean</ejb-class>

          <session-type>Stateful</session-type>
          <transaction-type>Container</transaction-type>

          <ejb-local-ref>
          <ejb-ref-name>ejb/LocalUser</ejb-ref-name>
          <ejb-ref-type>Entity</ejb-ref-type>
          <local-home>com.rickhightower.auth.LocalUserHome</local-home>
          com.rickhightower.auth.LocalUser
          <ejb-link>userEntity.jar#UserBean</ejb-link>
          </ejb-local-ref>


          <display-name>UserBean</display-name>
          <ejb-name>UserBeanCM</ejb-name>

          <local-home>com.rickhightower.auth.LocalUserHome</local-home>
          com.rickhightower.auth.LocalUser
          <ejb-class>com.rickhightower.auth.UserBean</ejb-class>

          <persistence-type>Container</persistence-type>
          <prim-key-class>java.lang.String</prim-key-class>

          True
          <cmp-version>2.x</cmp-version>

          <abstract-schema-name>UserBean</abstract-schema-name>

          <cmp-field>
          no description
          <field-name>password</field-name>
          </cmp-field>
          <cmp-field>
          no description
          <field-name>email</field-name>
          </cmp-field>

          <primkey-field>email</primkey-field>




          </enterprise-beans>
          <assembly-descriptor>
          <method-permission>


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

          </method-permission>
          <container-transaction>

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

          <trans-attribute>Required</trans-attribute>
          </container-transaction>
          </assembly-descriptor>

          </ejb-jar>

          • 2. jboss.xml
            nsr_250 Newbie

            <?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>UserManagementBean</ejb-name>
            <jndi-name>ejb/UserManagement</jndi-name>


            <ejb-name>UserBeanCM</ejb-name>
            <jndi-name>ejb/LocalUser</jndi-name>

            </enterprise-beans>

            <resource-managers>
            </resource-managers>


            • 3. jbosscmp-jdbc.xml
              nsr_250 Newbie

              <?xml version="1.0" encoding="UTF-8"?>

              <!DOCTYPE jbosscmp-jdbc PUBLIC
              "-//JBoss//DTD JBOSSCMP-JDBC 3.0//EN"
              "http://www.jboss.org/j2ee/dtd/jbosscmp-jdbc_3_0.dtd">

              <jbosscmp-jdbc>

              java:/DefaultDS
              <datasource-mapping>Hypersonic SQL</datasource-mapping>
              <create-table>true</create-table>
              <remove-table>true</remove-table>
              <pk-constraint>true</pk-constraint>
              <preferred-relation-mapping>foreign-key</preferred-relation-mapping>


              <enterprise-beans>


              <ejb-name>UserBeanCM</ejb-name>
              <table-name>UserBean</table-name>

              <cmp-field>
              <field-name>email</field-name>
              <column-name>email</column-name>
              </cmp-field>
              <cmp-field>
              <field-name>password</field-name>
              <column-name>password</column-name>
              </cmp-field>



              </enterprise-beans>






              <dependent-value-classes>

              </dependent-value-classes>


              </jbosscmp-jdbc>

              • 4. Re: Deploying CMP to JBoss
                Alexey Loubyansky Master

                JBoss uses BCEL for proxy generation. Is there another (application) version of BCEL somewhere in classpath?

                • 5. Re: Deploying CMP to JBoss
                  nsr_250 Newbie

                  I followed the suggestion in http://www.jboss.org/wiki/Wiki.jsp?page=NukesDeploymentErrors and it is working now. Just curious why Session bean is working but CMP throws the above exception? I got the same setting for both projects (using Eclipse 2.x with Jboss IDE)

                  Thanks,
                  Andy