8 Replies Latest reply on Aug 30, 2011 8:38 AM by Sumeeth Tewar

    Exception during deployment of MDB which used to work in AS 4.2.3

    Dattaram Porob Newbie

      I get the following exception when trying to deploy a MDB in AS 7.

      07:14:20,218 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC00001: Failed to start service jboss.deployment.subunit."test.ear"."comp1.jar".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.subunit."test.ear"."comp1.jar".INSTALL: Failed to process phase INSTALL of subdeployment "comp1.jar" of deployment "test.ear"         at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:121)         at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1765)         at org.jboss.msc.service.ServiceControllerImpl$ClearTCCLTask.run(ServiceControllerImpl.java:2291)         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_11]         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_11]         at java.lang.Thread.run(Thread.java:619) [:1.6.0_11] Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: Failed to install component org.jboss.as.ee.component.ComponentConfiguration[name=testMDB class=com.test.service.testMDB]         at org.jboss.as.ee.component.ComponentInstallProcessor.deploy(ComponentInstallProcessor.java:77)         at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115)         ... 5 more Caused by: java.lang.IllegalArgumentException: name is null         at org.jboss.msc.service.ServiceBuilderImpl.doAddDependency(ServiceBuilderImpl.java:203)         at org.jboss.msc.service.ServiceBuilderImpl.addDependency(ServiceBuilderImpl.java:197)         at org.jboss.msc.service.ServiceBuilderImpl.addDependency(ServiceBuilderImpl.java:191)         at org.jboss.as.ejb3.deployment.processors.EjbInjectionSource.getResourceValue(EjbInjectionSource.java:70)         at org.jboss.as.ee.component.ComponentInstallProcessor.processBindings(ComponentInstallProcessor.java:208)         at org.jboss.as.ee.component.ComponentInstallProcessor.access$000(ComponentInstallProcessor.java:53)         at org.jboss.as.ee.component.ComponentInstallProcessor$1.handle(ComponentInstallProcessor.java:173)         at org.jboss.as.ee.component.ClassDescriptionTraversal.run(ClassDescriptionTraversal.java:52)         at org.jboss.as.ee.component.ComponentInstallProcessor.deployComponent(ComponentInstallProcessor.java:170)         at org.jboss.as.ee.component.ComponentInstallProcessor.deploy(ComponentInstallProcessor.java:75)         ... 6 more

      This MDB used to get deployed without any issues in JBoss AS 4.2.3. The MDB class looks something like this:

       

      @MessageDriven (mappedName="java:/jms/testQueue",

      activationConfig={@ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"),

      @ActivationConfigProperty(

      propertyName="destination", propertyValue="java:/jms/testQueue")},

      messageListenerInterface=MessageListener.class)

      public class testMDB extends ParentMDB {
      }

       

      //And the parent class... (packaged in a separate ejb module which is part of the same EAR)

      public abstract class ParentMDB implements MessageListener{

       

      public void onMessage(final Message message){

      }

       

      }

       

      I believe the @MessageDriven annotation should be sufficient for the deployment to happen and I do not require any ejb-jar or jboss xml files, is that right?

      I have declared the queue in standalone/configuration/standalone.xml as follows:

      <jms-destinations>

      <jms-queue name="test">

          <entry name="jms/testQueue"/>

      </jms-queue>

      </jms-destinations>

       

      Also, I am getting the following warning message during the deployment of another MDB:

      07:14:19,948 WARN  [org.jboss.as.ee.component.ResourceInjectionAnnotationParsingProcessor] (MSC service thread 1-2) Can't handle @Resource for ENC name: com.test.testMDB2/mdbContext on class com.test.testMDB2 since it's missing a "lookup" (or "mappedName") value and isn't of any known type

      This warning is for the line where I insert the resource as @Resource private transient MessageDrivenContext mdbContext

      Any idea why this warning is displayed ?

        • 1. Re: Exception during deployment of MDB which used to work in AS 4.2.3
          jaikiran pai Master

          Do you have any @EJB injection(s) in that MDB (or its superclass)? If yes, then please post the relevant code.

          • 2. Re: Exception during deployment of MDB which used to work in AS 4.2.3
            Sumeeth Tewar Newbie

            jaikiran pai wrote:

             

            Do you have any @EJB injection(s) in that MDB (or its superclass)? If yes, then please post the relevant code.

             

            Do you mean to say that @EJB injections are not supported. or should be done in any specific way?

             

             

            for example my MDB is as follows :

            @MessageDriven(mappedName="MDB2", activationConfig =

            {

                @ActivationConfigProperty(propertyName="destinationType",

                propertyValue="javax.jms.Queue"),

                @ActivationConfigProperty(propertyName="destination",

                //propertyValue="queue/MDB2")

                      propertyValue=DTConstants.DT_QUEUE_PREFIX + "MDB2")  

            }

            ,messageListenerInterface=MessageListener.class

            )

            public class MDB2 extends MDB1{

                /**

                 * Initialises an instance of MDB .

                 */

                public MDB2()

                {

                    super(InventoryComponent.class.getName(), "MDB2");

                    System.out.println(" MDB Constructor");

                }

            }

             

            and MDB1 code :

             

             

            public abstract class MDB1 implements MessageListener

            {

                /**

                 * Just here to make the compiler shutup.

                 */

                private static final long serialVersionUID = 283639536905489576L;

             

             

            @EJB

                private ExampleInterface exampleIFC;

             

            etc etc methods...

             

            }

             

             

             

            and ExampleInterface  code :

             

            public interface ExampleInterface

            {

                boolean createExample(String exampleID) throws XYZException;

            }

            • 3. Re: Exception during deployment of MDB which used to work in AS 4.2.3
              jaikiran pai Master

              Sumeeth Tewar wrote:

               

               

              Do you mean to say that @EJB injections are not supported.

              No, I mean there's something wrong with the way @EJB is being used.

               

               

              Sumeeth Tewar wrote:

               

              public abstract class MDB1 implements MessageListener

              {

               

              @EJB

                  private ExampleInterface exampleIFC;

               

              etc etc methods...

               

              }

               

               

               

              and ExampleInterface  code :

               

              public interface ExampleInterface

              {

                  boolean createExample(String exampleID) throws XYZException;

              }

              Do you have any EJBs which expose ExampleInterface as a business interface? If yes, what does the code of those beans look like and how and where are they packaged?

              • 4. Re: Exception during deployment of MDB which used to work in AS 4.2.3
                Sumeeth Tewar Newbie

                The ExampleInterface is inherited by ExampleEJB: and the code for this looks like :

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                @Stateless

                 

                (mappedName = "ExampleEJB"

                )

                @Remote

                public

                 

                class ExampleEJB implements

                ExampleInterface

                {

                 

                /**

                 

                 

                * Injected by the

                container.

                 

                 

                */

                 

                 

                @PersistenceContext(unitName = ServiceLocator.ENTITY_MANAGER

                )

                 

                private EntityManager entityManager

                ;

                 

                 

                /**

                 

                 

                * Address persister Session

                bean.

                 

                 

                */

                 

                 

                @EJB

                 

                 

                private  AddInterface addPersister;

                ;

                 

                 

                /**

                 

                 

                * Message persister Session

                bean.

                 

                 

                */

                 

                 

                @EJB

                 

                 

                private MessageExampleIface message;

                 

                and etc etc following methods;

                 

                 

                 

                 

                 

                 

                the packaging is as follows :

                 

                APP.EAR

                              MDB2.jar ----  MDB2 resides in this jar.

                              MDB1.jar ----  MDB1, ExampleEJB resides in this jar.

                LIB/Interface.jar----- contains the ExampleINterface.

                 

                 

                do you see anything erroneous in this packaging since i get no ClassDefFoundErrors or Exceptions...

                • 5. Re: Exception during deployment of MDB which used to work in AS 4.2.3
                  jaikiran pai Master

                  Sumeeth Tewar wrote:

                   

                   

                  @Stateless

                   

                  (mappedName = "ExampleEJB"

                  )

                  @Remote

                  public

                   

                  class ExampleEJB implements

                   

                  E#xampleInterface

                  Is that the exact code? You can't apply @Remote to the bean implementation class. It should point to the remote business interface of the bean. Also the bean implementation class is expected to be public.

                   

                  So change it to:

                   

                  @Stateless
                  @Remote (ExampleInterface.class)
                  public class ExampleEJB implements ExampleInterface
                  
                  • 6. Re: Exception during deployment of MDB which used to work in AS 4.2.3
                    Sumeeth Tewar Newbie

                    jaikiran pai wrote:

                     

                    Sumeeth Tewar wrote:

                     

                     

                    @Stateless

                     

                    (mappedName = "ExampleEJB"

                    )

                    @Remote

                    public

                     

                    class ExampleEJB implements

                     

                    E#xampleInterface

                    Is that the exact code? You can't apply @Remote to the bean implementation class. It should point to the remote business interface of the bean. Also the bean implementation class is expected to be public.

                     

                    So change it to:

                     

                    @Stateless
                    @Remote (ExampleInterface.class)
                    public class ExampleEJB implements ExampleInterface
                    

                     

                     

                    Hi, I have changed the declaration of ExampleEJB as suggested.

                    but i am still experiencing the same issue...

                     

                     

                    07:14:20,218 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC00001: Failed to start service jboss.deployment.subunit."test.ear"."comp1.jar".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.subunit."test.ear"."comp1.jar".INSTALL: Failed to process phase INSTALL of subdeployment "comp1.jar" of deployment "test.ear"         at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:121)         at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1765)         at org.jboss.msc.service.ServiceControllerImpl$ClearTCCLTask.run(ServiceControllerImpl.java:2291)         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_11]         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_11]         at java.lang.Thread.run(Thread.java:619) [:1.6.0_11] Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: Failed to install component org.jboss.as.ee.component.ComponentConfiguration[name=testMDB class="com".test.service.testMDB]         at org.jboss.as.ee.component.ComponentInstallProcessor.deploy(ComponentInstallProcessor.java:77)         at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115)         ... 5 more Caused by: java.lang.IllegalArgumentException: name is null         at org.jboss.msc.service.ServiceBuilderImpl.doAddDependency(ServiceBuilderImpl.java:203)         at org.jboss.msc.service.ServiceBuilderImpl.addDependency(ServiceBuilderImpl.java:197)         at org.jboss.msc.service.ServiceBuilderImpl.addDependency(ServiceBuilderImpl.java:191)         at org.jboss.as.ejb3.deployment.processors.EjbInjectionSource.getResourceValue(EjbInjectionSource.java:70)         at org.jboss.as.ee.component.ComponentInstallProcessor.processBindings(ComponentInstallProcessor.java:208)         at org.jboss.as.ee.component.ComponentInstallProcessor.access$000(ComponentInstallProcessor.java:53)         at org.jboss.as.ee.component.ComponentInstallProcessor$1.handle(ComponentInstallProcessor.java:173)         at org.jboss.as.ee.component.ClassDescriptionTraversal.run(ClassDescriptionTraversal.java:52)         at org.jboss.as.ee.component.ComponentInstallProcessor.deployComponent(ComponentInstallProcessor.java:170)         at org.jboss.as.ee.component.ComponentInstallProcessor.deploy(ComponentInstallProcessor.java:75)         ... 6 more

                    • 7. Re: Exception during deployment of MDB which used to work in AS 4.2.3
                      jaikiran pai Master

                      Please attach the application which reproduces this.

                      • 8. Re: Exception during deployment of MDB which used to work in AS 4.2.3
                        Sumeeth Tewar Newbie

                        jaikiran pai wrote:

                         

                        Please attach the application which reproduces this.

                        Hi jaikiran,

                         

                        extremely sorry but i am unable to post the application for you.

                         

                        i tried searching a simple MDB example which works on AS 7, but could not find any on the quick start section.

                        can you please send me one if you have some working examples. so that i can compare and have a look.