10 Replies Latest reply on Apr 1, 2014 2:30 AM by Laxmi Rathore

    Deploying .rar resource adapter

    Sergiu Pienar Expert

      Hi,

       

      Using JBoss 7.1.1. Final.

       

      I want to deploy a .rar resource adapter. I've created a module with jcr-2.0.jar in it.

       

      My app is structured as an .ear with some .war's inside. When I deploy the .rar in /deployments I get some NoDefClassFound exceptions as the classes in the .rar depend on the classes in the .ear .

       

      How could I make the .ear classes visible for the .rar ?

       

      Thanks.

        • 1. Re: Deploying .rar resource adapter
          Jesper Pedersen Master

          Sounds like cyclic class dependencies to me, which is wrong. You should figure out why that happens.

           

          The .ear should depend on the .rar deployment (Dependencies: deployment.eis.rar), or the .rar should be bundled with the .ear.

          • 2. Re: Deploying .rar resource adapter
            Sergiu Pienar Expert

            The .rar should depend on the .ear but adding a Dependencies: deployment.myDeployment.ear doesn't work.

             

            Any ideas ?



            Thx

            • 3. Re: Deploying .rar resource adapter
              Sergiu Pienar Expert

              I got it to deploy, with the following -ra.xml :

               

               

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

               

               

                <display-name>Adapter</display-name>

                <vendor-name>me</vendor-name>

                <eis-type>Connector System</eis-type>

                <resourceadapter-version>0.1.0</resourceadapter-version>

                <license>

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

                </license>

                <resourceadapter>

                 <resourceadapter-class>org.jboss.resource.deployment.DummyResourceAdapter</resourceadapter-class>  

                  <outbound-resourceadapter>

                    <connection-definition>

                       <managedconnectionfactory-class>com.ManagedConnectionFactoryImpl</managedconnectionfactory-class>

                       <connectionfactory-interface>com.ConnectionFactory</connectionfactory-interface>

                       <connectionfactory-impl-class>com.ConnectionFactoryImpl</connectionfactory-impl-class>

                       <connection-interface>comConnection</connection-interface>

                       <connection-impl-class>com.ConnectionImpl</connection-impl-class>

                    </connection-definition>

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

                    <reauthentication-support>false</reauthentication-support>

                  </outbound-resourceadapter>

                </resourceadapter>

              </connector>

               

              and I get these exceptions :

               

               

              13:50:40,046 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-6) MSC00001: Failed to start service jboss.ra.deployer."all-dev.ear#Connector-ra-impl-0.1.0": org.jboss.msc.service.StartException in service jboss.ra.deployer."all-dev.ear#Connector-ra-impl-0.1.0": JBAS010446: Failed to start RA deployment [all-dev.ear#Connector-ra-impl-0.1.0]

                      at org.jboss.as.connector.metadata.deployment.ResourceAdapterDeploymentService.start(ResourceAdapterDeploymentService.java:103)

                      at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

                      at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

                      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_25-ea]

                      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_25-ea]

                      at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_25-ea]

              Caused by: org.jboss.jca.deployers.common.DeployException: IJ020056: Deployment failed: file:/C:/JBoss7/standalone/tmp/vfs/deployment6acd12f5c8955bce/Connector-ra-impl-0.1.0.rar-4d885987a8d1957c/contents/

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

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

                      at org.jboss.as.connector.metadata.deployment.ResourceAdapterDeploymentService$AS7RaDeployer.doDeploy(ResourceAdapterDeploymentService.java:173)

                      at org.jboss.as.connector.metadata.deployment.ResourceAdapterDeploymentService.start(ResourceAdapterDeploymentService.java:100)

                      ... 5 more

              Caused by: org.jboss.jca.validator.ValidatorException: Severity: ERROR

              Section: 6.5.3.2

              Description: A ManagedConnectionFactory must be a non-null instance.

               

               

              The resource adapter subsystem looks like this :

               

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

                          <resource-adapters>

                              <resource-adapter>

                                  <archive>

                                      all-dev.ear#Connector-ra-impl-0.1.0.rar

                                  </archive>

                              </resource-adapter>

                          </resource-adapters>

                      </subsystem>

               

              I'd appreciate any help.

               

              Thank you.

              • 4. Re: Deploying .rar resource adapter
                Sergiu Pienar Expert

                I think I've managed to set up things, however upon calling the ConnectionManager.allocateConnection(this.mcf, this.info); I get this :

                 

                javax.resource.ResourceException: IJ000456: Unchecked throwable in ManagedConnection.getConnection() cl=org.jboss.jca.core.connectionmanager.listener.TxConnectionListener@1531abc[state=NORMAL managed connection=com.MyManagedConnection@160f199 connection handles=0 lastUse=1340364627186 trackByTx=false pool=org.jboss.jca.core.connectionmanager.pool.strategy.PoolByCri@1957aab pool internal context=SemaphoreArrayListManagedConnectionPool@a89d79[pool=LuceneConnectionFactory] xaResource=XAResourceWrapperImpl@1fa7e8e[xaResource=com.MyXAManager@8aa8ee pad=false overrideRmValue=false productName=test EIS productVersion=0.1.0 jndiName=java:jboss/MyConnector] txSync=null]

                • 5. Re: Deploying .rar resource adapter
                  Jesper Pedersen Master

                  You should try our resource adapter code generator - http://docs.jboss.org/ironjacamar/userguide/1.1/en-US/html/codegenerator.html - in the IronJacamar 1.1.0.Beta1 distribution

                  • 6. Re: Deploying .rar resource adapter
                    Sergiu Pienar Expert

                    Hi Jesper,

                     

                    The -ds.xml of my old resource adapter specifies something like this :

                     

                     

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

                    <!DOCTYPE connection-factories PUBLIC

                            "-//JBoss//DTD JBOSS JCA Config 1.5//EN"

                            "http://www.jboss.org/j2ee/dtd/jboss-ds_1_5.dtd">

                     

                     

                    <connection-factories>

                        <tx-connection-factory>

                            <jndi-name>java:jboss/MyConnector</jndi-name>

                            <xa-transaction/>

                            <rar-name>MyConnector-ra-impl-0.1.0.rar</rar-name>

                            <connection-definition>com.MyConnectionFactory</connection-definition>

                             <max-pool-size>300</max-pool-size>

                        </tx-connection-factory>

                    </connection-factories>

                     

                    Is the jndi name set here equivalent to the jndi name set in the connection-definition (resource subsystem of stadalone.xml) ?

                     

                    Thanks.

                    • 7. Re: Deploying .rar resource adapter
                      Sugumaran Thangaswamy Newbie

                      Hi

                       

                      Iam having a simillar problem .Iam getting the below exception

                       

                      How do we attach a rar actively to an MDB. iam getting the below exception

                       

                      I added an entry in standAlone.xml anyother setting is required ?

                       

                          <mdb>

                                      <resource-adapter-ref resource-adapter-name="SampleMDB.ear#ra.rar"/>

                                      <bean-instance-pool-ref pool-name="mdb-strict-max-pool"/>

                                 </mdb>

                       

                       

                       

                      JBAS014775:    New missing/unsatisfied dependencies:

                            service jboss.ra."SampleMDB.ear#ra" (missing) dependents: [service jboss.deployment.subunit."SampleMDB.ear"."MDB.jar".component.GRDResponseMdb.CREATE]

                      JBAS014777:   Services which failed to start:      service jboss.ra.deployer."SampleMDB.ear#ra": org.jboss.msc.service.StartException in service jboss.ra.deployer."SampleMDB.ear#ra": JBAS

                      RA deployment [SampleMDB.ear#ra]

                      • 8. Re: Deploying .rar resource adapter
                        jaikiran pai Master

                        Do you have any other exception stacktrace in that log?

                        • 9. Re: Deploying .rar resource adapter
                          Sugumaran Thangaswamy Newbie

                          Resolved the issue few things i was missing

                           

                          1.resource adapter configuration in standalone-full.xml.

                          2.There was one issue in the IBM MQ Jar version 6.0.1.2 the issue is resolved with fix pack 6.0.1.4

                           

                          Thanks Everyone

                          • 10. Re: Deploying .rar resource adapter
                            Laxmi Rathore Newbie

                            hello,

                            I am new to teiid. I have created a resource adapter for kairosdb. i created a .rar.

                            Rar structure is  1 METAINF --------------------------------------|  1.1 RA.XML

                                                                                                                      1.2 MENIFEA

                                                     2. CLASS FILE OF SOURCE CODE

                                                     3. DEPENDENCY JARS

                            content inside ra.xml is:

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

                            -<connector version="1.5" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/j2ee"><vendor-name>MyVendor</vendor-name><eis-type>kairosDB</eis-type><resourceadapter-version>1.0</resourceadapter-version>-<license><description> ${license} </description><license-required>true</license-required></license>-<resourceadapter><resourceadapter-class>org.teiid.resource.spi.BasicResourceAdapter</resourceadapter-class>-<outbound-resourceadapter>-<connection-definition><managedconnectionfactory-class>org.teiid.resource.adapter.kairosdb.kairosDBManagedConnectionFactory</managedconnectionfactory-class>

                            <!-- ${package-name}-->

                             

                             

                            <!-- Common properties for all connectors -->

                            -<config-property><description>{$display:"sample",$required:"true"}</description><config-property-name>SampleProperty</config-property-name><config-property-type>java.lang.String</config-property-type><config-property-value>sample-value</config-property-value></config-property>

                            <!-- kairosDB Specific properties START -->

                             

                             

                            <!-- kairosDB Specific properties END -->

                            <connectionfactory-interface>javax.resource.cci.ConnectionFactory</connectionfactory-interface><connectionfactory-impl-class>org.teiid.resource.spi.WrappedConnectionFactory</connectionfactory-impl-class><connection-interface>javax.resource.cci.Connection</connection-interface><connection-impl-class>org.teiid.resource.spi.WrappedConnection</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></resourceadapter></connector>

                             

                            Entry done by me in standalon.xml is:

                             

                            <resource-adapter id="kairosDB-8.7.0.Alpha2-SNAPSHOT.rar">

                                                <archive>

                                                    kairosDB-8.7.0.Alpha2-SNAPSHOT.rar

                                                </archive>

                                                <transaction-support>NoTransaction</transaction-support>

                                                <connection-definitions>

                                                    <connection-definition class-name="org.teiid.resource.adapter.kairosdb.KairosDBManagedConnectionFactory.java" jndi-name="java:/KairosDS" enabled="true" pool-name="java:/KairosDS">

                                                        <security>

                                                            <application/>

                                                        </security>

                                                        <validation>

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

                                                        </validation>

                                                    </connection-definition>

                                                </connection-definitions>

                                            </resource-adapter>

                             

                            And error Jboss giving :

                             

                             

                            jboss.as.server.deployment] (MSC service thread 1-3) JBAS015876: Starting deployment of "connector-kairosDB-8.7.0.Alpha2-SNAPSHOT.rar" (runtime-name: "connector-kairosDB-8.7.0.

                             

                             

                            jboss.as.server.deployment.scanner] (MSC service thread 1-4) JBAS015012: Started FileSystemDeploymentService for directory D:\jboss\jboss-eap-6.1.0\jboss-eap-6.1\standalone\dep

                             

                             

                            jboss.as.server.deployment.scanner] (MSC service thread 1-1) JBAS015012: Started FileSystemDeploymentService for directory C:\Users\laxmi_rathore\workspace\.metadata\.plugins\o

                            core\JBoss_7.1_Runtime_Server1393479335738\deploy

                            jboss.as.server.deployment] (MSC service thread 1-5) JBAS015876: Starting deployment of "kairos1-vdb.xml" (runtime-name: "kairos1-vdb.xml")

                            jboss.as.remoting] (MSC service thread 1-4) JBAS017100: Listening on 127.0.0.1:9999

                            jboss.as.remoting] (MSC service thread 1-7) JBAS017100: Listening on 127.0.0.1:4447

                            jboss.as.connector.deployers.RADeployer] (MSC service thread 1-5) IJ020001: Required license terms for file:/D:/jboss/jboss-eap-6.1.0/jboss-eap-6.1/standalone/tmp/vfs/temp46d60

                            irosDB-8.7.0.Alpha2-SNAPSHOT.rar-303d9ec3d1b3aab0/contents/

                            jboss.msc.service.fail] (MSC service thread 1-5) MSC000001: Failed to start service jboss.ra.deployer."connector-kairosDB-8.7.0.Alpha2-SNAPSHOT": org.jboss.msc.service.StartExc

                            ra.deployer."connector-kairosDB-8.7.0.Alpha2-SNAPSHOT": JBAS010446: Failed to start RA deployment [connector-kairosDB-8.7.0.Alpha2-SNAPSHOT]

                            connector.services.resourceadapters.deployment.ResourceAdapterDeploymentService.start(ResourceAdapterDeploymentService.java:116)

                            .service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]

                            .service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]

                            current.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:897) [rt.jar:1.6.0]

                            current.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:919) [rt.jar:1.6.0]

                            ead.run(Thread.java:736) [vm.jar:1.6.0]

                            .deployers.common.DeployException: IJ020056: Deployment failed: file:/D:/jboss/jboss-eap-6.1.0/jboss-eap-6.1/standalone/tmp/vfs/temp46d604843868517c/connector-kairosDB-8.7.0.Al

                            c3d1b3aab0/contents/

                            .deployers.common.AbstractResourceAdapterDeployer.createObjectsAndInjectValue(AbstractResourceAdapterDeployer.java:2449)

                            .deployers.common.AbstractResourceAdapterDeployer.createObjectsAndInjectValue(AbstractResourceAdapterDeployer.java:1104)

                            connector.services.resourceadapters.deployment.ResourceAdapterDeploymentService$AS7RaDeployer.doDeploy(ResourceAdapterDeploymentService.java:197)

                            connector.services.resourceadapters.deployment.ResourceAdapterDeploymentService.start(ResourceAdapterDeploymentService.java:112)

                             

                             

                            .validator.ValidatorException: Severity: ERROR

                             

                             

                            dapter must be a non-null instance.

                            .spi.BasicResourceAdapter (ModuleClassLoader for Module "deployment.connector-kairosDB-8.7.0.Alpha2-SNAPSHOT.rar:main" from Service Module Loader)

                             

                             

                             

                             

                             

                             

                            nnectionFactory must be a non-null instance.

                            .adapter.kairosdb.kairosDBManagedConnectionFactory (ModuleClassLoader for Module "deployment.connector-kairosDB-8.7.0.Alpha2-SNAPSHOT.rar:main" from Service Module Loader)

                             

                             

                             

                             

                             

                             

                            jboss.as.server] (ServerService Thread Pool -- 26) JBAS018559: Deployed "translator-kairosDB-8.7.0.Alpha2-SNAPSHOT.jar" (runtime-name : "translator-kairosDB-8.7.0.Alpha2-SNAPSH

                             

                             

                            jboss.as.server] (ServerService Thread Pool -- 26) JBAS018559: Deployed "kairosvdb.xml" (runtime-name : "kairosvdb.xml")

                            jboss.as.server] (ServerService Thread Pool -- 26) JBAS018559: Deployed "kairos1-vdb.xml" (runtime-name : "kairos1-vdb.xml")

                            jboss.as.server] (ServerService Thread Pool -- 26) JBAS018559: Deployed "connector-kairosDB-8.7.0.Alpha2-SNAPSHOT.rar" (runtime-name : "connector-kairosDB-8.7.0.Alpha2-SNAPSHOT

                             

                             

                            jboss.as.controller] (Controller Boot Thread) JBAS014774: Service status report

                            hich failed to start:      service jboss.ra.deployer."connector-kairosDB-8.7.0.Alpha2-SNAPSHOT": org.jboss.msc.service.StartException in service jboss.ra.deployer."connector-ka

                            SHOT": JBAS010446: Failed to start RA deployment [connector-kairosDB-8.7.0.Alpha2-SNAPSHOT]

                             

                             

                            jboss.as] (Controller Boot Thread) JBAS015961: Http management interface listening on http://127.0.0.1:9990/management

                            jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://127.0.0.1:9990

                            jboss.as] (Controller Boot Thread) JBAS015875: JBoss EAP 6.1.0.GA (AS 7.2.0.Final-redhat-8) started (with errors) in 11387ms - Started 230 of 293 services (1 services failed or

                            1 services are passive or on-demand).

                             

                            Thnx...