1 Reply Latest reply on Jul 24, 2013 11:52 AM by synclpz

    custom JCA problem in SY

    boanergesza11

      Hi everyone;

       

      Im not sure, but I think there might be a problem referencing a custom JCA from within a SY app. I had posted this in the user forum with not much traction https://community.jboss.org/thread/229722?tstart=0

       

      Im hoping its a configuration problem on my side.

       

      Basicly we have a customer JCA that uses sockets and fixed length delimted messages to a mainframe. I have configured the jca rar in the standalone.xml of jboss.

       

      In the first iteration there was a EAR file containing the RAR and the SY jar app. Deploying that gave us

      Resource Adapter

      Service: java.lang.IllegalArgumentException: Unique key for ResourceAdapter 'socketjca.rar' couldn't be found.

              at org.switchyard.as7.extension.services.SwitchYardService.start(SwitchYardService.java:85)

              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.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_21]

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

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

      Caused by: java.lang.IllegalArgumentException: Unique key for ResourceAdapter 'socketjca.rar' couldn't be found.

              at org.switchyard.component.jca.deploy.JCAActivator.handleReferenceBinding(JCAActivator.java:211)

              at org.switchyard.component.jca.deploy.JCAActivator.activateBinding(JCAActivator.java:92)

              at org.switchyard.deploy.internal.Deployment.deployReferenceBindings(Deployment.java:274)

              at org.switchyard.deploy.internal.Deployment.start(Deployment.java:139)

              at org.switchyard.as7.extension.deployment.SwitchYardDeployment.start(SwitchYardDeployment.java:106)

              at org.switchyard.as7.extension.services.SwitchYardService.start(SwitchYardService.java:78)

              ... 5 more

       

      We then seperated the jca rar file out of the ear and deployed again and got the same problem. As per the users suggestions we eventually stripped out all the jars and indivudually deployed them with no success.

      Finally we combined the seperate interface jar in to one uber SY jar and deployed that along with the jca rar (sequentially as well) and that made no difference. My final step from here would be to forego SY's refernce to the JCA and do the JNDI lookup directly to access the JCA from the bean component. That is a last resort method though.

       

      What am I missing? Is there a problem in my config?

        • 1. Re: custom JCA problem in SY
          synclpz

          WARNING: inexperienced answer :-)

           

          As I see in source, SY makes use of org.jboss.as.connector.util.ConnectorServices.getRegisteredResourceAdapterIdentifier() to get ID of resource adapter. I also cannot see any class in JBoss 7 that calls ConnectorService.registerResourceAdapterIdentifier(). May be YOU should call this one in you RA upon it's deployment to get it registered? Then SY will find it...

           

          look at source of JCAMixIn: org.switchyard.component.test.mixins.jca.JCAMixIn


              private void deployResourceAdapterArchive(ResourceAdapterArchive raa, Map<String, String> connDefs) {
                 try {
                     _ironJacamar.deploy(raa, connDefs);
                     String raname = stripDotRarSuffix(raa.getName());
                     String raid = _ironJacamar.getResourceAdapterIdentifier(raname);
                     ConnectorServices.registerResourceAdapter(raname);
                     ConnectorServices.registerResourceAdapterIdentifier(raname, raid);
                 } catch (Throwable t) {
                     throw new RuntimeException(t);
                 }
             }
          
          


           

          Message was edited by: synclpz