10 Replies Latest reply on May 22, 2015 10:18 AM by jbertram

    Need help with making Sonic-MQ Resource Adapter  work in AS7

    nd_100

      We have Sonic MQ 8.5.1 as our jms provider.  I need to listen to certain topics for my application that we are developing in Jboss EAP6 i.e. jboss AS 7.1.  The resource adapter (v8.5.1) provided by Sonic does not yet support AS7.  Apparently, some of the folks on this forum have gotten this RA to work with AS7 with some tweaks.  I am getting an "Invalid connection definition" from SonicConnectionFactory but no other information, and vendor (sonic) hasn't been any help so far.

       

      Any information/pointers/configuration is appreciated, really hit a wall with this one...

       

       

      Based on all the info/docs I found on the web, I did the following:

      1. Disabled archive-validation in standalone-full.xml's jca subsection
      2. Created/deployed a new module for sonic libraries to AS7.
      3. Added this new module as dependency in MANIFEST.MF of the sonic Resource Adapter, and deployed the resource adapter to AS7.
      4. Modified standalone-full.xml's section <subsystem xmlns="urn:jboss:domain:ejb3:1.3"> to include the following:
                <mdb>
                        <resource-adapter-ref resource-adapter-name="sonic-jms-ra"/>
                        <bean-instance-pool-ref pool-name="mdb-strict-max-pool"/>
                    </mdb>
      5. Modified standalone-full.xml's resouce-adapters section as pasted at the end of this message.  Tried two different connection definitions, both are pasted below.
      6. When the server (w/ standalone-full.xml) startsup, I get the following "invalid connection definition" message 6 times (log attached along).

                21:41:01,853 WARN  [org.jboss.as.connector.deployers.RaXmlDeployer] (MSC service thread 1-1) IJ020009: Invalid connection definition with class-name: com.sonicsw.sonicmq.j2ee.jmsra.sonicra.SonicConnectionFactory

       

       

      First version of modifications to standalone-full.xml's resouce-adapters section:

       



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


          <resource-adapters>


             <resource-adapter>


                <archive>sonic-jms-ra.rar</archive>


                <!-- Resource adapter level config-property -->


                <!-- <config-property name="Server">localhost</config-property> -->


                <!-- <config-property name="Port">19001</config-property> -->


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


                <connection-definitions>


                   <connection-definition class-name="com.sonicsw.sonicmq.j2ee.jmsra.sonicra.SonicConnectionFactory"


                                          jndi-name="java:/SonicJMS/default/ConnectionFactory"


                                          pool-name="SonicJMSConnectionFactory">


                      <!-- Managed connection factory level config-property -->


                      <config-property name="Name">sonic-jms-ra</config-property>
      <!--
                      <pool> -->
      <!--
                         <min-pool-size>10</min-pool-size> -->
      <!--
                         <max-pool-size>100</max-pool-size> -->
      <!--
                      </pool> -->


                      <security>


                         <application/>


                      </security>


                   </connection-definition>


               </connection-definitions>


            </resource-adapter>


          </resource-adapters>


      </subsystem>

       

      Second version of modifications to standalone-full.xml's resouce-adapters section is attached along

        • 1. Re: Need help with making Sonic-MQ Resource Adapter  work in AS7
          jesper.pedersen

          Your configuration isn't correct.

           

          Start by running http://docs.jboss.org/ironjacamar/userguide/1.1/en-US/html/ch10.html#tools_rarinfo from IronJacamar 1.1.0.Beta4 on the .rar - then take the sample configuration from there.

          • 2. Re: Need help with making Sonic-MQ Resource Adapter  work in AS7
            nd_100

            Thanks for your guidence Jesper.  This got me a lot further.  Running into another (much smaller) issue, but i ll start a different thread. 

             

            For anyone else trying to integrate sonic mq 8.5.1 resource adapter into AS 7, here is what I did:

            - I download and ran the rarinfo tool that Jesper provided link to

            - Took the xml ( <resource-adapter> to  </resource-adapter>) from its output, and dropped that into <subsystem xmlns="urn:jboss:domain:resource-adapters:1.0"><resource-adapters>INSERT_HERE</resource-adapters>... within my standalone-full.xml. 

            -  Updated the basic info in the xml such as url, username/password, etc.

            -  Item 4 (mdb section in standalone-full.xml) in my original post above stays the same

            -  Created a AS7 module for com.sonic, and added the following jars in it: sonic_ASPI.jar, sonic_Crypto.jar, sonic_XA.jar, and sonic_Client.jar  (one of these jars in located in the resource-adapter rar file)

            -  Restarted jboss, and then deployed the resource adapter

             

            Note: JCA 1.6 requires hashCode and equals methods to be implemented by the resource-adapter class.  You can either disable validation (see my original post) OR (stating the obvious) you can derive your own class from the resource-adapter and implement these two methods (don't forget to update the classname in resource adapter's ra.xml).  I took the latter path, and it worked just fine.

             

            At this point, my mdb is able to receive messages (haven't tested send, just needed to be a client).  There is still an issue with using the jndi and the contextfactory, but i ll start a different post for that.  And will update this post once I get that resolved, hope it is helps...

            • 3. Re: Re: Need help with making Sonic-MQ Resource Adapter  work in AS7
              jayesh.vi

              Hi,

               

              I have done the following:

               

              For anyone else trying to integrate sonic mq 8.5.1 resource adapter into AS 7, here is what I did:

              - I download and ran the rarinfo tool that Jesper provided link to

              - Took the xml ( <resource-adapter> to  </resource-adapter>) from its output, and dropped that into <subsystem xmlns="urn:jboss:domain:resource-adapters:1.0"><resource-adapters>INSERT_HERE</resource-adapters>... within my standalone-full.xml.

              -  Updated the basic info in the xml such as url, username/password, etc.

              -  Item 4 (mdb section in standalone-full.xml) in my original post above stays the same

              -  Created a AS7 module for com.sonic, and added the following jars in it: sonic_ASPI.jar, sonic_Crypto.jar, sonic_XA.jar, and sonic_Client.jar  (one of these jars in located in the resource-adapter rar file)

              -  Restarted jboss, and then deployed the resource adapter


              It did deploy the sonic ra properly, but when i created a mdb using one of the connection factories it started giving ClassCastExceptions.

              The validator did not give any errors for the sonic-jms-ra.

              The standalone-full.xml, ra.xml, mdb and the logs are attached.

              • 4. Re: Re: Need help with making Sonic-MQ Resource Adapter  work in AS7
                jesper.pedersen

                You likely forgot the dependency from the application to the resource adapter deployment - see the classloading documentation, or search the forum.

                • 5. Re: Re: Need help with making Sonic-MQ Resource Adapter  work in AS7
                  jayesh.vi

                  Adding the following dependency in the module.xml for sonic fixed that problem:

                          <module name="javax.jms.api"/>

                   

                  Now there are authentication problems to connect to sonic:

                   

                  10:51:48,733 ERROR [Sonic Resource Adapter for JCA] (default-short-running-threads-threads - 1) EXCEPTION: Failure in SonicActivation: javax.jms.JMSSecurityException Inauthentic Client: javax.jms.JMSSecurityException: Inauthentic Client

                          at progress.message.jimpl.JMSExceptionUtil.createJMSSecurityException(JMSExceptionUtil.java:134) [sonic_Client.jar:]

                          at progress.message.jimpl.JMSExceptionUtil.createJMSSecurityException(JMSExceptionUtil.java:117) [sonic_Client.jar:]

                          at progress.message.jimpl.JMSExceptionUtil.createJMSSecurityException(JMSExceptionUtil.java:103) [sonic_Client.jar:]

                          at progress.message.jimpl.Connection.<init>(Connection.java:1059) [sonic_Client.jar:]

                          at progress.message.jimpl.xa.XAConnection.<init>(XAConnection.java:40) [sonic_XA.jar:]

                          at progress.message.jclient.xa.XAQueueConnectionFactory.createXAConnection(XAQueueConnectionFactory.java:217) [sonic_XA.jar:]

                          at com.sonicsw.sonicmq.j2ee.jmsra.impl.sonic.SonicActivation.setupConnection(SonicActivation.java:412) [sonic-jms-ra.jar:]

                          at com.sonicsw.sonicmq.j2ee.jmsra.impl.sonic.SonicActivation.setup(SonicActivation.java:164) [sonic-jms-ra.jar:]

                          at com.sonicsw.sonicmq.j2ee.jmsra.impl.sonic.SonicActivation$SetupActivation.run(SonicActivation.java:688) [sonic-jms-ra.jar:]

                          at org.jboss.jca.core.workmanager.WorkWrapper.run(WorkWrapper.java:212) [ironjacamar-core-impl-1.0.9.Final.jar:1.0.9.Final]

                          at org.jboss.threads.SimpleDirectExecutor.execute(SimpleDirectExecutor.java:33)

                          at org.jboss.threads.QueueExecutor.runTask(QueueExecutor.java:801)

                          at org.jboss.threads.QueueExecutor.access$100(QueueExecutor.java:45)

                          at org.jboss.threads.QueueExecutor$Worker.run(QueueExecutor.java:821)

                          at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_02]

                          at org.jboss.threads.JBossThread.run(JBossThread.java:122)

                  Caused by: [2101] progress.message.client.EInauthenticClient: Inauthentic Client

                          at progress.message.zclient.Connection.connectWithRecoveryOpt(Connection.java:1046) [sonic_Client.jar:]

                          at progress.message.zclient.ReconnectHelper.connectAndChaseSingleFailoverRedirect(ReconnectHelper.java:534) [sonic_Client.jar:]

                          at progress.message.zclient.Connection.connect(Connection.java:1545) [sonic_Client.jar:]

                          at progress.message.jimpl.Connection.<init>(Connection.java:854) [sonic_Client.jar:]

                   

                  The Username, Password are the same as were used by us to connect with JBoss 4.

                  We are running on FreeBSD.

                  • 6. Re: Need help with making Sonic-MQ Resource Adapter  work in AS7
                    jayesh.vi

                    I have been able to solve the above problem. But now i am unable to create Queues using admin objects in standalone.xml.

                     

                                         <admin-objects>

                                            <admin-object class-name="progress.message.jclient.Queue" jndi-name="java:/queue/sonicReplyQueue" use-java-context="true" pool-name="queue1">

                                                <config-property name="PhysicalName">

                                                    queue1

                                                </config-property>

                                            </admin-object>

                                        </admin-objects>

                    Can you tell me what is correct way of doing this.

                    • 7. Re: Need help with making Sonic-MQ Resource Adapter  work in AS7
                      mvosmer

                      Hi Nav, you are writing "I download and ran the rarinfo tool that Jesper provided link to"

                      The command is ./rar-info.sh myeis.rar

                      I don't understand the myeis.rar part. Did you create this file with the sonic rar files? Or is it the Sonic resource adapter?

                      I am puzzeled here, so I hope you will give me more details on this.

                      • 8. Re: Need help with making Sonic-MQ Resource Adapter  work in AS7
                        mvosmer

                        I am a bit further now. I was able to configure the resource adapter in JBOSS EAP 6.4.0.

                        This guide helped me:

                        How to install a module on JBoss AS 7

                        So i created this folder C:\EAP-6.4.0\modules\com\sonic\main and added the sonic jars and I created a module.xml file which contains:

                         

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

                        <module xmlns="urn:jboss:module:1.0" name="com.oracle">

                          <resources>

                            <resource-root path="mfcontext.jar"/>

                          <resource-root path="sonic_Client-7.6.2.jar"/>

                          <resource-root path="sonic_Crypto-7.6.2.jar"/>

                          <resource-root path="sonic_JMXRI-7.6.2.jar"/>

                          <resource-root path="sonic_XA.jar"/>

                          </resources>

                          <dependencies>

                            <module name="javax.api"/>

                            <module name="javax.transaction.api"/>

                          </dependencies>

                        </module>

                         

                        This is the relevant stuff from my standalone full xml file

                         

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

                                    <resource-adapters>

                                        <resource-adapter id="sonic-jms-ra.rar">

                                            <archive>

                                                sonic-jms-ra.rar

                                            </archive>

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

                                            <connection-definitions>

                                                <connection-definition class-name="com.sonicsw.sonicmq.j2ee.jmsra.impl.sonic.SonicManagedConnectionFactory" jndi-name="java:jboss/eis/SonicProvider" enabled="true" use-java-context="true" pool-name="SonicProvider" use-ccm="true">

                                                    <config-property name="com.sonicsw.jndi.mfcontext.domain">

                                                        dmLacent

                                                    </config-property>

                                                    <config-property name="ReconnectTimeout">

                                                        5

                                                    </config-property>

                                                    <config-property name="java.naming.security.principal">

                                                        jndi-user

                                                    </config-property>

                                                    <config-property name="LoginSPI">

                                                        com.sonicsw.jndi.mfcontext.MFContextFactory

                                                    </config-property>

                                                    <config-property name="java.naming.security.credentials">

                                                        jpw

                                                    </config-property>

                                                    <config-property name="ConnectionURLs">

                                                        tcp://aaaaaa:6000,tcp://xxxxx:6100

                                                    </config-property>

                                                    <config-property name="DebugLevel">

                                                        1

                                                    </config-property>

                                                    <xa-pool>

                                                        <min-pool-size>0</min-pool-size>

                                                        <max-pool-size>10</max-pool-size>

                                                        <prefill>false</prefill>

                                                        <use-strict-min>false</use-strict-min>

                                                        <flush-strategy>FailingConnectionOnly</flush-strategy>

                                                        <pad-xid>false</pad-xid>

                                                        <wrap-xa-resource>true</wrap-xa-resource>

                                                    </xa-pool>

                                                </connection-definition>

                                            </connection-definitions>

                         

                         

                         

                                            <admin-objects>

                                                <admin-object class-name="progress.message.jclient.Queue" jndi-name="java:/databank.incoming" use-java-context="true" pool-name="queue1">

                                                    <config-property name="PhysicalName">

                                                        databank.inbox.events

                                                    </config-property>

                                                </admin-object>

                                            </admin-objects>

                                        </resource-adapter>

                        • 9. Re: Need help with making Sonic-MQ Resource Adapter  work in AS7
                          mvosmer

                          The next challenge for me is to create Connection factories and queues that use the sonic resource adapter.

                          Can anybody help please?

                          • 10. Re: Need help with making Sonic-MQ Resource Adapter  work in AS7
                            jbertram

                            I'm not sure I understand your problem.  You've already defined an outgoing connection factory and a queue.  You simply have to look them up in JNDI and use them, no?