<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">
<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>
                                <td>
                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="https://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>
                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px; -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
Bug in creating ManagedConnectionFactory instance?
</h3>
<span style="margin-bottom: 10px;">
created by <a href="https://community.jboss.org/people/amueller">Andreas Mueller</a> in <i>IronJacamar</i> - <a href="https://community.jboss.org/message/738535#738535">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>This is my configuration (AS 7.1.1):</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>        <subsystem xmlns="urn:jboss:domain:resource-adapters:1.0"></p><p>            <resource-adapters></p><p>                <resource-adapter></p><p>                    <archive></p><p>                        swiftmq_jca16.rar</p><p>                    </archive></p><p>                    <transaction-support>XATransaction</transaction-support></p><p>                    <config-property name="debugMode"></p><p>                        true</p><p>                    </config-property></p><p>                    <connection-definitions></p><p>                        <connection-definition class-name="<strong>com.swiftmq.connector.v16.outbound.ManagedConnectionFactoryImpl</strong>" jndi-name="java:/comp/env/CF" pool-name="SwiftMQConnectionFactoryPool"></p><p>                            <security></p><p>                                <application/></p><p>                            </security></p><p>                        </connection-definition></p><p>                    </connection-definitions></p><p>                    <admin-objects></p><p>                        <admin-object class-name="com.swiftmq.jms.QueueImpl" jndi-name="java:/com/env/testqueue1" pool-name="testqueue1"></p><p>                            <config-property name="queueName"></p><p>                                testqueue1@router1</p><p>                            </config-property></p><p>                        </admin-object></p><p>                    </admin-objects></p><p>                </resource-adapter></p><p>            </resource-adapters></p><p>        </subsystem></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>This is an excerpt of the ra.xml for the outbound connection factories:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>    <outbound-resourceadapter></p><p>      <connection-definition></p><p>        <managedconnectionfactory-class></p><p>          <strong>com.swiftmq.connector.v16.outbound.ManagedConnectionFactoryImpl</strong></p><p>        </managedconnectionfactory-class></p><p>        <config-property></p><p>          <config-property-name>connectionFactoryName</config-property-name></p><p>          <config-property-type>java.lang.String</config-property-type></p><p>          <config-property-value>QueueConnectionFactory</config-property-value></p><p>        </config-property></p><p>        <config-property></p><p>          <config-property-name>userName</config-property-name></p><p>          <config-property-type>java.lang.String</config-property-type></p><p>        </config-property></p><p>        <config-property></p><p>          <config-property-name>password</config-property-name></p><p>          <config-property-type>java.lang.String</config-property-type></p><p>        </config-property></p><p>        <connectionfactory-interface></p><p>          javax.jms.QueueConnectionFactory</p><p>        </connectionfactory-interface></p><p>        <connectionfactory-impl-class></p><p>          com.swiftmq.connector.v16.outbound.ConnectionFactoryImpl</p><p>        </connectionfactory-impl-class></p><p>        <connection-interface></p><p>          javax.jms.QueueConnection</p><p>        </connection-interface></p><p>        <connection-impl-class></p><p>         <strong> com.swiftmq.connector.v16.outbound.QueueConnectionImpl</strong></p><p>        </connection-impl-class></p><p>      </connection-definition></p><p>      <connection-definition></p><p>        <managedconnectionfactory-class></p><p>          com.swiftmq.connector.v16.outbound.ManagedConnectionFactoryImpl</p><p>        </managedconnectionfactory-class></p><p>        <config-property></p><p>          <config-property-name>connectionFactoryName</config-property-name></p><p>          <config-property-type>java.lang.String</config-property-type></p><p>          <config-property-value>TopicConnectionFactory</config-property-value></p><p>        </config-property></p><p>        <config-property></p><p>          <config-property-name>userName</config-property-name></p><p>          <config-property-type>java.lang.String</config-property-type></p><p>        </config-property></p><p>        <config-property></p><p>          <config-property-name>password</config-property-name></p><p>          <config-property-type>java.lang.String</config-property-type></p><p>        </config-property></p><p>        <connectionfactory-interface></p><p>          javax.jms.TopicConnectionFactory</p><p>        </connectionfactory-interface></p><p>        <connectionfactory-impl-class></p><p>          com.swiftmq.connector.v16.outbound.ConnectionFactoryImpl</p><p>        </connectionfactory-impl-class></p><p>        <connection-interface></p><p>          javax.jms.TopicConnection</p><p>        </connection-interface></p><p>        <connection-impl-class></p><p>          com.swiftmq.connector.v16.outbound.TopicConnectionImpl</p><p>        </connection-impl-class></p><p>      </connection-definition></p><p>      <connection-definition></p><p>        <managedconnectionfactory-class></p><p>          <strong>com.swiftmq.connector.v16.outbound.ManagedConnectionFactoryImpl</strong></p><p>        </managedconnectionfactory-class></p><p>        <config-property></p><p>          <config-property-name>connectionFactoryName</config-property-name></p><p>          <config-property-type>java.lang.String</config-property-type></p><p>          <config-property-value>ConnectionFactory</config-property-value></p><p>        </config-property></p><p>        <config-property></p><p>          <config-property-name>userName</config-property-name></p><p>          <config-property-type>java.lang.String</config-property-type></p><p>        </config-property></p><p>        <config-property></p><p>          <config-property-name>password</config-property-name></p><p>          <config-property-type>java.lang.String</config-property-type></p><p>        </config-property></p><p>        <connectionfactory-interface></p><p>          javax.jms.ConnectionFactory</p><p>        </connectionfactory-interface></p><p>        <connectionfactory-impl-class></p><p>          com.swiftmq.connector.v16.outbound.ConnectionFactoryImpl</p><p>        </connectionfactory-impl-class></p><p>        <connection-interface></p><p>          javax.jms.Connection</p><p>        </connection-interface></p><p>        <connection-impl-class></p><p>          com.swiftmq.connector.v16.outbound.ConnectionImpl</p><p>        </connection-impl-class></p><p>      </connection-definition></p><p>      <transaction-support>XATransaction</transaction-support></p><p>      <authentication-mechanism></p><p>        <authentication-mechanism-type>BasicPassword</authentication-mechanism-type></p><p>        <credential-interface>javax.resource.spi.security.PasswordCredential</credential-interface></p><p>      </authentication-mechanism></p><p>      <reauthentication-support>false</reauthentication-support></p><p>    </outbound-resourceadapter></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>As you see, class <strong>com.swiftmq.connector.v16.outbound.ManagedConnectionFactoryImpl</strong> 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:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>17:57:38,552 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-13) JBAS015876: Starting deployment of "swiftmq_jca16.rar"</p><p>17:57:38,905 INFO  [stdout] (MSC service thread 1-4) [SwiftMQ | ManagedConnectionFactoryImpl, connectionFactoryName=<strong>QueueConnectionFactory</strong>]/createConnectionFactory, connectionManager=org.jboss.jca.core.connectionmanager.tx.TxConnectionManagerImpl@156a6be ...</p><p>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</p><p>17:57:38,907 INFO  [org.jboss.as.deployment.connector] (MSC service thread 1-4) JBAS010406: Registered connection factory java:/comp/env/CF</p><p>17:57:38,910 INFO  [stdout] (MSC service thread 1-4) [SwiftMQ | ManagedConnectionFactoryImpl, connectionFactoryName=<strong>TopicConnectionFactory</strong>]/createConnectionFactory, connectionManager=org.jboss.jca.core.connectionmanager.tx.TxConnectionManagerImpl@7c9b46 ...</p><p>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</p><p>17:57:38,911 INFO  [org.jboss.as.deployment.connector] (MSC service thread 1-4) JBAS010406: Registered connection factory java:/comp/env/CF</p><p>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]</p><p>...</p><p>Caused by: org.jboss.msc.service.DuplicateServiceException: Service jboss.connector.connection-factory.java:/comp/env/CF is already registered</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>This seems to be a bug for me. Or is there a way to configure it?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Thanks,</p><p>Andreas</p></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/738535#738535">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in IronJacamar at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2098">Community</a></p>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>