4 Replies Latest reply on Nov 29, 2011 2:00 PM by Wolf-Dieter Fink

    Error migrating EJB2 app from 4.x to 6.x

    Aaron Sheffey Newbie

      I'm migrating an app which uses EJB2 session beans and MDBs from JBoss 4.x to 6.x.  The session beans load fine, but the MDBs are throwing the following type of exception at deployment:

       

      13:39:49,483 ERROR [AbstractKernelController] Error installing to Create: name=jboss.j2ee:jndiName=local/MyMDB@14856964,service=EJB state=Configured mode=Manual requiredState=Create: java.lang.UnsupportedOperationException: Message driven beans are not bound into remote jndi

          at org.jboss.metadata.MessageDrivenMetaData.getJndiName(MessageDrivenMetaData.java:400) [:2.0.0-alpha-30]

          at org.jboss.ejb.plugins.MetricsInterceptor.setContainer(MetricsInterceptor.java:96) [:6.1.0.Final]

          at org.jboss.ejb.MessageDrivenContainer.createService(MessageDrivenContainer.java:241) [:6.1.0.Final]

          at org.jboss.system.ServiceMBeanSupport.jbossInternalCreate(ServiceMBeanSupport.java:323) [:6.1.0.Final (Build SVNTag:JBoss_6.1.0.Final date: 20110816)]

          at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:299) [:6.1.0.Final (Build SVNTag:JBoss_6.1.0.Final date: 20110816)]

          at sun.reflect.GeneratedMethodAccessor277.invoke(Unknown Source) [:1.6.0_18]

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_18]

          at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_18]

          at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157) [:6.0.0.GA]

          at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96) [:6.0.0.GA]

          at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) [:6.0.0.GA]

          at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:271) [:6.0.0.GA]

          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:670) [:6.0.0.GA]

          at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:189) [:2.2.0.SP2]

          at $Proxy41.create(Unknown Source)    at org.jboss.system.microcontainer.CreateDestroyLifecycleAction.installAction(CreateDestroyLifecycleAction.java:54) [:2.2.0.SP2]

       

      Is there something in the jboss.xml configuration which I need to change?

        • 1. Re: Error migrating EJB2 app from 4.x to 6.x
          Wolf-Dieter Fink Master

          I suppose it works (without change) for JBoss4?

          How do you create the MDB, use XDoclet?

          Please attach the source of MDB and the relevant part of the descriptors.

          Also the exact version of 4.x and 6.x might be helpful.  (I'm confused about the different versions in stacktrace, might be normal as I worked not with AS6)

           

          What if you remove the MDB from your archive? Does it starts correct?

          • 2. Re: Error migrating EJB2 app from 4.x to 6.x
            Aaron Sheffey Newbie

            Yes, built with XDoclet, and the same exact JAR deploys without issue on JBoss 4.0.2.  On 6.1.0 it throws the above error.  Without the MDBs, all is well on 6.

             

            Here are some config snippets:

             

            jboss.xml:

            <message-driven>

                <ejb-name>MyMDB</ejb-name>                      

                <destination-jndi-name>queue/MyQueue</destination-jndi-name>

                <configuration-name>SomeConfig</configuration-name>

            </message-driven>

            <container-configuration>

                <container-name>SomeConfig</container-name>

                <call-logging>false</call-logging>

                <invoker-proxy-binding-name>message-driven-bean</invoker-proxy-binding-name>

                <container-interceptors>

                    <interceptor>org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor</interceptor>

                    <interceptor>org.jboss.ejb.plugins.LogInterceptor</interceptor>

                    <interceptor>org.jboss.ejb.plugins.RunAsSecurityInterceptor</interceptor>

                    <!-- CMT -->

                    <interceptor transaction="Container">org.jboss.ejb.plugins.TxInterceptorCMT</interceptor>

                    <interceptor transaction="Container" metricsEnabled="true">org.jboss.ejb.plugins.MetricsInterceptor</interceptor>

                    <interceptor transaction="Container">org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor</interceptor>

                    <!-- BMT -->

                    <interceptor transaction="Bean">org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor</interceptor>

                    <interceptor transaction="Bean">org.jboss.ejb.plugins.MessageDrivenTxInterceptorBMT</interceptor>

                    <interceptor transaction="Bean" metricsEnabled="true">org.jboss.ejb.plugins.MetricsInterceptor</interceptor>

                    <interceptor>org.jboss.resource.connectionmanager.CachedConnectionInterceptor</interceptor>

                </container-interceptors>

                <instance-pool>org.jboss.ejb.plugins.MessageDrivenInstancePool</instance-pool>

                <instance-cache/>

                <persistence-manager/>

                <container-pool-conf>

                    <MinimumSize>1</MinimumSize>

                    <MaximumSize>1</MaximumSize>

                    <strictMaximumSize>true</strictMaximumSize>

                </container-pool-conf>

            </container-configuration>

             

            ejb-jar.xml:

            <message-driven >

                <description><![CDATA[MyMDB]]></description>

                <display-name>MyMDB</display-name>

                <ejb-name>MyMDB</ejb-name>

                <ejb-class>com.foo.MyMDB</ejb-class>

                <transaction-type>Bean</transaction-type>

                <acknowledge-mode>Auto-acknowledge</acknowledge-mode>

                <message-driven-destination>

                    <destination-type>javax.jms.Queue</destination-type>

                </message-driven-destination>

                <security-identity>

                <description><![CDATA[]]></description>

                <run-as>

                    <description><![CDATA[]]></description>

                    <role-name>foo</role-name>

                </run-as>

                </security-identity>

            </message-driven>

            • 3. Re: Error migrating EJB2 app from 4.x to 6.x
              Aaron Sheffey Newbie

              Figured out how to get the MDBs to deploy, by overwriting the jboss.xml snippet above with the example xml from standardjboss.xml.  Now the  issue is how to generate that proper xml from XDoclet.

              1 of 1 people found this helpful
              • 4. Re: Error migrating EJB2 app from 4.x to 6.x
                Wolf-Dieter Fink Master

                As I see you include the container-configuration in your jboss.xml.

                You should not do such to be independent of container version.

                Normaly this is by having a XDoclet merge directory with the config.