1 2 Previous Next 20 Replies Latest reply on Mar 13, 2014 3:47 PM by yangju

    Migrating Resource Adapter from JBoss 6 to WildFly

    simas_ch

      Hi,

       

      I tried to migrate a resource adapter currently running on JBoss 6.1.0 to WildFly.

       

      But I get an error:

       

      2013-10-29 14:42:24,466 WARN  [org.jboss.as.connector.deployers.RaXmlDeployer] (MSC service thread 1-2) IJ020004: Only one connection definition found with a mismatch in class-name: com.prodega.proshop.integration.IODataSource

      2013-10-29 14:42:24,469 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service jboss.ra.deployment."ProShopUniversalConnector.rar": org.jboss.msc.service.StartException in service jboss.ra.deployment."ProShopUniversalConnector.rar": org.jboss.msc.service.StartException in anonymous service: JBAS010446: Failed to start RA deployment [ProShopUniversalConnector]

        at org.jboss.as.connector.services.resourceadapters.deployment.ResourceAdapterXmlDeploymentService.start(ResourceAdapterXmlDeploymentService.java:135)

        at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1944) [jboss-msc-1.2.0.Beta2.jar:1.2.0.Beta2]

        at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1877) [jboss-msc-1.2.0.Beta2.jar:1.2.0.Beta2]

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_25]

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_25]

        at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_25]

      Caused by: org.jboss.msc.service.StartException in anonymous service: JBAS010446: Failed to start RA deployment [ProShopUniversalConnector]

        at org.jboss.as.connector.services.resourceadapters.deployment.ResourceAdapterXmlDeploymentService.start(ResourceAdapterXmlDeploymentService.java:120)

        ... 5 more

      Caused by: org.jboss.jca.deployers.common.DeployException: com.prodega.proshop.integration.spi.GenericManagedConnectionFactory not a valid connection definition

        at org.jboss.jca.deployers.common.AbstractResourceAdapterDeployer.findConnectionDefinitions(AbstractResourceAdapterDeployer.java:479)

        at org.jboss.jca.deployers.common.AbstractResourceAdapterDeployer.createObjectsAndInjectValue(AbstractResourceAdapterDeployer.java:1908)

        at org.jboss.as.connector.services.resourceadapters.deployment.ResourceAdapterXmlDeploymentService$AS7RaXmlDeployer.doDeploy(ResourceAdapterXmlDeploymentService.java:191)

        at org.jboss.as.connector.services.resourceadapters.deployment.ResourceAdapterXmlDeploymentService.start(ResourceAdapterXmlDeploymentService.java:113)

        ... 5 more

       

       

      2013-10-29 14:42:24,534 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) JBAS014613: Operation ("deploy") failed - address: ([("deployment" => "ProShopUniversalConnector.rar")]) - failure description: {"JBAS014671: Failed services" => {"jboss.ra.deployment.\"ProShopUniversalConnector.rar\"" => "org.jboss.msc.service.StartException in service jboss.ra.deployment.\"ProShopUniversalConnector.rar\": org.jboss.msc.service.StartException in anonymous service: JBAS010446: Failed to start RA deployment [ProShopUniversalConnector]

          Caused by: org.jboss.msc.service.StartException in anonymous service: JBAS010446: Failed to start RA deployment [ProShopUniversalConnector]

          Caused by: org.jboss.jca.deployers.common.DeployException: com.prodega.proshop.integration.spi.GenericManagedConnectionFactory not a valid connection definition"}}

       

      The old configuration was

       

      <connection-factories>

          <tx-connection-factory>

              <jndi-name>jca/IOConnector</jndi-name>

              <xa-transaction />

              <rar-name>ProShopUniversalConnector.rar</rar-name>

        <connection-definition>com.prodega.proshop.integration.IODataSource</connection-definition>

        </tx-connection-factory>

      </connection-factories>

       

      The new in WildFly:

       

      <resource-adapter id="ProShopUniversalConnector.rar">

          <archive>

               ProShopUniversalConnector.rar

          </archive>

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

          <connection-definitions>

              <connection-definition class-name="com.prodega.proshop.integration.IODataSource" jndi-name="jca/IOConnector" pool-name="IOConnector"/>

          </connection-definitions>

      </resource-adapter>

       

      Thanks for your help.

      Simon

        • 1. Re: Migrating Resource Adapter from JBoss 6 to WildFly
          jesper.pedersen

          Use http://www.ironjacamar.org/doc/userguide/1.1/en-US/html/ch10.html#tools_rarinfo 's sample deployment descriptor as a starting point

          • 2. Re: Migrating Resource Adapter from JBoss 6 to WildFly
            simas_ch

            When I use the converter to convert the DataSource I get:

             

            Okt 29, 2013 3:44:51 PM org.jboss.jca.as.converters.LegacyDsParser notSupport

            INFO: So far not support connection-factories

            Error: null

            java.lang.NullPointerException

                    at org.jboss.jca.as.converters.DataSourceConverter.convert(DataSourceConverter.java:68)

                    at org.jboss.jca.as.converters.Main.main(Main.java:73)

            • 3. Re: Migrating Resource Adapter from JBoss 6 to WildFly
              jeff.zhang

              I use latest ironjacamar 1.1 and doing convert.

              ./converter.sh -ra proshop-ds.xml proshop-ra.xml

               

              New xml is

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

              <resource-adapters>

                <resource-adapter id="ID">

                  <archive>ProShopUniversalConnector.rar</archive>

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

                  <connection-definitions>

                    <connection-definition class-name="FIXME" enabled="true" enlistment="true" jndi-name="java:jboss/jca/IOConnector" pool-name="jca/IOConnector" sharable="true" use-ccm="true" use-java-context="true">

                      <xa-pool>

                        <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>

                      <security>

                        <application/>

                      </security>

                      <timeout/>

                      <validation>

                        <background-validation>false</background-validation>

                        <use-fast-fail>false</use-fast-fail>

                      </validation>

                      <recovery no-recovery="false">

                        <recover-credential>

                          <user-name>user</user-name>

                          <password>password</password>

                        </recover-credential>

                      </recovery>

                    </connection-definition>

                  </connection-definitions>

                </resource-adapter>

              </resource-adapters>

               

              Please replace FIXME with classname "com.prodega.proshop.integration.IODataSource"

               

              1 of 1 people found this helpful
              • 4. Re: Migrating Resource Adapter from JBoss 6 to WildFly
                simas_ch

                Hi Jeff,

                 

                That helped at least for the configuration.

                 

                Now I get an error when WildFly is deploying the RAR:

                 

                2013-10-30 08:12:07,393 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC000001: Failed to start service jboss.ra.deployment."ProShopUniversalConnector.rar_IOConnector": org.jboss.msc.service.StartException in service jboss.ra.deployment."ProShopUniversalConnector.rar_IOConnector": org.jboss.msc.service.StartException in anonymous service: JBAS010446: Failed to start RA deployment [ProShopUniversalConnector]

                  at org.jboss.as.connector.services.resourceadapters.deployment.ResourceAdapterXmlDeploymentService.start(ResourceAdapterXmlDeploymentService.java:135)

                  at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1944) [jboss-msc-1.2.0.Beta2.jar:1.2.0.Beta2]

                  at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1877) [jboss-msc-1.2.0.Beta2.jar:1.2.0.Beta2]

                  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_25]

                  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_25]

                  at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_25]

                Caused by: org.jboss.msc.service.StartException in anonymous service: JBAS010446: Failed to start RA deployment [ProShopUniversalConnector]

                  at org.jboss.as.connector.services.resourceadapters.deployment.ResourceAdapterXmlDeploymentService.start(ResourceAdapterXmlDeploymentService.java:120)

                  ... 5 more

                Caused by: org.jboss.jca.deployers.common.DeployException: com.prodega.proshop.integration.spi.GenericManagedConnectionFactory not a valid connection definition

                  at org.jboss.jca.deployers.common.AbstractResourceAdapterDeployer.findConnectionDefinitions(AbstractResourceAdapterDeployer.java:479)

                  at org.jboss.jca.deployers.common.AbstractResourceAdapterDeployer.createObjectsAndInjectValue(AbstractResourceAdapterDeployer.java:1908)

                  at org.jboss.as.connector.services.resourceadapters.deployment.ResourceAdapterXmlDeploymentService$AS7RaXmlDeployer.doDeploy(ResourceAdapterXmlDeploymentService.java:191)

                  at org.jboss.as.connector.services.resourceadapters.deployment.ResourceAdapterXmlDeploymentService.start(ResourceAdapterXmlDeploymentService.java:113)

                  ... 5 more

                • 5. Re: Migrating Resource Adapter from JBoss 6 to WildFly
                  jesper.pedersen

                  Please, use

                   

                  http://www.ironjacamar.org/doc/userguide/1.1/en-US/html/ch10.html#tools_rarinfo

                   

                  to get an overview of your .rar - it will contain a sample deployment descriptor too.

                   

                  You'll need the implementation class of the ManagedConnectionFactory.

                  1 of 1 people found this helpful
                  • 6. Re: Migrating Resource Adapter from JBoss 6 to WildFly
                    simas_ch

                    I can't see a problem as the connector runs on JBoss 6.1.0 and GlassFish 3 and 4

                     

                    This is the output of rarinfo

                    Archive:     ProShopUniversalConnector.rar
                    JCA version:     1.5
                    Type:          OutBound
                    Reauth:          No
                    Compliant:     No
                    Native:          No
                    
                    Structure:
                    ----------
                    META-INF/
                    META-INF/MANIFEST.MF
                    META-INF/ra.xml
                    com/
                    com/prodega/
                    com/prodega/proshop/
                    com/prodega/proshop/integration/
                    com/prodega/proshop/integration/IOConnection.class
                    com/prodega/proshop/integration/IODataSource.class
                    com/prodega/proshop/integration/Printer.class
                    com/prodega/proshop/integration/exceptions/
                    com/prodega/proshop/integration/exceptions/IOTransactionException.class
                    com/prodega/proshop/integration/spi/
                    com/prodega/proshop/integration/spi/GenericManagedConnection$1.class
                    com/prodega/proshop/integration/spi/GenericManagedConnection.class
                    com/prodega/proshop/integration/spi/GenericManagedConnectionFactory.class
                    com/prodega/proshop/integration/spi/IOConnectionImpl.class
                    com/prodega/proshop/integration/spi/IODataSourceImpl$1.class
                    com/prodega/proshop/integration/spi/IODataSourceImpl.class
                    com/prodega/proshop/integration/spi/PrintAction.class
                    com/prodega/proshop/integration/spi/TransactionalAction.class
                    com/prodega/proshop/integration/spi/WriteAction.class
                    itextpdf-5.3.0.jar
                    
                    Managed-connection-factory:
                    ---------------------------
                    Class: com.prodega.proshop.integration.spi.GenericManagedConnectionFactory
                      Validating: No
                      Sharable: No
                      Enlistment: No
                      CCI: No
                      ConnectionFactory (com.prodega.proshop.integration.IODataSource):
                        IOConnection getConnection() 
                        void setReference(Reference) 
                        Reference getReference() throws NamingException
                      Connection (com.prodega.proshop.integration.IOConnection):
                        void runDailyend(boolean) throws ResourceException
                        void write(String, byte[]) 
                        void print(String, byte[], int) 
                        void close() 
                    
                    META-INF/MANIFEST.MF:
                    ---------------------
                    Manifest-Version: 1.0
                    Ant-Version: Apache Ant 1.8.4
                    Created-By: 1.6.0_38-b05 (Sun Microsystems Inc.)
                    
                    
                    META-INF/ra.xml:
                    ----------------
                         Universal Connector     Prodega     Univeral     1.0                                                  com.prodega.proshop.integration.spi.GenericManagedConnectionFactory                    com.prodega.proshop.integration.IODataSource                    com.prodega.proshop.integration.spi.IODataSourceImpl                    com.prodega.proshop.integration.IOConnection                    com.prodega.proshop.integration.spi.IOConnectionImpl                              LocalTransaction                                   BasicPassword                    javax.resource.spi.security.PasswordCredential                              false               Deployment descriptor:
                    ----------------------
                        ProShopUniversalConnector.rar   LocalTransaction                        0         10         false         false         FailingConnectionOnly                                       
                    
                    test
                    • 7. Re: Migrating Resource Adapter from JBoss 6 to WildFly
                      jesper.pedersen

                      You have

                      com.prodega.proshop.integration.spi.GenericManagedConnectionFactory

                       

                      as the MCF ? Anyway, you may want to try the ./validator.sh on the .rar, as there appears to spec errors.

                       

                      IronJacamar is pretty strict with the .rar implementations, since we depend on the spec contracts.

                      • 8. Re: Migrating Resource Adapter from JBoss 6 to WildFly
                        simas_ch

                        I run validator.sh and it says:

                         

                        \dist\jca\ProShopUniversalConnector.rar

                        log4j:WARN No appenders could be found for logger (org.jboss.logging).

                        log4j:WARN Please initialize the log4j system properly.

                        Validation errors

                         

                        But in the logfile is simply a warning:

                         

                        Severity: WARNING

                        Section: 20.2

                        Description: Class files packaged inside RAR instead of JAR

                        • 9. Re: Migrating Resource Adapter from JBoss 6 to WildFly
                          jesper.pedersen

                          That should be ok - we can work around that.

                           

                          Attach the source of the resource adapter if possible, if you still have deployment problems.

                          • 10. Re: Re: Migrating Resource Adapter from JBoss 6 to WildFly
                            simas_ch

                            Source code attached.

                             

                            Thanks a lot for your help!

                            • 11. Re: Re: Migrating Resource Adapter from JBoss 6 to WildFly
                              jesper.pedersen

                              I can't something just looking at the file - so better break out the debugger, and see what you can find.

                               

                              Let us know of your progress, and what the problem is/was.

                              • 12. Re: Migrating Resource Adapter from JBoss 6 to WildFly
                                simas_ch

                                How should I debug that?

                                The error happens when WildFly is deploying the resource adapter.

                                • 13. Re: Migrating Resource Adapter from JBoss 6 to WildFly
                                  jesper.pedersen

                                  Start by enabling TRACE logging for org.jboss.as.connector and org.jboss.jca - then check if the applied activation metadata is correct.

                                   

                                  If so, start to debug through AbstractResourceAdapterDeployer to find the place where it goes wrong. If not, you are looking for something in WildFly, so you will need to debug there.

                                   

                                  IronJacamar: https://github.com/ironjacamar/ironjacamar/tree/1.1

                                  WildFly: https://github.com/wildfly/wildfly/

                                   

                                  HTH

                                  • 14. Re: Migrating Resource Adapter from JBoss 6 to WildFly
                                    simas_ch

                                    I found a warning in the log file:

                                     

                                    2013-11-06 09:57:44,662 WARN  [org.jboss.as.connector.deployers.RaXmlDeployer] (MSC service thread 1-7) IJ020004: Only one connection definition found with a mismatch in class-name: com.prodega.proshop.integration.IODataSource

                                     

                                    What does this mean?

                                    1 2 Previous Next