6 Replies Latest reply on Jun 19, 2012 11:35 AM by mikemil

    Migration from jbossAS5.1 to AS7.1

    ksaritha9

      Hi,

       

      When I deploy my application ear file(works fine in AS5.1, using EJB2.1) in AS7.1.0, I'm getting following error. Am I missing anything?

       

      00:12:50,515 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.TEST.TEST.MessageDelivery.env.jms.deliveryQueueFactoryjboss.naming.context.java.jboss.resources.jms.deliveryQueueFactoryMissing

       

      I declared connection factory and jms destinations in standalone-full.xml as shown below.

       

      <jms-connection-factories>

                          <connection-factory name="InVmConnectionFactory">

                              <connectors>

                                  <connector-ref connector-name="in-vm"/>

                              </connectors>

                              <entries>

                                  <entry name="java:/ConnectionFactory"/>

                                  <entry name="java:jboss/exported/jms/deliveryQueueFactory"/>

                              </entries>

                          </connection-factory>

                          <pooled-connection-factory name="hornetq-ra">

                              <transaction mode="xa"/>

                              <connectors>

                                  <connector-ref connector-name="in-vm"/>

                              </connectors>

                              <entries>

                                  <entry name="java:/JmsXA"/>

                              </entries>

                          </pooled-connection-factory>

                      </jms-connection-factories>

       

                      <jms-destinations>

                          <jms-queue name="testQueue">

                              <entry name="queue/test"/>

                          </jms-queue>

                          <jms-queue name="deliveryQueue">

                              <entry name="jms/deliveryQueue"/>

                          </jms-queue>

                          <jms-topic name="testTopic">

                              <entry name="topic/test"/>

                          </jms-topic>

                      </jms-destinations>

       

      I really appreciate your help.

       

      Thanks

        • 1. Re: Migration from jbossAS5.1 to AS7.1
          ctomc

          Hi,

           

          how does your configuration/code for obtaining the queue looks?

           

          --

          tomaz

          • 2. Re: Migration from jbossAS5.1 to AS7.1
            ksaritha9

            Hi,

             

            The following configuration is in ejb-jar.xml file

             

                     <resource-ref id="ResRef_4">

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

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

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

                     </resource-ref>

             

                     <resource-env-ref id="ResEnvRef_4">

                        <resource-env-ref-name>jms/deliveryQueue</resource-env-ref-name>

                        <resource-env-ref-type>javax.jms.Queue</resource-env-ref-type>

                     </resource-env-ref>

             

            and below is the code in the class

            final String DELIVERY_CONNECTION_FACTORY = "jms/deliveryQueueFactory";

            final String DELIVERY_QUEUE_NAME = "jms/deliveryQueue";

             

            final String factoryName = TestConfiguration.getProperty("DELIVERY_CONNECTION_FACTORY", DELIVERY_CONNECTION_FACTORY);

            final String queueName = TestConfiguration.getProperty("DELIVERY_QUEUE_NAME", DELIVERY_QUEUE_NAME);

                       

            Context ctx = new InitialContext();

            QueueConnectionFactory connectionFactory = (QueueConnectionFactory) ctx.lookup(factoryName);

            Queue queue = (Queue) ctx.lookup(queueName);

             

            TestConfiguration.getProperty() code follows:

            getProperty(final String name, final String defaultValue){

                    String property = this.props.getProperty(name);

                    if (property != null) {

                        return property.trim();

                    } else {

                        if (log.isInfoEnabled()) {

                            log.info("Configuration property not found <" + name + "> using default value <" + defaultValue + ">");

                        }

                        return defaultValue;

                    }

                }

            }  

             

            Thanks

            • 3. Re: Migration from jbossAS5.1 to AS7.1
              ctomc

              Hi,

               

              the problem is just the lookup name that you use. if you check in the log when your are starting the server you can see under which name jms queues are binded.

               

              in your case you should see something like this:

               

              [org.hornetq.core.server.impl.HornetQServerImpl] (MSC service thread 1-14) trying to deploy queue jms.queue.deliveryQueue

              [org.jboss.as.messaging] (MSC service thread 1-14) JBAS011601: Bound messaging object to jndi name java:/jms/deliveryQueue

               

              and so on...

              Try changing configuration and your code to use this names aka java:/ in-front of queue name.

               

              --

              tomaz

              • 4. Re: Migration from jbossAS5.1 to AS7.1
                ksaritha9

                Hi Tomaz,

                 

                Thank you for helping me out. I converted jboss.xml to jboss-ejb3.xml and works perfect.

                 

                Now i'm having issues with the client. I see following error when trying to do lookup.

                 

                java.lang.IllegalStateException: No EJB receiver available for handling [appName:MyAppEar, moduleName:MyAppJar,distinctname:] combination.

                 

                Here is the code for lookup

                TestHome home = (TestHome)getContext().lookup("ejb:appName/moduleName//BeanName!TestHome");

                 

                Thanks,

                Pooja

                • 5. Re: Migration from jbossAS5.1 to AS7.1
                  ctomc

                  Hi,

                   

                  for remote ejbs please checkout documentation https://docs.jboss.org/author/display/AS71/EJB+invocations+from+a+remote+client+using+JNDI

                   

                   

                  --

                  tomaz

                  • 6. Re: Migration from jbossAS5.1 to AS7.1
                    mikemil

                    I have seend the 'No EJB Receiver available..." message when I did NOT have the jndi property "jboss.naming.client.ejb.context" set to true or didn't add that property when creating the InitialContext.