3 Replies Latest reply: Aug 26, 2011 11:00 AM by Jesper Pedersen RSS

    More than 1 connection-definition within resource-adapter

    Filipe Gaspar Newbie

      Good afternoon,

       

      I'm starting to move from JBoss4.2.2 to JBoss 7.0.1.

      In Jboss 4.2.2 I used to have a resource adpater defined and a few connection definitions were using it.

      To give an inside view:

       

      I have a hst-connector.rar deployed with a ra.xml within META-INF, with the following content:

      Header 1

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

      <connector xmlns="http://java.sun.com/xml/ns/j2ee"

                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                 xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee

                 http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd"

                 version="1.5">

         <description>XPTO Connector</description>

         <display-name>HostConnector</display-name>

         <vendor-name>MyCompany</vendor-name>

         <eis-type>SocketIO</eis-type>

         <resourceadapter-version>4.0</resourceadapter-version>

         <license>

            <description>LGPL</description>

            <license-required>false</license-required>

         </license>

         <resourceadapter>

                 <resourceadapter-class>mycompany.connector.HstConnectorRA</resourceadapter-class>

            <outbound-resourceadapter>

            <connection-definition>

            <managedconnectionfactory-class>mycompany.connector.HstManagedConnFactory</managedconnectionfactory-class>

            <config-property>

                             <config-property-name>ServerName</config-property-name>

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

            </config-property>

            <config-property>

                             <config-property-name>PortNumber</config-property-name>

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

            </config-property>

            <config-property>

                             <config-property-name>SockTimeout</config-property-name>

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

            </config-property>

            <config-property>

                             <config-property-name>HeaderLength</config-property-name>

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

            </config-property>

            <config-property>

                             <config-property-name>MaxInteractions</config-property-name>

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

            </config-property>

            <connectionfactory-interface>mycompany.connector.IHstConnFactory</connectionfactory-interface>

            <connectionfactory-impl-class>mycompany.connector.HstConnFactoryImpl</connectionfactory-impl-class>

            <connection-interface>mycompany.connector.IHstConnection</connection-interface>

            <connection-impl-class>mycompany.connector.HstConnection</connection-impl-class>

           </connection-definition>

       

            <transaction-support>NoTransaction</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>

         <inbound-resourceadapter>

                   <messageadapter>

                              <messagelistener>

                                          <messagelistener-type>mycompany.deswin.lib.io.IForwardExecInteraction</messagelistener-type>

                                          <activationspec>

                                          <activationspec-class>mycompany.connector.RASimpleActivationSpec</activationspec-class>

      <required-config-property>

                                                     <config-property-name>listenerManager</config-property-name>

                                          </required-config-property>

                                          </activationspec>

                              </messagelistener>

                   </messageadapter>

         </inbound-resourceadapter>

         </resourceadapter>

      </connector>

       

      Then I have deployed an xpto-ds.xml with my connection-definitions. Two of them are for instance:

      Header 1

      <no-tx-connection-factory>

      <jndi-name>ra/HostConnectorOLO1</jndi-name>

      <rar-name>hst-connector.rar</rar-name>

      <connection-definition>mycompany.connector.IHstConnFactory</connection-definition>

      <adapter-display-name>HostConnector</adapter-display-name>

      <config-property name="ServerName" type="java.lang.String">server6x</config-property>

      <config-property name="PortNumber" type="java.lang.String">5054</config-property>

      <config-property name="HeaderLength" type="java.lang.String">2</config-property>

      </no-tx-connection-factory>

      - <no-tx-connection-factory>

      <jndi-name>ra/HostConnectorOLO2</jndi-name>

      <rar-name>hst-connector.rar</rar-name>

      <connection-definition>mycompany.connector.IHstConnFactory</connection-definition>

      <adapter-display-name>HostConnector</adapter-display-name>

      <config-property name="ServerName" type="java.lang.String">server6x</config-property>

      <config-property name="PortNumber" type="java.lang.String">5055</config-property>

      <config-property name="HeaderLength" type="java.lang.String">2</config-property>

      </no-tx-connection-factory>

       

       

       

      The problem came when i tried to do the same sing in Jboss 7.0.1.

      With int standalone.xml I have declared :

      Header 1

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

                  <resource-adapters>

                      <resource-adapter>

                          <archive>

                              hst-connector.rar

                          </archive>

                          <transaction-support>

                              NoTransaction

                          </transaction-support>

                          <connection-definitions>

                              <connection-definition class-name="mycompany.connector.HstManagedConnFactory" jndi-name="ra/HostConnectorQUE" enabled="true" use-java-context="true" use-ccm="false">

                                  <config-property name="ServerName">

                                      server6a

                                  </config-property>

                                  <config-property name="PortNumber">

                                      7002

                                  </config-property>

                                  <config-property name="HeaderLength">

                                      2

                                  </config-property>

                                  <security>

                                      <application>

                                          true

                                      </application>

                                  </security>

                              </connection-definition>

                             <connection-definition class-name="mycompany.connector.HstManagedConnFactory" jndi-name="ra/HostConnectorQUE2" enabled="true" use-java-context="true" use-ccm="false">

                                  <config-property name="ServerName">

                                      server6a

                                  </config-property>

                                  <config-property name="PortNumber">

                                      7003

                                  </config-property>

                                  <config-property name="HeaderLength">

                                      2

                                  </config-property>

                                  <security>

                                      <application>

                                          true

                                      </application>

                                  </security>

                              </connection-definition>

                          </connection-definitions>

                      </resource-adapter>

      </resource-adapters>

              </subsystem>

       

      The things goes well when I have only one connection-definition(ra/HostConnectorQUE). But when I add more then one (ra/HostConnectorQUE2) , it seems to only create one connection with the configuration properties of the last connection-definition declared...

       

       

      Thanks in advanced for your help.

      Regards,

      FG