Jerald Sabu M
Jerald Sabu M

Reputation: 1238

Jboss7 : Error trying to resolve JNDI name "java:/XAConnectionFactory" : javax.naming.NameNotFoundException: XAConnectionFactory

I was upgrading ATG application from 10.x to 11.x. I also upgraded jboss-eap from 5.1 to 7.2 I have faced various JBoss issues and many of them were fixed.

As of now we are getting the following error while starting the ATG fulfillment server and it seems to be JBoss JMS issue.

07:56:43,346 ERROR [nucleusNamespace.atg.dynamo.messaging.MessagingManager] (ServerService Thread Pool -- 81) PatchBay failed to startup properly : a Scheduler job will be registered to continue trying to bring PatchBay up : note this may result in further errors: atg.nucleus.ServiceException: An error occurred trying to resolve JNDI name "java:/XAConnectionFactory" for the "xa-topic-connection-factory-name" in provider "Hornet" in definition file "/atg/dynamo/messaging/dynamoMessagingSystem.xml": javax.naming.NameNotFoundException: XAConnectionFactory -- service jboss.naming.context.java.XAConnectionFactory
    at atg.dms.patchbay.Provider.initializeTopicConnection(Provider.java:364)
    at atg.dms.patchbay.PatchBayManager.createInputDestination(PatchBayManager.java:1811)
    at atg.dms.patchbay.PatchBayManager.createInputPorts(PatchBayManager.java:1446)
    at atg.dms.patchbay.PatchBayManager.createElementManager(PatchBayManager.java:1477)
    at atg.dms.patchbay.PatchBayManager.createMessageFilters(PatchBayManager.java:1338)

In Jboss 5, there were following configuration files:

ls jboss-eap-5.1/seam/bootstrap/deploy/messaging/
connection-factories-service.xml  hsqldb-persistence-service.xml  legacy-service.xml     remoting-service.xml
destinations-service.xml          jms-ds.xml                      messaging-service.xml

In Jboss 7.2 we have the following message config in standalone.xml file:

        <subsystem xmlns="urn:jboss:domain:messaging-activemq:4.0">
            <server name="default">
                <journal pool-files="10"/>
                <security-setting name="#">
                    <role name="guest" send="true" consume="true" create-non-durable-queue="true" delete-non-durable-queue="true"/>
                </security-setting>
                <address-setting name="#" dead-letter-address="jms.queue.DLQ" expiry-address="jms.queue.ExpiryQueue" max-size-bytes="10485760" page-size-bytes="2097152" message-counter-history-day-limit="10"/>
                <http-connector name="http-connector" socket-binding="http" endpoint="http-acceptor"/>
                <http-connector name="http-connector-throughput" socket-binding="http" endpoint="http-acceptor-throughput">
                    <param name="batch-delay" value="50"/>
                </http-connector>
                <in-vm-connector name="in-vm" server-id="0">
                    <param name="buffer-pooling" value="false"/>
                </in-vm-connector>
                <http-acceptor name="http-acceptor" http-listener="default"/>
                <http-acceptor name="http-acceptor-throughput" http-listener="default">
                    <param name="batch-delay" value="50"/>
                    <param name="direct-deliver" value="false"/>
                </http-acceptor>
                <in-vm-acceptor name="in-vm" server-id="0">
                    <param name="buffer-pooling" value="false"/>
                </in-vm-acceptor>
                <jms-queue name="ExpiryQueue" entries="java:/jms/queue/ExpiryQueue"/>
                <jms-queue name="DLQ" entries="java:/jms/queue/DLQ"/>
                <connection-factory name="InVmConnectionFactory" entries="java:/ConnectionFactory" connectors="in-vm"/>
                <connection-factory name="RemoteConnectionFactory" entries="java:jboss/exported/jms/RemoteConnectionFactory" connectors="http-connector"/>
                <pooled-connection-factory name="activemq-ra" entries="java:/JmsXA java:jboss/DefaultJMSConnectionFactory" connectors="in-vm" transaction="xa"/>
            </server>
        </subsystem>        

Following are the contents of atg/dynamo/messaging/dynamoMessagingSystem.xml in the code

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

<dynamo-message-system>
  <patchbay>
    <!-- JBoss Hornet provider -->
    <provider>
      <provider-name>Hornet</provider-name>
      <xa-topic-connection-factory-name>
        java:/XAConnectionFactory
      </xa-topic-connection-factory-name>
      <xa-queue-connection-factory-name>
        java:/XAConnectionFactory
      </xa-queue-connection-factory-name>
      <supports-transactions>
        true
      </supports-transactions>
      <supports-xa-transactions>
        true
      </supports-xa-transactions>
      <username>***</username>
      <password>***</password>
      <initial-context-factory>
        /abcd/common/services/HornetQ
      </initial-context-factory>
    </provider>
    <!-- Reporting order message source -->
    <message-source>
      <nucleus-name>/abcd/commerce/fulfillment/processor/SendReportingSubmitOrderMessage</nucleus-name>
      <output-port>
        <port-name>ReportingOrderSubmit</port-name>
        <output-destination>
          <provider-name>local</provider-name>
          <destination-name>localdms:/local/Fulfillment/LocalSubmitOrder</destination-name>
          <destination-type>Topic</destination-type>
        </output-destination>
      </output-port>
    </message-source>
    <!-- Split order message source -->
    <message-source>
      <nucleus-name>/abcd/commerce/fulfillment/processor/SendSplitMessages/</nucleus-name>
      <output-port>
        <port-name>DEFAULT</port-name>
      </output-port>
      <output-port>
        <port-name>FulfillmentOrderSubmitPort</port-name>
        <output-destination>
          <destination-name>patchbay:/Fulfillment/SubmitOrder</destination-name>
          <destination-type>Topic</destination-type>
        </output-destination>
      </output-port>
    </message-source>
    <!-- Custom source/sink will take fulfillment failures and forward them, perhaps to multiple queues or none -->
    <message-source>
      <nucleus-name>
        /abcd/commerce/fulfillment/FailureMessageSink
      </nucleus-name>
      <output-port>
        <port-name>
          FulfillmentFailureNotifications
        </port-name>
        <output-destination>
          <destination-name>
            patchbay:/Fulfillment/FulfillmentFailureNotifications
          </destination-name>
          <destination-type>
            Topic
          </destination-type>
        </output-destination>
      </output-port>
    </message-source>

    <!-- Custom source/sink will take fulfillment failures and forward them, perhaps to multiple queues or none -->
    <message-sink>
      <nucleus-name>
        /abcd/commerce/fulfillment/FailureMessageSink
      </nucleus-name>
      <input-port>
        <port-name>FulfillmentError</port-name>
        <input-destination>
          <destination-name>patchbay:/Fulfillment/ErrorNotification</destination-name>
          <destination-type>Queue</destination-type>
        </input-destination>
      </input-port>
    </message-sink>

I'm new to both jboss and ATG, Could anyone help me to resolve the issue ?

Upvotes: 0

Views: 785

Answers (1)

ehsavoie
ehsavoie

Reputation: 3547

java:/XAConnectionFactory is not defined in WildFly. You need to configure WildFly to properly create and expose those connection factories like this:

<pooled-connection-factory name="activemq-ra" entries="java:/JmsXA java:jboss/DefaultJMSConnectionFactory java:/XAConnectionFactory" connectors="in-vm" transaction="xa"/>

Please note also that you are now on Apache ActiveMQ Artemis and no longer on HornetQ

Upvotes: 0

Related Questions