2 Replies Latest reply on Feb 26, 2014 10:43 AM by David Rodriguez

    JMS Connection Factory

    David Rodriguez Newbie

      We are migrating from JBOSS 5 to JBoss EAP 6.1.  We are trying to re-configure the messaging system to work and can't seem to get it working.

       

      In the standalone.xml we have configured the hornetq server as follows:

             <subsystem xmlns="urn:jboss:domain:messaging:1.3">
                  <hornetq-server>
                      <persistence-enabled>true</persistence-enabled>
                      <journal-type>NIO</journal-type>
                      <journal-file-size>102400</journal-file-size>
                      <journal-min-files>2</journal-min-files>

                      <connectors>
                          <netty-connector name="netty" socket-binding="messaging"/>
                          <netty-connector name="netty-throughput" socket-binding="messaging-throughput">
                              <param key="batch-delay" value="50"/>
                          </netty-connector>
                          <in-vm-connector name="in-vm" server-id="0"/>
                      </connectors>

                      <acceptors>
                          <netty-acceptor name="netty" socket-binding="messaging"/>
                          <netty-acceptor name="netty-throughput" socket-binding="messaging-throughput">
                              <param key="batch-delay" value="50"/>
                              <param key="direct-deliver" value="false"/>
                          </netty-acceptor>
                          <in-vm-acceptor name="in-vm" server-id="0"/>
                      </acceptors>

                      <security-settings>
                          <security-setting match="#">
                              <permission roles="guest" type="send"/>
                              <permission roles="guest" type="consume"/>
                              <permission roles="guest" type="createNonDurableQueue"/>
                              <permission roles="guest" type="deleteNonDurableQueue"/>
                          </security-setting>
                      </security-settings>

                      <address-settings>
                          <address-setting match="#">
                              <dead-letter-address>jms.queue.DLQ</dead-letter-address>
                              <expiry-address>jms.queue.ExpiryQueue</expiry-address>
                              <redelivery-delay>0</redelivery-delay>
                              <max-size-bytes>10485760</max-size-bytes>
                              <address-full-policy>BLOCK</address-full-policy>
                              <message-counter-history-day-limit>10</message-counter-history-day-limit>
                          </address-setting>
                      </address-settings>

                      <jms-connection-factories>
                          <connection-factory name="InVmConnectionFactory">
                              <connectors>
                                  <connector-ref connector-name="in-vm"/>
                              </connectors>
                              <entries>
                                  <entry name="java:/ConnectionFactory"/>
                              </entries>
                          </connection-factory>
                          <connection-factory name="RemoteConnectionFactory">
                              <connectors>
                                  <connector-ref connector-name="netty"/>
                              </connectors>
                              <entries>
                                  <entry name="java:jboss/exported/jms/RemoteConnectionFactory"/>
                              </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="backgroundJobMessageQueue">
                              <entry name="jms/queue/BackgroundJobMessageQueue"/>
                              <entry name="java:jboss/exported/jms/queue/BackgroundJobMessageQueue"/>
                          </jms-queue>
                      </jms-destinations>
                  </hornetq-server>
              </subsystem>

       

      In the code I run:

       

      Context ctx = new InitialContext();

      jmsConnectionFactory = (ConnectionFactory) ctx.lookup("/ConnectionFactory");

       

      It fails giving this error:

       

      javax.naming.NameNotFoundException: ConnectionFactory -- service jboss.naming.context.java.ConnectionFactory

      at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:103)

      at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:197)

      at org.jboss.as.naming.InitialContext.lookup(InitialContext.java:120)

      at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:183)

      at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:179)

      at javax.naming.InitialContext.lookup(InitialContext.java:411) [rt.jar:1.7.0_51]

      at net.esc20.txeis.common.util.ServiceLocator.getJmsConnectionFactory(ServiceLocator.java:129) [classes:]

       

      Can anyone point out what is wrong here?  Any help would be greatly appreciated.