1 2 Previous Next 21 Replies Latest reply on Aug 30, 2013 5:22 AM by aqtwrdnr Branched to a new discussion.

    Unable to deploy MDB in Jboss EAP 6

    chithu21

      I am trying to deploy an MDB (EJB 3.x) in Jboss 6 and I get the following error.

       

          16:47:02,505 INFO  [org.jboss.as.server.deployment.scanner]  (DeploymentScanner-threads - 1) JBAS015003: Found CatToXibMdbEAR.ear in  deployment directory. To trigger deployment create a file called  CatToXibMdbEAR.ear.dodeploy

          16:47:02,524 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015876: Starting deployment of "CatToXibMdbEAR.ear"

          16:47:02,548 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015876: Starting deployment of "CatToXibMdb.jar"

          16:47:02,586 INFO  [org.jboss.as.osgi] (MSC service thread 1-2) JBAS011941: Register module: Module "deployment.CatToXibMdbEAR.ear:main" from Service Module Loader

          16:47:02,595 INFO  [org.jboss.as.osgi] (MSC service thread 1-2) JBAS011941: Register module: Module "deployment.CatToXibMdbEAR.ear.CatToXibMdb.jar:main" from Service Module Loader

          16:47:02,597 INFO  [org.jboss.as.ejb3] (MSC service thread 1-8) JBAS014142: Started message driven bean 'CatToXibMdb' with 'hornetq-ra' resource adapter

          16:47:02,802 INFO  [org.jboss.as.osgi] (MSC service thread 1-2) JBAS011943: Unregister module: Module "deployment.CatToXibMdbEAR.ear:main" from Service Module Loader

          16:47:02,802 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015870: Deploy of deployment "CatToXibMdbEAR.ear" was rolled back with failure message {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.naming.context.java.comp.CatToXibMdbEAR.CatToXibMdb.CatToXibMdb.env.jms.QCFjboss.naming.context.java.jboss.resources.jms.QCFMissing[jboss.naming.context.java.comp.CatToXibMdbEAR.CatToXibMdb.CatToXibMdb.env.jms.QCFjboss.naming.context.java.jboss.resources.jms.QCF]"]}

          16:47:02,803 INFO  [org.jboss.as.osgi] (MSC service thread 1-1) JBAS011943: Unregister module: Module "deployment.CatToXibMdbEAR.ear.CatToXibMdb.jar:main" from Service Module Loader

          16:47:02,845 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015877: Stopped deployment CatToXibMdb.jar in 43ms

          16:47:02,849 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-7) JBAS015877: Stopped deployment CatToXibMdbEAR.ear in 47ms

          16:47:02,852 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report

          JBAS014776:    Newly corrected services:

            service jboss.naming.context.java.jboss.resources.jms.QCF (new available)

       

          16:47:02,861 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) {"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.naming.context.java.comp.CatToXibMdbEAR.CatToXibMdb.CatToXibMdb.env.jms.QCFjboss.naming.context.java.jboss.resources.jms.QCFMissing[jboss.naming.context.java.comp.CatToXibMdbEAR.CatToXibMdb.CatToXibMdb.env.jms.QCFjboss.naming.context.java.jboss.resources.jms.QCF]"]}}}`  

       

      It says missing dependency for QCF. Am I  doing something wrong?

       

      MY ejb-jar.xml & jboss.xml are under META-INF

       

      ejb-jar.xml:

       

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

          <ejb-jar xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  xmlns="http://java.sun.com/xml/ns/javaee" xmlns:ejb="http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd" version="3.1">

       

          <enterprise-beans>

          <message-driven>

          <ejb-name>CatToXibMdb</ejb-name>

          <ejb-class>com.dcat2.mdb.CatToXibMdb</ejb-class>

          <transaction-type>Container</transaction-type>   

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

          <resource-ref>

          <res-ref-name>jms/QCF</res-ref-name>

          <res-type>javax.jms.QueueConnectionFactory</res-type>

          <res-auth>Container</res-auth>

          </resource-ref>

          </message-driven>

          </enterprise-beans>

          </ejb-jar>

       

       

      jboss.xml:

       

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

          <!DOCTYPE jboss PUBLIC

                "-//JBoss//DTD JBOSS 4.0//EN"

                "http://www.jboss.org/j2ee/dtd/jboss_4_0.dtd">

          <jboss>

          <enterprise-beans>

          <message-driven>

          <ejb-name>CatToXibMdb</ejb-name>

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

          <resource-ref>

          <res-ref-name>jms/QCF</res-ref-name>

          <jndi-name>ConnectionFactory</jndi-name>

          </resource-ref>

          </message-driven>

          </enterprise-beans>

          </jboss>

       

      MDB:

       

       

          import javax.ejb.ActivationConfigProperty;

          import javax.ejb.EJBException;

          import javax.ejb.MessageDriven;

          import javax.ejb.MessageDrivenContext;

          import javax.jms.JMSException;

          import javax.jms.Message;

          import javax.jms.MessageListener;

          import javax.jms.QueueConnection;

          import javax.jms.QueueConnectionFactory;

          import javax.jms.QueueSession;

          import javax.jms.TextMessage;

          import javax.naming.InitialContext;

          import javax.naming.NamingException;

          import javax.ejb.MessageDrivenBean;

       

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

          public class CatToXibMdb implements MessageListener, MessageDrivenBean {

       

          private MessageDrivenContext ctx = null;

          private QueueConnection conn;

          private QueueSession session;

       

         

          public CatToXibMdb() {

             

              System.out.println("CatToXibMdb: Constructor");

          }

       

         

          public void setMessageDrivenContext(MessageDrivenContext ctx) {

              this.ctx = ctx;

             

              System.out.println("CatToXibMdb.setMessageDrivenContext, this=" + hashCode());

          }

       

         

          public void ejbCreate() {

             

              System.out.println("CatToXibMdb.ejbCreate, this=" + hashCode());

              try {

                  setupPTP();

              } catch (Exception e) {

                  throw new EJBException("Failed to init CatToXibMdb", e);

              }

          }

       

         

          public void ejbRemove() {

             

              System.out.println("CatToXibMdb.ejbRemove, this=" + hashCode());

              ctx = null;

              try {

                  if (session != null) {

                      session.close();

                  }

                  if (conn != null) {

                      conn.close();

                  }

              } catch (JMSException e) {

                 

                  System.out.println("JMS Exception occured : " + e);

              }

          }

       

          /

          public void onMessage(Message msg) {

             

              System.out.println("Received message : " + msg.toString());

       

              try {

                 

                  System.out.println("Msg id: " + msg.getJMSMessageID());

                 

                  System.out.println(msg.getJMSRedelivered());

              } catch (JMSException e) {

                 

                  System.out.println("JMS Exception occured : " + e);

                 

              }

       

             

              System.out.println("CatToXibMdb.onMessage, this=" + hashCode());

              try {

       

                  TextMessage tm = (TextMessage) msg;

                 

                  System.out.println("Message : " + tm.getText());

                  msg.clearBody();

              } catch (Throwable t) {

                 

                  System.out.println("Exception occured : " + t);

              }

          }

       

         

          private void setupPTP() throws JMSException, NamingException {

              InitialContext iniCtx = new InitialContext();

              Object tmp = iniCtx.lookup("java:comp/env/jms/QCF");

              QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;

              conn = qcf.createQueueConnection();

              session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);

              conn.start();

          }

          }

       

       

       

      I am deploying from eclipse itself.

      Can anyone help please.

        • 1. Re: Unable to deploy MDB in Jboss EAP 6
          chithu21

          I changed the the ejb-jar.xml to the following:

           

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

          <ejb-jar xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

              xmlns="http://java.sun.com/xml/ns/javaee" xmlns:ejb="http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"

              xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd"

              version="3.1">

           

              <enterprise-beans>

                  <message-driven>

                      <ejb-name>CatToXibMdb</ejb-name>

                      <ejb-class>com.dcat2.mdb.CatToXibMdb</ejb-class>

                      <transaction-type>Container</transaction-type>

                   

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

                      <activation-config>

           

                          <activation-config-property>

           

                              <activation-config-property-name>acknowledgeMode</activation-config-property-name>

           

                              <activation-config-property-value>Auto-acknowledge</activation-config-property-value>

           

                          </activation-config-property>

           

                      </activation-config>

            

                  </message-driven>

              </enterprise-beans>

          </ejb-jar>

           

          Now I get the following error:

           

          2:12:53,931 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service jboss.deployment.subunit."CatToXibMdbEAR.ear"."CatToXibMdb.jar".component.CatToXibMdb.START: org.jboss.msc.service.StartException in service jboss.deployment.subunit."CatToXibMdbEAR.ear"."CatToXibMdb.jar".component.CatToXibMdb.START: Failed to start service

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1767) [jboss-msc-1.0.2.GA-redhat-1.jar:1.0.2.GA-redhat-1]

              at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.7.0_02]

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.7.0_02]

              at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_02]

          Caused by: java.lang.RuntimeException: javax.resource.spi.InvalidPropertyException: Destination is mandatory

              at org.jboss.as.ejb3.component.messagedriven.MessageDrivenComponent.start(MessageDrivenComponent.java:178)

              at org.jboss.as.ee.component.ComponentStartService.start(ComponentStartService.java:44)

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA-redhat-1.jar:1.0.2.GA-redhat-1]

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA-redhat-1.jar:1.0.2.GA-redhat-1]

              ... 3 more

          Caused by: javax.resource.spi.InvalidPropertyException: Destination is mandatory

              at org.hornetq.ra.inflow.HornetQActivationSpec.validate(HornetQActivationSpec.java:643)

              at org.jboss.jca.core.rar.EndpointImpl.activate(EndpointImpl.java:157)

              at org.jboss.as.ejb3.component.messagedriven.MessageDrivenComponent.start(MessageDrivenComponent.java:176)

              ... 6 more

           

          12:12:53,947 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015870: Deploy of deployment "CatToXibMdbEAR.ear" was rolled back with failure message {"JBAS014671: Failed services" => {"jboss.deployment.subunit.\"CatToXibMdbEAR.ear\".\"CatToXibMdb.jar\".component.CatToXibMdb.START" => "org.jboss.msc.service.StartException in service jboss.deployment.subunit.\"CatToXibMdbEAR.ear\".\"CatToXibMdb.jar\".component.CatToXibMdb.START: Failed to start service"}}

          12:12:53,948 INFO  [org.jboss.as.osgi] (MSC service thread 1-7) JBAS011943: Unregister module: Module "deployment.CatToXibMdbEAR.ear.CatToXibMdb.jar:main" from Service Module Loader

          12:12:53,947 INFO  [org.jboss.as.osgi] (MSC service thread 1-1) JBAS011943: Unregister module: Module "deployment.CatToXibMdbEAR.ear:main" from Service Module Loader

          12:12:53,960 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015877: Stopped deployment CatToXibMdb.jar in 13ms

          12:12:53,962 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015877: Stopped deployment CatToXibMdbEAR.ear in 15ms

          12:12:53,964 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report

          JBAS014777:   Services which failed to start:      service jboss.deployment.subunit."CatToXibMdbEAR.ear"."CatToXibMdb.jar".component.CatToXibMdb.START: org.jboss.msc.service.StartException in service jboss.deployment.subunit."CatToXibMdbEAR.ear"."CatToXibMdb.jar".component.CatToXibMdb.START: Failed to start service

           

          12:12:53,970 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) {"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"JBAS014671: Failed services" => {"jboss.deployment.subunit.\"CatToXibMdbEAR.ear\".\"CatToXibMdb.jar\".component.CatToXibMdb.START" => "org.jboss.msc.service.StartException in service jboss.deployment.subunit.\"CatToXibMdbEAR.ear\".\"CatToXibMdb.jar\".component.CatToXibMdb.START: Failed to start service"}}}}

           

           

          Any idea??

          • 2. Re: Unable to deploy MDB in Jboss EAP 6
            jaikiran

            You need to set the destination activation config property (just like you did for the acknowledgeMode) to point to the jndi name of the destination queue, in your ejb-jar.xml

            1 of 1 people found this helpful
            • 3. Re: Unable to deploy MDB in Jboss EAP 6
              chithu21

              Thanks jaikiran pai

               

              The deployment error is gone .

               

              I added he following to ejb-jar.xml:

               

              <activation-config-property>

               

                                  <activation-config-property-name>destination</activation-config-property-name>

               

                                  <activation-config-property-value>jms/QCF</activation-config-property-value>

               

                              </activation-config-property>

                              <activation-config-property>

               

                                  <activation-config-property-name>destinationType</activation-config-property-name>

               

                                  <activation-config-property-value>javax.jms.QueueConnectionFactory</activation-config-property-value>

               

                              </activation-config-property>

               

              Now, while running the client program I get,

               

               

              Caused by: javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused: connect]]

               

              To add upon,

               

              I have migrated the application from Jboss 5 to 6 .

              So i changed the jbossall-client.jar to jboss-client.jar in the location <jboss6_home>\bin\client  and commons-logging.jar to jboss-logging-3.1.0.GA-redhat-1.jar in the location<jboss6_home>\ modules\org\jboss\logging\main, in the client project's build path.

               

              Did I do something wrong or did I miss any steps?

              • 4. Re: Unable to deploy MDB in Jboss EAP 6
                jaikiran

                Caused by: javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused: connect]]

                 

                Please post the entire exception stacktrace. Someone in your application, you seem to be doing a JNDI lookup using the old JBoss AS mechanism which uses the 1099 port. That is no longer supported. What part of the code is doing the lookup and what does it look like?

                 

                 

                To add upon,

                 

                I have migrated the application from Jboss 5 to 6 .

                So i changed the jbossall-client.jar to jboss-client.jar in the location <jboss6_home>\bin\client  and commons-logging.jar to jboss-logging-3.1.0.GA-redhat-1.jar in the location<jboss6_home>\ modules\org\jboss\logging\main, in the client project's build path.

                I'm not sure what you mean here, especially the reference to JBoss AS6. But anyway, do not change or remove any of the jars shipped in AS7.

                • 5. Re: Unable to deploy MDB in Jboss EAP 6
                  chithu21

                  The entire stacktrace is as follows:

                   

                   

                  DEBUG [main] ( NamingContext ) - Failed to connect to localhost:1099

                  javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused: connect]]

                      at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:274)

                      at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1533)

                      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:634)

                      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)

                      at javax.naming.InitialContext.lookup(Unknown Source)

                      at com.dcat2.messaging.sendreceive.JMSConnector.setupPTP(JMSConnector.java:56)

                      at com.dcat2.messaging.sendreceive.MessageSender.sendMessage(MessageSender.java:89)

                      at com.dcat2.messaging.sendreceive.MessageSender.main(MessageSender.java:128)

                  Caused by: javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused: connect]

                      at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:248)

                      ... 7 more

                  Caused by: java.net.ConnectException: Connection refused: connect

                      at java.net.PlainSocketImpl.socketConnect(Native Method)

                      at java.net.PlainSocketImpl.doConnect(Unknown Source)

                      at java.net.PlainSocketImpl.connectToAddress(Unknown Source)

                      at java.net.PlainSocketImpl.connect(Unknown Source)

                      at java.net.SocksSocketImpl.connect(Unknown Source)

                      at java.net.Socket.connect(Unknown Source)

                      at java.net.Socket.connect(Unknown Source)

                      at java.net.Socket.<init>(Unknown Source)

                      at java.net.Socket.<init>(Unknown Source)

                      at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:84)

                      at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:77)

                      at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:244)

                      ... 7 more

                  Exception in thread "main" javax.naming.CommunicationException: Could not obtain connection to any of these urls: localhost:1099localhost:1099 and discovery failed with error: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out] [Root exception is javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused: connect]]]

                      at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1562)

                      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:634)

                      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)

                      at javax.naming.InitialContext.lookup(Unknown Source)

                      at com.dcat2.messaging.sendreceive.JMSConnector.setupPTP(JMSConnector.java:56)

                      at com.dcat2.messaging.sendreceive.MessageSender.sendMessage(MessageSender.java:89)

                      at com.dcat2.messaging.sendreceive.MessageSender.main(MessageSender.java:128)

                  Caused by: javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused: connect]]

                      at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:274)

                      at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1533)

                      ... 6 more

                  Caused by: javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused: connect]

                      at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:248)

                      ... 7 more

                  Caused by: java.net.ConnectException: Connection refused: connect

                      at java.net.PlainSocketImpl.socketConnect(Native Method)

                      at java.net.PlainSocketImpl.doConnect(Unknown Source)

                      at java.net.PlainSocketImpl.connectToAddress(Unknown Source)

                      at java.net.PlainSocketImpl.connect(Unknown Source)

                      at java.net.SocksSocketImpl.connect(Unknown Source)

                      at java.net.Socket.connect(Unknown Source)

                      at java.net.Socket.connect(Unknown Source)

                      at java.net.Socket.<init>(Unknown Source)

                      at java.net.Socket.<init>(Unknown Source)

                      at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:84)

                      at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:77)

                      at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:244)

                      ... 7 more

                   

                  Code Snippet of The Client Program:

                   

                  Properties env = new Properties();

                          env.put(Context.INITIAL_CONTEXT_FACTORY, config.getContextFactory());

                          env.put(Context.PROVIDER_URL, contextUrl);

                          env.put(Context.URL_PKG_PREFIXES, config.getPkgPrefixes());

                          InitialContext iniCtx = new InitialContext(env);

                   

                          Object tmp = iniCtx.lookup("ConnectionFactory");

                          QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;

                   

                          connection = qcf.createQueueConnection();

                          String lookUpObj = "queue/" + queueName;

                          Queue xibToCatQueue =  (Queue) iniCtx.lookup(lookUpObj);

                   

                          session = connection.createQueueSession(

                                  false, QueueSession.AUTO_ACKNOWLEDGE);

                          connection.start();

                   

                   

                   

                  Here are the values:

                   

                  CONTEXT_FACTORY=org.jnp.interfaces.NamingContextFactory

                  PROVIDER_URL=jnp://localhost:1099  --> This is the context URL

                  URL_PKG_PREFIXES=org.jboss.naming:org.jnp.interfaces

                  To add upon,

                   

                  I have migrated the application from Jboss 5 to 6 .

                  So i changed the jbossall-client.jar to jboss-client.jar in the location <jboss6_home>\bin\client  and commons-logging.jar to jboss-logging-3.1.0.GA-redhat-1.jar in the location<jboss6_home>\ modules\org\jboss\logging\main, in the client project's build path.

                  I'm not sure what you mean here, especially the reference to JBoss AS6. But anyway, do not change or remove any of the jars shipped in AS7.

                   

                  What i meant was, in the client program i initially had reference to jbossall-client.jar and commons-logging.jar (from Jboss 5).  Now i changed the references to jboss-client.jar and jboss-logging-3.1.0.GA-redhat-1.jar (from Jboss 6).

                  Note: I changed the references in the client program. I didnt change anything in the server. With ot without change the output is same

                  • 6. Re: Unable to deploy MDB in Jboss EAP 6
                    rmody

                    If you are using JBoss AS7 and if you are trying to send messages from a standalone Java client (i.e. client is running outside JVM from JVM in which JBoss is running), then you make sure you remember the following things

                     

                    • You should have the “/jboss-as-7.x.x.Final/bin/client/jboss-client-7.x.x.Final.jar” in the CLASSPATH of the client.
                    • The Initial Context Factory would

                     

                    org.jboss.naming.remote.client.InitialContextFactory
                    
                    • The URL would be as below, where 4447 is the remote port

                       

                      remote://<IP_ADDRESS>:4447
                      
                    • Also you need to create a user for “Application User” using the “/jboss-as-7.x.x.Final/bin/add-user.sh” which would be used for getting the connection with the JBoss AS7 remotely.
                    • You would also have to add the below code with the username and password created by the above step, for getting the Initial context factory as by default the remote connector is secured.

                     

                    //*************** Creating Queue Connection using the UserName & Password *************************
                    qcon = qconFactory.createQueueConnection("USERNAME","PASSWORD");
                    .
                    .
                    //*************** UserName & Password for the Initial Context for JNDI lookup *************************
                    env.put(Context.SECURITY_PRINCIPAL, "USERNAME");
                    env.put(Context.SECURITY_CREDENTIALS, "PASSWORD");
                    
                    • Last thing the queue which has been made should have the below perfix before giving the JNDI name of the queue

                     

                    java:jboss/exported/
                    

                    To get complete information you can have a look at the below link.

                     

                    Topic: How to connect to a remote queue in JBoss AS 7 ?

                    Link: http://middlewaremagic.com/jboss/?p=1616

                    1 of 1 people found this helpful
                    • 7. Re: Unable to deploy MDB in Jboss EAP 6
                      chithu21

                      Thanks a lot Ravish Mody  for the detailed update.

                      For now, this part has been put on hold in my project.

                      Will try it out & let you know

                      • 8. Re: Unable to deploy MDB in Jboss EAP 6
                        chithu21

                        Hi Ravish Mody,

                         

                        I followed as mentioned in ur post.

                        But I get the following exception now.

                        Any idea??

                         

                        Jul 09, 2012 3:32:32 PM org.xnio.Xnio <clinit>

                        INFO: XNIO Version 3.0.3.GA-redhat-1

                        Jul 09, 2012 3:32:32 PM org.xnio.nio.NioXnio <clinit>

                        INFO: XNIO NIO Implementation Version 3.0.3.GA-redhat-1

                        Jul 09, 2012 3:32:32 PM org.jboss.remoting3.EndpointImpl <clinit>

                        INFO: JBoss Remoting version 3.2.4.GA-redhat-1

                        Exception in thread "main" javax.naming.NamingException: Failed to create remoting connection [Root exception is java.lang.RuntimeException: Operation failed with status WAITING]

                            at org.jboss.naming.remote.client.ClientUtil.namingException(ClientUtil.java:36)

                            at org.jboss.naming.remote.client.InitialContextFactory.getInitialContext(InitialContextFactory.java:121)

                            at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)

                            at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)

                            at javax.naming.InitialContext.init(Unknown Source)

                            at javax.naming.InitialContext.<init>(Unknown Source)

                            at QueueSend.getInitialContext(QueueSend.java:95)

                            at QueueSend.main(QueueSend.java:59)

                        Caused by: java.lang.RuntimeException: Operation failed with status WAITING

                            at org.jboss.naming.remote.protocol.IoFutureHelper.get(IoFutureHelper.java:89)

                            at org.jboss.naming.remote.client.NamingStoreCache.getRemoteNamingStore(NamingStoreCache.java:56)

                            at org.jboss.naming.remote.client.InitialContextFactory.getOrCreateCachedNamingStore(InitialContextFactory.java:166)

                            at org.jboss.naming.remote.client.InitialContextFactory.getOrCreateNamingStore(InitialContextFactory.java:139)

                            at org.jboss.naming.remote.client.InitialContextFactory.getInitialContext(InitialContextFactory.java:104)

                            ... 6 more

                        • 9. Re: Unable to deploy MDB in Jboss EAP 6
                          jaikiran

                          You just need to import the annotation class:

                           

                          import javax.ejb.ActivationConfigProperty;

                           

                          It belongs to the EJB spec jar.

                          • 10. Re: Unable to deploy MDB in Jboss EAP 6
                            jaikiran

                            This:

                             

                            <ejb-name>Bpm1Queue1Bean</ejb-name>

                             

                            doesn't match with the name that you specified using the @MessageDriven annotation:

                             

                            @MessageDriven(name = "Bpm1Queue1"

                             

                            Hence those are considered 2 different beans

                            • 11. Re: Unable to deploy MDB in Jboss EAP 6
                              aqtwrdnr

                              jaikiran: Where does this 'destination' ActivationConfigurationProperty come from? I cannot find this property in the Java EE 6 API (http://docs.oracle.com/javaee/6/api/javax/ejb/ActivationConfigProperty.html) or the Oracle documentation (http://docs.oracle.com/javaee/6/tutorial/doc/bnbpo.html) on this subject. If I am correct that it is not dictated by the Java EE 6, then it should not be mandatory, should it?

                               

                              This 'destination' property bugs me in JBoss AS 7.2.0.Final, because it requires a JNDI name that is accessible by HornetQ (Re: Message-driven bean activation-config and JNDI), while I would like to use a java:app JNDI name that I can map to a global JNDI name in my application.xml. Any idea how I can work around this issue?

                               

                              @Justin Bertram: the text you cite talks about destinationType, but not about destination.


                              Barry NL

                               

                              Edit: spell name correctly, answer to Justin Bertram (cannot post more than once an hour)

                              • 12. Re: Unable to deploy MDB in Jboss EAP 6
                                jbertram

                                See section 5.4.16.1 of the EJB 3 specification.  It says:

                                A JMS message-driven bean is associated with a JMS Destination (Queue or Topic) when the bean is

                                deployed in the container. It is the responsibility of the Deployer to associate the message-driven bean

                                with a Queue or Topic.

                                 

                                The Bean Provider may provide advice to the Deployer as to whether a message-driven bean is intended

                                to be associated with a queue or a topic by using the activationConfig element of the Mes-

                                sageDriven annotation or by using the activation-config-property deployment descrip-

                                tor element. The property name used to specify the destination type associated with the bean is

                                destinationType. The value for this property must be either javax.jms.Queue or

                                javax.jms.Topic for a JMS message-driven bean.

                                • 13. Re: Unable to deploy MDB in Jboss EAP 6
                                  aqtwrdnr

                                  @Justin Bertram: the text you cite talks about destinationType, but not about destination. The destinationType can be found in the Java EE 6 specs, for example in the JavaDoc of the ActivationConfigProperty annotation: http://docs.oracle.com/javaee/6/api/javax/ejb/ActivationConfigProperty.html. But I was talking abou the destination property, which is never mentioned.

                                   

                                  Thanks for taking the time to look into this.

                                   

                                  Barry NL

                                   

                                  Edit: extend my reply

                                  • 14. Re: Unable to deploy MDB in Jboss EAP 6
                                    jbertram

                                    I apologize for the confusion.  The germane facts are in the first paragraph of my quotation:

                                    A JMS message-driven bean is associated with a JMS Destination (Queue or Topic) when the bean is

                                    deployed in the container. It is the responsibility of the Deployer to associate the message-driven bean

                                    with a Queue or Topic.

                                    While you're technically correct that the spec doesn't mention the "destination" activation-config-property, it does require that the container associate the MDB with a queue or topic.  The "destination" activation-config-property is the logical outworking of this requirement.  Every JMS JCA Resource Adapter I'm familiar with requires this. 

                                    1 2 Previous Next