1 2 3 Previous Next 30 Replies Latest reply: Sep 29, 2011 10:55 AM by dstockdreher RSS

Creating resources for a resource adapter

Martin Phillips Newbie

Hi all,

 

I'm working with a JCA Resource adapter which I have sucessfully deployed on JBoss 6, but am struggling to find how to create resources for it on JBoss 7. 

 

On JBoss 6 I dropped a resourceAdapter-ds.xml file into the deploy directory along with the resource adaptrer .rar file and the resources it defined were created (I could see log information that it was creating the resources).

 

On JBoss 7 nothing seems to happen when I drop the -ds.xml file in the deployments directory.

 

I've tried looking through the documentation, but can't find anything much on deploying resource adapters for v7.  Can anyone point me in the right direction?

 

Hope you can help.

 

Martin.

  • 3. Re: Creating resources for a resource adapter
    Martin Phillips Newbie

    Those links looks really promising - I'll have a read through it in more detail. 

     

    Can I just confirm that this is implying that the method of defining resources for a JCA RA has changed significantly from JBoss 6? (or have I gotten the wrong end of the stick? )

  • 4. Re: Creating resources for a resource adapter
    Jesper Pedersen Master

    Everything has changed for the better Read my blogs to get a feeling of why.

     

    I put an AS 7 documentation place holder here: https://docs.jboss.org/author/display/AS7/Resource+adapters

  • 5. Re: Creating resources for a resource adapter
    Martin Phillips Newbie

    Fantastic, thanks guys!

  • 6. Re: Creating resources for a resource adapter
    Jesper Pedersen Master

    If you are looking for unit testing - you can start here or use the AS 7/Arquillian stuff.

  • 7. Re: Creating resources for a resource adapter
    Martin Phillips Newbie

    I've managed to get a chunk further, but still not all the way there.

     

    From the documentation:

     

    5.2.1

    A resource adapter can be configured using two different ways 

         META-INF/ironjacamar.xml for internal configuration

        -ra.xml for external configuration

     

    I tried putting a -ra.xml file in the deployments directory along with the RA, but that didn't seem to do anything at all, so I had a bash at editing the standalone.xml file to put the content directly in there.  This seemed to do a lot more.  Perhaps the documentation could be updated to point this out as an option.

     

    So, now when the RA tries to deploy it's getting on to trying to create resources, but is failing with the following error.

     

     

    The subsystem definition I'm using is at the bottom.  Any thoughts?

     

    I've tried with/without the use-java-context flag

    I've tried with/without the java: at the start of the jndi-name

    I'm not even sure if it's these elements that are causing the problem :-)

     

     

     

     

    10:11:34,593 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) Starting deployment of "wmq.jmsra.rar"

    10:11:35,937 INFO  [org.jboss.as.connector.metadata.deployment.ResourceAdapterDeploymentService$AS7RaDeployer] (MSC service thread 1-4) IJ020001: Required license terms for file:/C:/jboss.7.0.0/standalone/tmp/vfs/temp1126829ead023e3e/wmq.jmsra.rar-36ecf3adaa8a6998/contents/

    10:11:36,343 INFO  [org.jboss.as.connector.metadata.deployment.ResourceAdapterXmlDeploymentService$AS7RaXmlDeployer] (MSC service thread 1-2) IJ020001: Required license terms for file:/C:/jboss.7.0.0/standalone/tmp/vfs/temp1126829ead023e3e/wmq.jmsra.rar-36ecf3adaa8a6998/contents/

    10:11:36,343 WARN  [org.jboss.as.connector.metadata.deployment.ResourceAdapterXmlDeploymentService$AS7RaXmlDeployer] (MSC service thread 1-2) IJ020004: Only one connection definition found with a mismatch in class-name: javax.jms.ConnectionFactory

    10:11:36,375 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC00001: Failed to start service jboss.raxml."wmq.jmsra": org.jboss.msc.service.StartException in service jboss.raxml."wmq.jmsra": org.jboss.msc.service.StartException in anonymous service: Failed to start RA deployment [wmq.jmsra]

        at org.jboss.as.connector.metadata.deployment.ResourceAdapterXmlDeploymentService.start(ResourceAdapterXmlDeploymentService.java:106)

        at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1765)

        at org.jboss.msc.service.ServiceControllerImpl$ClearTCCLTask.run(ServiceControllerImpl.java:2291)

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

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

        at java.lang.Thread.run(Thread.java:662) [:1.6.0_25]

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

        at org.jboss.as.connector.metadata.deployment.ResourceAdapterXmlDeploymentService.start(ResourceAdapterXmlDeploymentService.java:98)

        ... 5 more

    Caused by: org.jboss.jca.deployers.common.DeployException: IJ020056: Deployment failed: file:/C:/jboss.7.0.0/standalone/tmp/vfs/temp1126829ead023e3e/wmq.jmsra.rar-36ecf3adaa8a6998/contents/

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

        at org.jboss.as.connector.metadata.deployment.ResourceAdapterXmlDeploymentService$AS7RaXmlDeployer.doDeploy(ResourceAdapterXmlDeploymentService.java:140)

        at org.jboss.as.connector.metadata.deployment.ResourceAdapterXmlDeploymentService.start(ResourceAdapterXmlDeploymentService.java:96)

        ... 5 more

    Caused by: javax.resource.spi.IllegalStateException: Non-explicit JNDI bindings not supported

        at org.jboss.as.connector.metadata.deployment.AbstractResourceAdapterDeploymentService$AbstractAS7RaDeployer.bindConnectionFactory(AbstractResourceAdapterDeploymentService.java:216)

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

        ... 7 more

     

    10:11:36,375 INFO  [org.jboss.as.server.controller] (DeploymentScanner-threads - 2) Deployment of "wmq.jmsra.rar" was rolled back with failure message {"Failed services" => {"jboss.raxml.\"wmq.jmsra\"" => "org.jboss.msc.service.StartException in service jboss.raxml.\"wmq.jmsra\": org.jboss.msc.service.StartException in anonymous service: Failed to start RA deployment [wmq.jmsra]"}}

    10:11:36,375 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 2) Service status report

      Services which failed to start:

          service jboss.raxml."wmq.jmsra": org.jboss.msc.service.StartException in service jboss.raxml."wmq.jmsra": org.jboss.msc.service.StartException in anonymous service: Failed to start RA deployment [wmq.jmsra]

     

    10:11:36,375 ERROR [org.jboss.as.deployment] (DeploymentScanner-threads - 1) {"Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"Failed services" => {"jboss.raxml.\"wmq.jmsra\"" => "org.jboss.msc.service.StartException in service jboss.raxml.\"wmq.jmsra\": org.jboss.msc.service.StartException in anonymous service: Failed to start RA deployment [wmq.jmsra]"}}}}

    10:11:37,578 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) Stopped deployment wmq.jmsra.rar in 1206ms

     

     

     

        <subsystem xmlns="urn:jboss:domain:resource-adapters:1.0">
            <resource-adapters>
               <resource-adapter>
                  <archive>wmq.jmsra.rar</archive>

     

                  <config-property name="traceEnabled">false</config-property>
                  <config-property name="traceLevel">3</config-property>
                  <config-property name="reconnectionRetryInterval">300000</config-property>
                  <config-property name="reconnectionRetryCount">5</config-property>

     

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

     

                  <connection-definitions>
                     <connection-definition class-name="javax.jms.ConnectionFactory"
                                            jndi-name="java:jms/ivt/IVTCF"
                                            pool-name="wmq.jmsra"
                                            use-java-context="false">

     

                        <config-property name="queueManager">ExampleQM</config-property>
                        <config-property name="channel">SYSTEM.DEF.SVRCONN</config-property>
                        <config-property name="transportType">CLIENT</config-property>
                        <config-property name="hostName">localhost</config-property>
                        <config-property name="port">1414</config-property>

     

                        <xa-pool>
                           <!-- MQ does not support connection interleaving -->
                           <interleaving>false</interleaving>
                        </xa-pool>
                        <security>
                           <application/>
                        </security>
                     </connection-definition>
                  </connection-definitions>
               </resource-adapter>
            </resource-adapters>

     

        </subsystem>
  • 8. Re: Creating resources for a resource adapter
    Jesper Pedersen Master

    -ra.xml deployments is only for IronJacamar/Standalone.

     

    See http://https://docs.jboss.org/author/display/AS7/Resource+adapters for deployments in AS 7.

     

    Try

     

    <connection-definition class-name="com.mycompany.myproject.MyMCF"
                                        jndi-name="java:jboss/jms/ivt/IVTCF"
                                        pool-name="wmq.jmsra">
    

     

    The class name needs to be the MCF and jndi-name should start with java:jboss/.

  • 9. Re: Creating resources for a resource adapter
    Martin Phillips Newbie

    OK, I've tried that, and a few others, and seem to be getting the same error with all of them

     

    jndi-name="java:/IVTCF"

    jndi-name="java:jboss"

    jndi-name="java:jboss/IVTCF"

    jndi-name="java:jboss/jms/ivt/IVTCF"

    jndi-name="java:/eis/AcmeConnectionFactory"

     

    Between changes I stop the server, make the change, then restart, then delete the '.failed' file under deployments to get it to attempt a deployment. (I wasn't sure if changes to standaline.xml would be dynamic, so erred on the safe side)

     

     

    Can I double check what you mean by MCF?  Managed Connection Factory?

    I'm a bit surprised that someone configuring a connection factory needs to define the implementation class rather than just the Interface class, as the interface and implementation are mapped together in the ra.xml of the resource adapter.

  • 10. Re: Creating resources for a resource adapter
    Jesper Pedersen Master

    Yes, the ManagedConnectionFactory needs to be in the class-name. If you leave class-name out (and the .rar only has one MCF) the deployer should find it automaitically.

     

    Multiple MCF implementations can map to the same CF interface...

  • 11. Re: Creating resources for a resource adapter
    Martin Phillips Newbie

    Okey dokey - I can manage that.  Any thoughts on the continued bindings problem?

     

    I've tried all of the following unsucessfully

     

    jndi-name="java:/IVTCF"

    jndi-name="java:jboss"

    jndi-name="java:jboss/IVTCF"

    jndi-name="java:jboss/jms/ivt/IVTCF"

    jndi-name="java:/eis/AcmeConnectionFactory"


    javax.resource.spi.IllegalStateException: Non-explicit JNDI bindings not supported

     

     

     

    Could it be being caused by any of the other properties that are specified for the RA?

  • 12. Re: Creating resources for a resource adapter
    Jesper Pedersen Master

    I have resolved https://issues.jboss.org/browse/JBJCA-640 which should give a better exception once integrated.

  • 13. Re: Creating resources for a resource adapter
    dstockdreher Newbie

    So for the time being  one should just have to replace the ironJacamar implementation in AS 7 final with the 1.0.2 Final version in order to get a better error message, or should the configuration above be valid in that case?

  • 14. Re: Creating resources for a resource adapter
    jaikiran pai Master

    AS 7.0.1 has been released http://www.jboss.org/jbossas/downloads.html which already has 1.0.3 version of IronJacamar. So give it a try on 7.0.1

1 2 3 Previous Next