4 Replies Latest reply: May 30, 2012 8:03 AM by Jesper Pedersen RSS

    Bug in creating ManagedConnectionFactory instance?

    Andreas Mueller Newbie

      This is my configuration (AS 7.1.1):

       

              <subsystem xmlns="urn:jboss:domain:resource-adapters:1.0">

                  <resource-adapters>

                      <resource-adapter>

                          <archive>

                              swiftmq_jca16.rar

                          </archive>

                          <transaction-support>XATransaction</transaction-support>

                          <config-property name="debugMode">

                              true

                          </config-property>

                          <connection-definitions>

                              <connection-definition class-name="com.swiftmq.connector.v16.outbound.ManagedConnectionFactoryImpl" jndi-name="java:/comp/env/CF" pool-name="SwiftMQConnectionFactoryPool">

                                  <security>

                                      <application/>

                                  </security>

                              </connection-definition>

                          </connection-definitions>

                          <admin-objects>

                              <admin-object class-name="com.swiftmq.jms.QueueImpl" jndi-name="java:/com/env/testqueue1" pool-name="testqueue1">

                                  <config-property name="queueName">

                                      testqueue1@router1

                                  </config-property>

                              </admin-object>

                          </admin-objects>

                      </resource-adapter>

                  </resource-adapters>

              </subsystem>

       

      This is an excerpt of the ra.xml for the outbound connection factories:

       

          <outbound-resourceadapter>

            <connection-definition>

              <managedconnectionfactory-class>

                com.swiftmq.connector.v16.outbound.ManagedConnectionFactoryImpl

              </managedconnectionfactory-class>

              <config-property>

                <config-property-name>connectionFactoryName</config-property-name>

                <config-property-type>java.lang.String</config-property-type>

                <config-property-value>QueueConnectionFactory</config-property-value>

              </config-property>

              <config-property>

                <config-property-name>userName</config-property-name>

                <config-property-type>java.lang.String</config-property-type>

              </config-property>

              <config-property>

                <config-property-name>password</config-property-name>

                <config-property-type>java.lang.String</config-property-type>

              </config-property>

              <connectionfactory-interface>

                javax.jms.QueueConnectionFactory

              </connectionfactory-interface>

              <connectionfactory-impl-class>

                com.swiftmq.connector.v16.outbound.ConnectionFactoryImpl

              </connectionfactory-impl-class>

              <connection-interface>

                javax.jms.QueueConnection

              </connection-interface>

              <connection-impl-class>

                com.swiftmq.connector.v16.outbound.QueueConnectionImpl

              </connection-impl-class>

            </connection-definition>

            <connection-definition>

              <managedconnectionfactory-class>

                com.swiftmq.connector.v16.outbound.ManagedConnectionFactoryImpl

              </managedconnectionfactory-class>

              <config-property>

                <config-property-name>connectionFactoryName</config-property-name>

                <config-property-type>java.lang.String</config-property-type>

                <config-property-value>TopicConnectionFactory</config-property-value>

              </config-property>

              <config-property>

                <config-property-name>userName</config-property-name>

                <config-property-type>java.lang.String</config-property-type>

              </config-property>

              <config-property>

                <config-property-name>password</config-property-name>

                <config-property-type>java.lang.String</config-property-type>

              </config-property>

              <connectionfactory-interface>

                javax.jms.TopicConnectionFactory

              </connectionfactory-interface>

              <connectionfactory-impl-class>

                com.swiftmq.connector.v16.outbound.ConnectionFactoryImpl

              </connectionfactory-impl-class>

              <connection-interface>

                javax.jms.TopicConnection

              </connection-interface>

              <connection-impl-class>

                com.swiftmq.connector.v16.outbound.TopicConnectionImpl

              </connection-impl-class>

            </connection-definition>

            <connection-definition>

              <managedconnectionfactory-class>

                com.swiftmq.connector.v16.outbound.ManagedConnectionFactoryImpl

              </managedconnectionfactory-class>

              <config-property>

                <config-property-name>connectionFactoryName</config-property-name>

                <config-property-type>java.lang.String</config-property-type>

                <config-property-value>ConnectionFactory</config-property-value>

              </config-property>

              <config-property>

                <config-property-name>userName</config-property-name>

                <config-property-type>java.lang.String</config-property-type>

              </config-property>

              <config-property>

                <config-property-name>password</config-property-name>

                <config-property-type>java.lang.String</config-property-type>

              </config-property>

              <connectionfactory-interface>

                javax.jms.ConnectionFactory

              </connectionfactory-interface>

              <connectionfactory-impl-class>

                com.swiftmq.connector.v16.outbound.ConnectionFactoryImpl

              </connectionfactory-impl-class>

              <connection-interface>

                javax.jms.Connection

              </connection-interface>

              <connection-impl-class>

                com.swiftmq.connector.v16.outbound.ConnectionImpl

              </connection-impl-class>

            </connection-definition>

            <transaction-support>XATransaction</transaction-support>

            <authentication-mechanism>

              <authentication-mechanism-type>BasicPassword</authentication-mechanism-type>

              <credential-interface>javax.resource.spi.security.PasswordCredential</credential-interface>

            </authentication-mechanism>

            <reauthentication-support>false</reauthentication-support>

          </outbound-resourceadapter>

       

      As you see, class com.swiftmq.connector.v16.outbound.ManagedConnectionFactoryImpl is used to create 3 different Types of JMS connection factories (Queue, Topic and unified). If I now deploy and start the RA, it seems JBoss fetches all entries with the name of the specified ManagedConnectionFactory and creates a JNDI entry which fails because the name is already registered:

       

      17:57:38,552 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-13) JBAS015876: Starting deployment of "swiftmq_jca16.rar"

      17:57:38,905 INFO  [stdout] (MSC service thread 1-4) [SwiftMQ | ManagedConnectionFactoryImpl, connectionFactoryName=QueueConnectionFactory]/createConnectionFactory, connectionManager=org.jboss.jca.core.connectionmanager.tx.TxConnectionManagerImpl@156a6be ...

      17:57:38,906 INFO  [stdout] (MSC service thread 1-4) [SwiftMQ | ManagedConnectionFactoryImpl, connectionFactoryName=QueueConnectionFactory]/createConnectionFactory, connectionManager=org.jboss.jca.core.connectionmanager.tx.TxConnectionManagerImpl@156a6be returns: com.swiftmq.connector.v16.outbound.ConnectionFactoryImpl@147bc1

      17:57:38,907 INFO  [org.jboss.as.deployment.connector] (MSC service thread 1-4) JBAS010406: Registered connection factory java:/comp/env/CF

      17:57:38,910 INFO  [stdout] (MSC service thread 1-4) [SwiftMQ | ManagedConnectionFactoryImpl, connectionFactoryName=TopicConnectionFactory]/createConnectionFactory, connectionManager=org.jboss.jca.core.connectionmanager.tx.TxConnectionManagerImpl@7c9b46 ...

      17:57:38,910 INFO  [stdout] (MSC service thread 1-4) [SwiftMQ | ManagedConnectionFactoryImpl, connectionFactoryName=TopicConnectionFactory]/createConnectionFactory, connectionManager=org.jboss.jca.core.connectionmanager.tx.TxConnectionManagerImpl@7c9b46 returns: com.swiftmq.connector.v16.outbound.ConnectionFactoryImpl@b635d7

      17:57:38,911 INFO  [org.jboss.as.deployment.connector] (MSC service thread 1-4) JBAS010406: Registered connection factory java:/comp/env/CF

      17:57:38,913 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC00001: Failed to start service jboss.ra.deployment."swiftmq_jca16.rar_1": org.jboss.msc.service.StartException in service jboss.ra.deployment."swiftmq_jca16.rar_1": org.jboss.msc.service.StartException in anonymous service: JBAS010446: Failed to start RA deployment [swiftmq_jca16]

      ...

      Caused by: org.jboss.msc.service.DuplicateServiceException: Service jboss.connector.connection-factory.java:/comp/env/CF is already registered

       

      This seems to be a bug for me. Or is there a way to configure it?

       

       

      Thanks,

      Andreas