8 Replies Latest reply on Oct 25, 2011 10:29 AM by jesper.pedersen

    Porting legacy resource adapter from AS5 to AS7

    drosowski

      Hello,

       

      I have an resource adapter that is currently in production using JEE 5 and JBoss 5. I tried to deploy the RA to JBoss 7.0.2 Final and (apparently) everything worked fine. Except that it didn't bind the adapter to the jndi name I gave it (tried both, the management console and the standalone.xml file). After that I read some posts regarding resource adapters on this forum, stating that a lot of work has been done on the connector and that JBoss 7.1.0 should be given a try. Now I get a warning, saying that the connection factory is not bound:

       

      17:26:54,495 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-7) Starting deployment of "legacy.rar"

      17:26:54,526 WARN  [org.jboss.as.connector.deployers.RaXmlDeployer] (MSC service thread 1-7) IJ020013: Connection factory not bound: com.mycom.connector.legacy.LegacyManagedConnectionFactory

      17:26:54,526 INFO  [org.jboss.as.connector.deployers.RaXmlDeployer] (MSC service thread 1-7) IJ020002: Deployed: file:/C:/dev/jboss-as-7.1.0.Alpha2-SNAPSHOT/standalone/tmp/vfs/tempb202cc793b492ddb/legacy.rar-471bb98c321bac8a/contents/

      17:26:54,542 INFO  [org.jboss.as.server.controller] (DeploymentScanner-threads - 2) Deployed "legacy.rar"

       

      Any general hints on what to check on for the migration of resource adapters to JBoss 7?

       

      Cheers,

      Daniel

        • 1. Re: Porting legacy resource adapter from AS5 to AS7
          jesper.pedersen

          What does your resource-adapters subsystem configuration look like ?

          • 2. Re: Porting legacy resource adapter from AS5 to AS7
            drosowski

            Here you go:

             

                <subsystem xmlns="urn:jboss:domain:resource-adapters:1.0">
                    <resource-adapters>
                        <resource-adapter>
                            <archive>
                                legacy.rar
                            </archive>
                            <transaction-support>
                                NoTransaction
                            </transaction-support>
                            <connection-definitions>
                                <connection-definition class-name="com.mycom.connector.legacy.LegacyManagedConnectionFactory" jndi-name="java:/Myra" pool-name="MyraPool"/>
                            </connection-definitions>
                        </resource-adapter>
                    </resource-adapters>
                </subsystem>
            • 3. Re: Porting legacy resource adapter from AS5 to AS7
              jesper.pedersen

              That looks correct.

               

              What does the validator in the standalone IronJacamar distribution say (1.1.0.Alpha2) ? Alternative, you can configure the <archive-validator> element in the jca subsystem.

              1 of 1 people found this helpful
              • 4. Re: Porting legacy resource adapter from AS5 to AS7
                drosowski

                Hi Jesper,

                first of all thanks for the info about the validator, this might come in handy.

                This time though it gives me a "Validation successful" when running over my legacy.rar file.

                • 5. Re: Porting legacy resource adapter from AS5 to AS7
                  drosowski

                  Oh, I just noticed the legacy.rar.log file, which contains some errors:

                   

                  Severity: ERROR

                  Section: 6.5.3.2

                  Description: A ManagedConnectionFactory must implement a "public int hashCode()" method.

                  Code: com.mycom.connector.legacy.LegacyManagedConnectionFactory

                   

                  Severity: ERROR

                  Section: 6.5.3.2

                  Description: A ManagedConnectionFactory must implement a "public boolean equals(Object)" method.

                  Code: com.mycom.connector.legacy.LegacyManagedConnectionFactory

                   

                  Severity: ERROR

                  Section: 19.4.2

                  Description: A ResourceAdapter must implement a "public int hashCode()" method.

                  Code: com.mycom.connector.legacy.LegacyResourceAdapter

                   

                  Severity: ERROR

                  Section: 19.4.2

                  Description: A ResourceAdapter must implement a "public boolean equals(Object)" method.

                  Code: com.mycom.connector.legacy.LegacyResourceAdapter

                   

                  Well, I'll try to fix the errors and give feedback wether it worked or not.

                   

                  Cheers,

                  Daniel

                  • 6. Re: Porting legacy resource adapter from AS5 to AS7
                    drosowski

                    Implementing the needed methods didn't help either. Validation succeeds and the log file remains empty, but JBoss still gives me the message IJ020013: Connection factory not bound.

                    I looked in the management console, but the resource adapter doesn't show up in neither "Container -> Naming" nor "Connector -> Resource Adapter", although I have it configured in standalone.xml.

                    • 7. Re: Porting legacy resource adapter from AS5 to AS7
                      drosowski

                      Hi Jesper,

                       

                      I finally found out what caused the faulty deployment of my legacy RA. I grabbed the sources of ironjacamar and traced the deployment back to the AbstractResourceAdapterDeployer. It checks the connection factory if it implements Serializable and Referenceable. My legacy RA didn't implement these. Maybe a finer logging output would provide some insights (trace didn't tell me anything either). Thanks a lot for pointing me in the right direction!

                       

                      Cheers,

                      Daniel

                      • 8. Re: Porting legacy resource adapter from AS5 to AS7
                        jesper.pedersen

                        Both issues (JBJCA-688 and JBJCA-689) resolved - they will be available in our next update to AS7.

                         

                        Thanks for the feedback !