7 Replies Latest reply on Jul 7, 2015 10:04 AM by martin.wortner

    How to setup JCA connector

    martin.wortner

      So far I have no success I'm wasting days with try-error cycles. Can anybody JCA aware help please.

       

      Setup ear with JCA rar file inside. The ear also contains .war file which will access the .rar. I have no idea anymore what is wrong now I'm getting:

       

      ERROR [org.jboss.as.controller.management-operation] (DeploymentScanner-threads - 1) JBAS014613: Operation ("deploy") failed - address: ([("deployment" => "SonicISOHostConnector-e
      ar-1.17-SNAPSHOT-local.ear")]) - failure description: {
          "JBAS014671: Failed services" => {"jboss.ra.deployment.\"SonicISOHostConnector-ear-1.17-SNAPSHOT-local.ear#SonicISOHostConnector-rar-1.17-SNAPSHOT.rar_SonicISO-ra\"" => "org.jboss.msc.serv
      ice.StartException in service jboss.ra.deployment.\"SonicISOHostConnector-ear-1.17-SNAPSHOT-local.ear#SonicISOHostConnector-rar-1.17-SNAPSHOT.rar_SonicISO-ra\":
      JBAS010446: Failed to start RA
      deployment [SonicISOHostConnector-ear-1.17-SNAPSHOT-local.ear#SonicISOHostConnector-rar-1.17-SNAPSHOT.rar]
          Caused by: org.jboss.jca.deployers.common.DeployException:
      IJ020063: Invalid connection factory implementation: ...host.jca.cci.ConnectionFactoryImpl"},
      "JBAS014771: Services with missing/unavailable dependencies" => ["jboss.naming.context.java.module.\"SonicISOHostConnector-ear-1.17-SNAPSHOT-local\".\"SonicISOHostConnector-war-1.17-SNAPSH
      OT\".env.eis.host is missing [jboss.naming.context.java.eis.isohost-localcsas]"]
      
      
      

      The first is new for me no idea what is the cause (in one thread they mentioned some dependency issues, but I have no clue) https://developer.jboss.org/thread/234062?start=0&tstart=0

      The later is know to me I tried to resolve it here to no avail https://developer.jboss.org/message/933348#933348

       

      It was working before on Glassfish, but I don't know where to make the changes to make it work. Any support highly appreciated.

        • 1. Re: How to setup JCA connector
          jesper.pedersen

          Try http://www.ironjacamar.org/doc/userguide/1.2/en-US/html/ch10.html#tools_rarinfo -- you will find it in the standalone distribution of IronJacamar.

           

          HTH

          • 2. Re: How to setup JCA connector
            martin.wortner

            I have downloaded that in the morning, you can use it on .rar only I have .ear and so far I'm struggling with no class defs found. Will share the output when I will succeed.

             

            After some struggling with classpath I got :

            javax.resource.spi.ResourceAllocationException: resource adapter isn't set

                    at .....jca.spi.SonicISOManagedConnectionFactory.createManagedConnection(SonicISOManagedConnectionFactory.java:85)

             

            I'm none the wiser.

            • 3. Re: How to setup JCA connector
              martin.wortner

              Any hints to second problem? with the naming? Do I need to specify resource-adapter in standalone.xml or ironjacamar.xml?

              • 4. Re: How to setup JCA connector
                jesper.pedersen

                standalone.xml + <archive>ear_packaged.ear#ear_packaged.rar</archive>

                 

                See wildfly/EarPackagedDeploymentTestCase.java at master · wildfly/wildfly · GitHub and friends... Or provide configuration and output from rar-info

                • 5. Re: How to setup JCA connector
                  martin.wortner

                  Hi, this is excerpt from my standalone.xml, is it then correct to have following configuration

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

                              <resource-adapters>

                                  <resource-adapter id="SonicISO-ra">

                                      <archive>

                                          SonicISOHostConnector-ear-1.17-SNAPSHOT-local.ear#SonicISOHostConnector-rar-1.17-SNAPSHOT.rar

                                      </archive>

                                      <connection-definitions>

                                          <connection-definition class-name="cz.test.loom.host.soniciso.jca.spi.SonicISOManagedConnectionFactory" jndi-name="java:/eis/isohost-localcsas" enabled="true" use-java-context="true" pool-name="SonicISOPool"/>

                                      </connection-definitions>

                                  </resource-adapter>

                              </resource-adapters>

                          </subsystem>

                  regarding the naming here is excerpt from my web.xml I hope this is all I need (standalone.xml to define resource adapter and then web.xml to define resource-ref)

                  <?xml version="1.0" encoding="UTF-8"?>
                  <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
                    <display-name>isohost-web</display-name>
                    <welcome-file-list>
                    <welcome-file>index.html</welcome-file>
                    <welcome-file>index.htm</welcome-file>
                    <welcome-file>index.jsp</welcome-file>
                    <welcome-file>default.html</welcome-file>
                    <welcome-file>default.htm</welcome-file>
                    <welcome-file>default.jsp</welcome-file>
                    </welcome-file-list>

                    <servlet>
                    <description></description>
                    <display-name>XProtocolServlet</display-name>
                    <servlet-name>xproto</servlet-name>
                    <servlet-class>cz.test.loom.host.soniciso.XProtoHostServlet</servlet-class>
                    <load-on-startup>1</load-on-startup>
                    </servlet>
                    <servlet-mapping>
                    <servlet-name>xproto</servlet-name>
                    <url-pattern>/xproto</url-pattern>
                    </servlet-mapping>

                    <servlet>
                    <description></description>
                    <display-name>EchoServlet</display-name>
                    <servlet-name>echo</servlet-name>
                    <servlet-class> cz.test.loom.host.soniciso.echo.EchoServlet</servlet-class>
                    <load-on-startup>2</load-on-startup>
                    </servlet>
                    <servlet-mapping>
                    <servlet-name>echo</servlet-name>
                    <url-pattern>/echo</url-pattern>
                    </servlet-mapping>

                    <resource-ref>
                    <res-ref-name>eis/host</res-ref-name>
                    <res-type>javax.resource.cci.ConnectionFactory</res-type>
                    <res-auth>Container</res-auth>
                    <res-sharing-scope>Shareable</res-sharing-scope>
                    <lookup-name>java:/eis/isohost-localcsas</lookup-name>
                    </resource-ref>
                  </web-app>

                  this is output of rar-info

                  Archive:        SonicISOHostConnector-rar-1.17-SNAPSHOT.rar

                  JCA version:    1.5

                  Type:          OutBound

                  Reauth:        No

                  SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".

                  SLF4J: Defaulting to no-operation (NOP) logger implementation

                  SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

                  Compliant:      Yes

                  Native:        No

                   

                   

                  Structure:

                  ----------

                  META-INF/

                  META-INF/MANIFEST.MF

                  META-INF/glassfish-resources.xml

                  META-INF/maven/

                  META-INF/maven/cz.test-nixdorf.loom.host/

                  META-INF/maven/cz.test-nixdorf.loom.host/SonicISOHostConnector-rar/

                  META-INF/maven/cz.test-nixdorf.loom.host/SonicISOHostConnector-rar/pom.properties

                  META-INF/maven/cz.test-nixdorf.loom.host/SonicISOHostConnector-rar/pom.xml

                  META-INF/ra.xml

                  SonicISOHostConnector-rar-1.17-SNAPSHOT.jar

                   

                   

                  Resource-adapter:

                  -----------------

                  Class: cz.test.loom.host.soniciso.jca.spi.SonicISOResourceAdapter

                    Config-property: MaxConnections (java.lang.Integer)

                    Config-property: SocketKeepAlive (java.lang.Boolean)

                    Config-property: SocketReuseAddress (java.lang.Boolean)

                    Config-property: SocketConnectTimeout (java.lang.Integer)

                    Config-property: SocketSOTimeout (java.lang.Integer)

                    Introspected Config-property: moduleLabel (java.lang.String)

                   

                   

                  Managed-connection-factory:

                  ---------------------------

                  Class: cz.test.loom.host.soniciso.jca.spi.SonicISOManagedConnectionFactory

                    Validating: No

                    Association: Yes

                    Sharable: javax.resource.spi.ResourceAllocationException: resource adapter isn't set

                          at cz.test.loom.host.soniciso.jca.spi.SonicISOManagedConnectionFactory.createManagedConnection(SonicISOManagedConnectionFactory.java:85)

                          at org.jboss.jca.as.rarinfo.Main.hasMcInterface(Main.java:863)

                          at org.jboss.jca.as.rarinfo.Main.hasDissociatableMcInterface(Main.java:834)

                          at org.jboss.jca.as.rarinfo.Main.main(Main.java:449)

                  Unknown

                    Enlistment: javax.resource.spi.ResourceAllocationException: resource adapter isn't set

                          at cz.test.loom.host.soniciso.jca.spi.SonicISOManagedConnectionFactory.createManagedConnection(SonicISOManagedConnectionFactory.java:85)

                          at org.jboss.jca.as.rarinfo.Main.hasMcInterface(Main.java:863)

                          at org.jboss.jca.as.rarinfo.Main.hasEnlistableMcInterface(Main.java:840)

                          at org.jboss.jca.as.rarinfo.Main.main(Main.java:452)

                  Unknown

                    CCI: No

                    ConnectionFactory (javax.resource.cci.ConnectionFactory):

                      Connection getConnection() throws ResourceException

                      Connection getConnection(ConnectionSpec) throws ResourceException

                      RecordFactory getRecordFactory() throws ResourceException

                      ResourceAdapterMetaData getMetaData() throws ResourceException

                      void setReference(Reference)

                      Reference getReference() throws NamingException

                    Connection (javax.resource.cci.Connection):

                      void close() throws ResourceException

                      LocalTransaction getLocalTransaction() throws ResourceException

                      ConnectionMetaData getMetaData() throws ResourceException

                      Interaction createInteraction() throws ResourceException

                      ResultSetInfo getResultSetInfo() throws ResourceException

                   

                   

                  META-INF/MANIFEST.MF:

                  ---------------------

                  Manifest-Version: 1.0

                  Archiver-Version: Plexus Archiver

                  Created-By: Apache Maven

                  Built-By: martin.wortner

                  Build-Jdk: 1.7.0_71

                   

                   

                   

                   

                  META-INF/glassfish-resources.xml:

                  ---------------------------------

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

                  <!DOCTYPE resources PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Resource Definitions//EN" "http://glassfish.org/dtds/glassfish-resources_1_5.dtd">

                  <resources>

                      <custom-resource jndi-name="logback/context-name" res-type="String" factory-class="org.glassfish.resources.custom.factory.PrimitivesAndStringFactory" enabled="true">

                        <property name="value" value="SonicISOConnector"/>

                      </custom-resource>

                  </resources>

                   

                   

                  META-INF/ra.xml:

                  ----------------

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

                  <connector id="Connector_ID" version="1.5"

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

                          <description>J2EE connector module for CSAS host system</description>

                          <display-name>HostConnector-CSAS</display-name>

                          <vendor-name>test-nixdorf</vendor-name>

                          <eis-type>Base24</eis-type>

                          <resourceadapter-version>1.0</resourceadapter-version>

                          <resourceadapter>

                                  <resourceadapter-class>cz.test.loom.host.soniciso.jca.spi.SonicISOResourceAdapter</resourceadapter-class>

                                  <config-property>

                                          <description>maximalni pocet spojeni [ms]</description>

                                          <config-property-name>MaxConnections</config-property-name>

                                          <config-property-type>java.lang.Integer</config-property-type>

                                          <config-property-value>3</config-property-value>

                                  </config-property>

                                  <config-property>

                                          <description>udava zda soket bude pouzivat KeepAlive</description>

                                          <config-property-name>SocketKeepAlive</config-property-name>

                                          <config-property-type>java.lang.Boolean</config-property-type>

                                          <config-property-value>true</config-property-value>

                                  </config-property>

                                  <config-property>

                                          <description>udava moznost znovupouziti soketu okamzite po jeho uzavreni</description>

                                          <config-property-name>SocketReuseAddress</config-property-name>

                                          <config-property-type>java.lang.Boolean</config-property-type>

                                          <config-property-value>true</config-property-value>

                                  </config-property>

                                  <config-property>

                                          <description>socket connect timeout [ms]</description>

                                          <config-property-name>SocketConnectTimeout</config-property-name>

                                          <config-property-type>java.lang.Integer</config-property-type>

                                          <config-property-value>11000</config-property-value>

                                  </config-property>

                                  <config-property>

                                          <description>socket blocking timeout [ms]</description>

                                          <config-property-name>SocketSOTimeout</config-property-name>

                                          <config-property-type>java.lang.Integer</config-property-type>

                                          <config-property-value>1500</config-property-value>

                                  </config-property>

                                  <outbound-resourceadapter>

                                          <connection-definition>

                                                  <managedconnectionfactory-class>cz.test.loom.host.soniciso.jca.spi.SonicISOManagedConnectionFactory</managedconnectionfactory-class>

                                                  <connectionfactory-interface>javax.resource.cci.ConnectionFactory</connectionfactory-interface>

                                                  <connectionfactory-impl-class>cz.test.loom.host.jca.cci.ConnectionFactoryImpl</connectionfactory-impl-class>

                                                  <connection-interface>javax.resource.cci.Connection</connection-interface>

                                                  <connection-impl-class>cz.test.loom.host.jca.cci.ConnectionImpl</connection-impl-class>

                                          </connection-definition>

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

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

                                  </outbound-resourceadapter>

                          </resourceadapter>

                  </connector>

                   

                   

                  Deployment descriptor:

                  ----------------------

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

                  <resource-adapters>

                    <resource-adapter>

                      <archive>SonicISOHostConnector-rar-1.17-SNAPSHOT.rar</archive>

                      <config-property name="SocketKeepAlive">true</config-property>

                      <config-property name="SocketSOTimeout">1500</config-property>

                      <config-property name="SocketReuseAddress">true</config-property>

                      <config-property name="MaxConnections">3</config-property>

                      <config-property name="SocketConnectTimeout">11000</config-property>

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

                      <connection-definitions>

                        <connection-definition class-name="cz.test.loom.host.soniciso.jca.spi.SonicISOManagedConnectionFactory" connectable="false" enabled="true" enlistment="true" jndi-name="java:jboss/eis/C

                  onnection" pool-name="Connection" sharable="true" use-ccm="true" use-java-context="true">

                          <pool>

                            <min-pool-size>0</min-pool-size>

                            <max-pool-size>10</max-pool-size>

                            <prefill>false</prefill>

                            <use-strict-min>false</use-strict-min>

                            <flush-strategy>FailingConnectionOnly</flush-strategy>

                          </pool>

                          <security>

                            <application/>

                          </security>

                        </connection-definition>

                      </connection-definitions>

                    </resource-adapter>

                  </resource-adapters>

                  Done.

                  • 6. Re: How to setup JCA connector
                    martin.wortner

                    So the problem with

                    IJ020063: Invalid connection factory implementation: ...host.jca.cci.ConnectionFactoryImpl" - See more at: https://developer.jboss.org/message/935043#935043 is resolved the name was not properly set in ra.xml and Glassfish ignored that value in contrast with jBoss. Decided to eliminate the reference from web.xml and first deploy it and then try to connect from the .war file.

                    • 7. Re: How to setup JCA connector
                      martin.wortner

                      Looks like everything was caused by the god-damned typo in ra.xml file. And the hint with adding lookup-name is needed as well