13 Replies Latest reply on Feb 5, 2012 11:12 PM by tc7

    How to deploy Resource Adapter native library dependencies in JBossas7

    tc7 Newbie

      I've had trouble trying to deploy a resource adapter (RAR) archive with a dependency on SAP JCO3 (libsapjco3.so).

      It appears the packaging used on JBoss 4.2.2.GA no-longer works for native libraries included in the RAR root.

       

      I found the following approach worked for me, but am interested in learning if this is the best way.

       

      1) created a module containing the SAP JCO jar and resource api dependency:

      <module xmlns="urn:jboss:module:1.0" name="com.sap.jco.7_11_1">

        <resources>

          <resource-root path="sapjco3.jar"/>

        </resources>

        <dependencies>

          <module name="javax.resource.api"/>

        </dependencies>

      </module>

       

      2) added a dependency to this module in the RAR manifest (META-INF/MANIFEST.MF):

      com.sap.jco.7_11_1

       

      3) moved libsapjco3.so from the RAR root into (new directory): <jboss-home>/bin/native

      4) added -Djava.library.path=<jboss-home>/bin/native to standalone.conf. Note this is a path reference (not to the file itself).

       

      Questions:

      1) Is it possible to package native libraries as a module dependency (rather than via the runtime parameter above)?

      2) Is it possible to package native libraries inside a RAR (as per JBoss 4.2.2.GA)?

        • 1. Re: How to deploy Resource Adapter native library dependencies in JBossas7
          Jesper Pedersen Master

          Packaging native libraries within the resource adapter archive has to work.

           

          Can you create an AS7 JIRA for the issue and possible attach a resource adapter which use a native library ?

          1 of 1 people found this helpful
          • 2. Re: How to deploy Resource Adapter native library dependencies in JBossas7
            tc7 Newbie

            Thanks for the suggestion Jesper, I've logged this as issue: https://issues.jboss.org/browse/AS7-1978

            For reference this affects JBossas7 v7.0.2.Final

             

            Here's the runtime stacktrace [java.lang.ExceptionInInitializerError: Error getting the version of the native layer: java.lang.UnsatisfiedLinkError: com.sap.conn.rfc.driver.CpicDriver.nativeCpicGetVersion]:

             

            20110929 11:47:58,659 INFO  [org.jboss.as.jpa] (MSC service thread 1-3) added javax.persistence.api dependency to mytestjcora.rar

            20110929 11:47:58,786 ERROR [stderr] (MSC service thread 1-2) java.lang.UnsatisfiedLinkError: no sapjco3 in java.library.path

            20110929 11:47:58,787 ERROR [stderr] (MSC service thread 1-2) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1738)

            20110929 11:47:58,787 ERROR [stderr] (MSC service thread 1-2) at java.lang.Runtime.loadLibrary0(Runtime.java:823)

            20110929 11:47:58,787 ERROR [stderr] (MSC service thread 1-2) at java.lang.System.loadLibrary(System.java:1028)

            20110929 11:47:58,788 ERROR [stderr] (MSC service thread 1-2) at com.sap.conn.jco.rt.DefaultJCoRuntime.loadLibrary(DefaultJCoRuntime.java:425)

            20110929 11:47:58,788 ERROR [stderr] (MSC service thread 1-2) at com.sap.conn.jco.rt.DefaultJCoRuntime.registerNativeMethods(DefaultJCoRuntime.java:293)

            20110929 11:47:58,788 ERROR [stderr] (MSC service thread 1-2) at com.sap.conn.jco.rt.JCoRuntime.registerNatives(JCoRuntime.java:891)

            20110929 11:47:58,788 ERROR [stderr] (MSC service thread 1-2) at com.sap.conn.rfc.driver.CpicDriver.<clinit>(CpicDriver.java:948)

            20110929 11:47:58,788 ERROR [stderr] (MSC service thread 1-2) at com.sap.conn.rfc.engine.DefaultRfcRuntime.getVersion(DefaultRfcRuntime.java:41)

            20110929 11:47:58,788 ERROR [stderr] (MSC service thread 1-2) at com.sap.conn.rfc.api.RfcApi.RfcGetVersion(RfcApi.java:253)

            20110929 11:47:58,788 ERROR [stderr] (MSC service thread 1-2) at com.sap.conn.jco.rt.MiddlewareJavaRfc.<clinit>(MiddlewareJavaRfc.java:195)

            20110929 11:47:58,789 ERROR [stderr] (MSC service thread 1-2) at com.sap.conn.jco.rt.DefaultJCoRuntime.initialize(DefaultJCoRuntime.java:74)

            20110929 11:47:58,804 ERROR [stderr] (MSC service thread 1-2) at com.sap.conn.jco.rt.JCoRuntimeFactory.<clinit>(JCoRuntimeFactory.java:23)

            20110929 11:47:58,804 ERROR [stderr] (MSC service thread 1-2) at com.sap.conn.jco.rt.RuntimeEnvironment.<init>(RuntimeEnvironment.java:40)

            20110929 11:47:58,804 ERROR [stderr] (MSC service thread 1-2) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

            20110929 11:47:58,804 ERROR [stderr] (MSC service thread 1-2) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)

            20110929 11:47:58,804 ERROR [stderr] (MSC service thread 1-2) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)

            20110929 11:47:58,805 ERROR [stderr] (MSC service thread 1-2) at java.lang.reflect.Constructor.newInstance(Constructor.java:513)

            20110929 11:47:58,805 ERROR [stderr] (MSC service thread 1-2) at java.lang.Class.newInstance0(Class.java:355)

            20110929 11:47:58,805 ERROR [stderr] (MSC service thread 1-2) at java.lang.Class.newInstance(Class.java:308)

            20110929 11:47:58,805 ERROR [stderr] (MSC service thread 1-2) at com.sap.conn.jco.ext.Environment.getInstance(Environment.java:121)

            20110929 11:47:58,805 ERROR [stderr] (MSC service thread 1-2) at com.sap.conn.jco.ext.Environment.registerDestinationDataProvider(Environment.java:216)

            20110929 11:47:58,805 ERROR [stderr] (MSC service thread 1-2) at com.myra.connector.jco.JCoManagedConnectionFactory.<clinit>(JCoManagedConnectionFactory.java:135)

            20110929 11:47:58,805 ERROR [stderr] (MSC service thread 1-2) at java.lang.Class.forName0(Native Method)

            20110929 11:47:58,806 ERROR [stderr] (MSC service thread 1-2) at java.lang.Class.forName(Class.java:247)

            20110929 11:47:58,806 ERROR [stderr] (MSC service thread 1-2) at org.jboss.jca.validator.ValidateClass.<init>(ValidateClass.java:88)

            20110929 11:47:58,806 ERROR [stderr] (MSC service thread 1-2) at org.jboss.jca.deployers.common.AbstractResourceAdapterDeployer.createObjectsAndInjectValue(AbstractResourceAdapterDeployer.java:1322)

            20110929 11:47:58,806 ERROR [stderr] (MSC service thread 1-2) at org.jboss.jca.deployers.common.AbstractResourceAdapterDeployer.createObjectsAndInjectValue(AbstractResourceAdapterDeployer.java:825)

            20110929 11:47:58,806 ERROR [stderr] (MSC service thread 1-2) at org.jboss.as.connector.metadata.deployment.ResourceAdapterDeploymentService$AS7RaDeployer.doDeploy(ResourceAdapterDeploymentService.java:139)

            20110929 11:47:58,806 ERROR [stderr] (MSC service thread 1-2) at org.jboss.as.connector.metadata.deployment.ResourceAdapterDeploymentService.start(ResourceAdapterDeploymentService.java:90)

            20110929 11:47:58,807 ERROR [stderr] (MSC service thread 1-2) at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824)

            20110929 11:47:58,807 ERROR [stderr] (MSC service thread 1-2) at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759)

            20110929 11:47:58,807 ERROR [stderr] (MSC service thread 1-2) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

            20110929 11:47:58,807 ERROR [stderr] (MSC service thread 1-2) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

            20110929 11:47:58,807 ERROR [stderr] (MSC service thread 1-2) at java.lang.Thread.run(Thread.java:662)

            20110929 11:47:58,828 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC00001: Failed to start service jboss.ra.mytestjcora: org.jboss.msc.service.StartException in service jboss.ra.mytestjcora: Failed to start RA deployment [mytestjcora]

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

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824)

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

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

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

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

            Caused by: org.jboss.jca.deployers.common.DeployException: IJ020056: Deployment failed: file:/opt/jboss/standalone/tmp/vfs/temp6fffaff86d4d55c6/mytestjcora.rar-2d836f33f4946a08/contents/

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

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

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

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

              ... 5 more

            Caused by: java.lang.ExceptionInInitializerError: Error getting the version of the native layer: java.lang.UnsatisfiedLinkError: com.sap.conn.rfc.driver.CpicDriver.nativeCpicGetVersion([I)I

              at com.sap.conn.jco.rt.MiddlewareJavaRfc.<clinit>(MiddlewareJavaRfc.java:207)

              at com.sap.conn.jco.rt.DefaultJCoRuntime.initialize(DefaultJCoRuntime.java:74)

              at com.sap.conn.jco.rt.JCoRuntimeFactory.<clinit>(JCoRuntimeFactory.java:23)

              at com.sap.conn.jco.rt.RuntimeEnvironment.<init>(RuntimeEnvironment.java:40)

              at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [:1.6.0_26]

              at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) [:1.6.0_26]

              at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) [:1.6.0_26]

              at java.lang.reflect.Constructor.newInstance(Constructor.java:513) [:1.6.0_26]

              at java.lang.Class.newInstance0(Class.java:355) [:1.6.0_26]

              at java.lang.Class.newInstance(Class.java:308) [:1.6.0_26]

              at com.sap.conn.jco.ext.Environment.getInstance(Environment.java:121)

              at com.sap.conn.jco.ext.Environment.registerDestinationDataProvider(Environment.java:216)

              at com.myra.connector.jco.JCoManagedConnectionFactory.<clinit>(JCoManagedConnectionFactory.java:135)

              at java.lang.Class.forName0(Native Method) [:1.6.0_26]

              at java.lang.Class.forName(Class.java:247) [:1.6.0_26]

              at org.jboss.jca.validator.ValidateClass.<init>(ValidateClass.java:88)

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

              ... 8 more

             

             

            20110929 11:47:59,043 INFO  [org.jboss.as.server.controller] (DeploymentScanner-threads - 1) Deployment of "mytestjcora.rar" was rolled back with failure message {"Failed services" => {"jboss.ra.mytestjcora" => "org.jboss.msc.service.StartException in service jboss.ra.mytestjcora: Failed to start RA deployment [mytestjcora]"}}

            20110929 11:47:59,044 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 1) Service status report

              Services which failed to start:

                  service jboss.ra.mytestjcora: org.jboss.msc.service.StartException in service jboss.ra.mytestjcora: Failed to start RA deployment [mytestjcora]

             

             

            20110929 11:47:59,045 ERROR [org.jboss.as.deployment] (DeploymentScanner-threads - 2) {"Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"Failed services" => {"jboss.ra.mytestjcora" => "org.jboss.msc.service.StartException in service jboss.ra.mytestjcora: Failed to start RA deployment [mytestjcora]"}}}}

            20110929 11:47:59,057 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) Stopped deployment mytestjcora.rar in 11ms

            • 3. Re: How to deploy Resource Adapter native library dependencies in JBossas7
              tc7 Newbie

              Once I'd figured out how to load the native library (see workaround https://issues.jboss.org/browse/AS7-1978) I discovered a strange anomoly with RAR filenames.

               

              org.jboss.jca.core.spi.mdr.NotFoundException: IJ000855: MyResourceAdapter isn't registered

               

              Basically the RAR filename must be all lowercase!

               

              This has already been picked up as:

              https://issues.jboss.org/browse/AS7-1686

               

              And is related to:

              https://issues.jboss.org/browse/AS7-1503

               

              Workaround

              At a bare minimum rename the RAR reference in standalone.xml, eg:

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

                        <resource-adapters>

                          <resource-adapter>

                            <archive>myresourceadapter.rar</archive>

                      ...

              Alternatively renaming all references (an the RAR filename) to myresourceadapter.rar keeps things consistent (and also works).

               

               

              Stack Trace

              13:23:40,955 INFO  [org.jboss.as.jpa] (MSC service thread 1-4) added javax.persistence.api dependency to MyResourceAdapter.rar

              13:23:41,215 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC00001: Failed to start service jboss.raxml.myresourceadapter_1: org.jboss.msc.service.StartException in service jboss.raxml.myresourceadapter_1: org.jboss.jca.core.spi.mdr.NotFoundException: IJ000855: MyResourceAdapter isn't registered

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

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

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

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

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

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

              Caused by: org.jboss.jca.core.spi.mdr.NotFoundException: IJ000855: MyResourceAdapter isn't registered

                        at org.jboss.jca.core.mdr.SimpleMetadataRepository.getResourceAdapter(SimpleMetadataRepository.java:150)

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

                        ... 5 more

               

              The workaround I found is to either rename the RAR reference in standalone.xml (only). Alternatively lowercase names all the way through work too.

               

              13:23:40,955 INFO  [org.jboss.as.jpa] (MSC service thread 1-4) added javax.persistence.api dependency to MyResourceAdapter.rar

              13:23:41,215 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC00001: Failed to start service jboss.raxml.myresourceadapter_1: org.jboss.msc.service.StartException in service jboss.raxml.myresourceadapter_1: org.jboss.jca.core.spi.mdr.NotFoundException: IJ000855: MyResourceAdapter isn't registered

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

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

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

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

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

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

              Caused by: org.jboss.jca.core.spi.mdr.NotFoundException: IJ000855: MyResourceAdapter isn't registered

                        at org.jboss.jca.core.mdr.SimpleMetadataRepository.getResourceAdapter(SimpleMetadataRepository.java:150)

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

                        ... 5 more

              • 4. Re: How to deploy Resource Adapter native library dependencies in JBossas7
                tc7 Newbie

                The next issue I had was more subtle. The connection factory class defined in my JBoss 4.2.2.GA RAR was javax.resource.cci.ConnectionFactory.

                 

                In JBossas7.0.2.Final this results in the following warning:

                 

                20110929 15:37:14,748 WARN  [org.jboss.as.connector.metadata.deployment.ResourceAdapterXmlDeploymentService$AS7RaXmlDeployer] (MSC service thread 1-1) IJ020004: Only one connection definition found with a mismatch in class-name: javax.resource.cci.ConnectionFactory

                20110929 15:37:14,749 INFO  [org.jboss.as.connector.metadata.deployment.ResourceAdapterXmlDeploymentService$AS7RaXmlDeployer] (MSC service thread 1-1) IJ020002: Deployed: file:/opt/jboss/standalone/tmp/vfs/tempb2678cc90637756/myresourceadapter.rar-8aea3cb769a05557/contents/

                20110929 15:37:14,750 INFO  [org.jboss.as.deployment.connector] (MSC service thread 1-1) Starting sevice service jboss.ra.myresourceadapter_1

                 

                 

                Replacing javax.resource.cci.ConnectionFactory with a specific instance of ManagedConnectionFactory com.myapp.connector.jco.JCoManagedConnectionFactory seems to do the trick.

                 

                This is the same as what's specified in ra.xml, eg:

                   <resourceadapter>

                      <resourceadapter-class>com.myapp.connector.jco.MyResourceAdapter</resourceadapter-class>

                      <outbound-resourceadapter>

                         <connection-definition>

                            <managedconnectionfactory-class>com.myapp.connector.jco.JCoManagedConnectionFactory</managedconnectionfactory-class>

                          ...

                • 5. Re: How to deploy Resource Adapter native library dependencies in JBossas7
                  Jesper Pedersen Master

                  Thanks for the JIRA

                   

                  Use a nightly build of AS7 - http://hudson.jboss.org/jenkins/view/JBoss%20AS/job/JBoss-AS-7.0.x/ - as our fixes are only going into AS 7.1.

                   

                  There is a fix for AS7-1686 in the pull request queue, so watch that.

                   

                  And lets see your <connection-definition> in the subsystem - my bet is that the class-name attribute doesn't point to the MCF. But remember to upgrade first.

                  • 6. Re: How to deploy Resource Adapter native library dependencies in JBossas7
                    tc7 Newbie

                    The final problem encountered was that the properties defined in the subsystem (standalone-preview.xml --> <resource-adapter>) aren't applied correctly.

                     

                    Present in jboss-as-7.0.2.Final.

                     

                    I got around this problem by specifying connection details in the ra.xml (which is tricky when trying to maintain different environments).

                     

                    Here's the bare bones subsystem config that works for me:

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

                              <resource-adapters>

                                <resource-adapter>

                                  <archive>myappjcora.rar</archive>

                                  <transaction-support>LocalTransaction</transaction-support>

                                  <connection-definitions>

                     

                                    <connection-definition

                                          class-name="com.myapp.connector.jco.JCoManagedConnectionFactory"

                                          pool-name="myappjcora_Pool"

                                          jndi-name="java:/eis/MyApp/Sap" use-java-context="true" enabled="true" use-ccm="true">

                     

                     

                    <!--

                    TODO: re-enable following integer parameters once supported.

                    -->

                     

                    <!--                   <config-property name="name">qa</config-property> -->

                    <!--                   <config-property name="ashost">mysap.svr.net</config-property> -->

                    <!--                   <config-property name="sysnr">23</config-property> -->

                    <!--                   <config-property name="client">300</config-property> -->

                    <!--                   <config-property name="user">RFC_USER</config-property> -->

                    <!--                   <config-property name="passwd">myapprfc</config-property> -->

                    <!--                   <config-property name="lang">EN</config-property> -->

                    <!--                   <config-property name="pool_capacity">2</config-property> -->

                    <!--                   <config-property name="peek_limit">5</config-property> -->

                    <!--                   <config-property name="sharedDestination">true</config-property> -->

                                      <pool>

                                         <max-pool-size>5</max-pool-size>

                                      </pool>

                                    </connection-definition>

                     

                                  </connection-definitions>

                                </resource-adapter>

                              </resource-adapters>

                            </subsystem> 

                     

                    Looks like this issue may have been fixed - I'll re-test in a nightly build.

                    https://issues.jboss.org/browse/AS7-1452

                    • 7. Re: How to deploy Resource Adapter native library dependencies in JBossas7
                      tc7 Newbie

                      I've re-tested this using a nightly build from the hudson link (10-Oct-2011):

                       

                      JBoss AS 7.1.0.Alpha2-SNAPSHOT "Ahoy!" starting

                       

                      1) resource adapter config in standalone-preview.xml:

                       

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

                                <resource-adapters>

                                  <resource-adapter>

                                    <archive>MyAppJCoRA.rar</archive>

                                    <transaction-support>LocalTransaction</transaction-support>

                                    <connection-definitions>

                       

                                      <connection-definition

                                            class-name="com.myapp.connector.jco.JCoManagedConnectionFactory"

                                            pool-name="myappjcora_Pool"

                                            jndi-name="java:/eis/MyApp/Sap" use-java-context="true" enabled="true" use-ccm="true">

                       

                       

                      <!--

                      TODO: re-enable following integer parameters once supported.

                      -->

                       

                      <!--                   <config-property name="name">qa</config-property> -->

                      <!--                   <config-property name="ashost">mysap.svr.net</config-property> -->

                      <!--                   <config-property name="sysnr">23</config-property> -->

                      <!--                   <config-property name="client">300</config-property> -->

                      <!--                   <config-property name="user">RFC_USER</config-property> -->

                      <!--                   <config-property name="passwd">myapprfc</config-property> -->

                      <!--                   <config-property name="lang">EN</config-property> -->

                      <!--                   <config-property name="pool_capacity">2</config-property> -->

                      <!--                   <config-property name="peek_limit">5</config-property> -->

                      <!--                   <config-property name="sharedDestination">true</config-property> -->

                                        <pool>

                                           <max-pool-size>5</max-pool-size>

                                        </pool>

                                      </connection-definition>

                       

                                    </connection-definitions>

                                  </resource-adapter>

                                </resource-adapters>

                              </subsystem> 

                       

                      output (error)

                      10:24:14,349 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) Starting deployment of "MyAppJCoRA.rar"

                      10:24:14,652 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC00001: Failed to start service jboss.ra.deployment.myappjcora_1: org.jboss.msc.service.StartException in service jboss.ra.deployment.myappjcora_1: org.jboss.jca.core.spi.mdr.NotFoundException: IJ000855: MyAppJCoRA isn't registered

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

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

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

                                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [:1.7.0]

                                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [:1.7.0]

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

                      Caused by: org.jboss.jca.core.spi.mdr.NotFoundException: IJ000855: MyAppJCoRA isn't registered

                                at org.jboss.jca.core.mdr.SimpleMetadataRepository.getResourceAdapter(SimpleMetadataRepository.java:150)

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

                                ... 5 more

                       

                       

                      10:24:14,657 INFO  [org.jboss.as.server.controller] (DeploymentScanner-threads - 2) Deployment of "MyAppJCoRA.rar" was rolled back with failure message {"Failed services" => {"jboss.ra.deployment.myappjcora_1" => "org.jboss.msc.service.StartException in service jboss.ra.deployment.myappjcora_1: org.jboss.jca.core.spi.mdr.NotFoundException: IJ000855: MyAppJCoRA isn't registered"}}

                      10:24:14,672 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) Stopped deployment MyAppJCoRA.rar in 15ms

                      10:24:14,673 ERROR [org.jboss.as.deployment] (DeploymentScanner-threads - 1) {"Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"Failed services" => {"jboss.ra.deployment.myappjcora_1" => "org.jboss.msc.service.StartException in service jboss.ra.deployment.myappjcora_1: org.jboss.jca.core.spi.mdr.NotFoundException: IJ000855: MyAppJCoRA isn't registered"}}}}

                       

                       

                      2) whereas the following config works fine (with corresponding change in rar filename):

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

                                <resource-adapters>

                                  <resource-adapter>

                                    <archive>myappjcora.rar</archive>

                                    <transaction-support>LocalTransaction</transaction-support>

                                    <connection-definitions>

                       

                                      <connection-definition

                                            class-name="com.myapp.connector.jco.JCoManagedConnectionFactory"

                                            pool-name="myappjcora_Pool"

                                            jndi-name="java:/eis/MyApp/Sap" use-java-context="true" enabled="true" use-ccm="true">

                       

                      <!--

                      TODO: re-enable following integer parameters once supported.

                      -->

                       

                      <!--                   <config-property name="name">qa</config-property> -->

                      <!--                   <config-property name="ashost">mysap.svr.net</config-property> -->

                      <!--                   <config-property name="sysnr">23</config-property> -->

                      <!--                   <config-property name="client">300</config-property> -->

                      <!--                   <config-property name="user">RFC_USER</config-property> -->

                      <!--                   <config-property name="passwd">myapprfc</config-property> -->

                      <!--                   <config-property name="lang">EN</config-property> -->

                      <!--                   <config-property name="pool_capacity">2</config-property> -->

                      <!--                   <config-property name="peek_limit">5</config-property> -->

                      <!--                   <config-property name="sharedDestination">true</config-property> -->

                                        <pool>

                                           <max-pool-size>5</max-pool-size>

                                        </pool>

                                      </connection-definition>

                       

                                    </connection-definitions>

                                  </resource-adapter>

                                </resource-adapters>

                              </subsystem> 

                       

                       

                      output

                      12:24:54,657 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) Starting deployment of "myappjcora.rar"

                      12:24:55,051 INFO  [org.jboss.as.deployment.connector] (MSC service thread 1-3) JBAS010406: Registered connection factory java:/eis/MyApp/Sap

                      12:24:55,053 INFO  [org.jboss.as.connector.deployers.RaXmlDeployer] (MSC service thread 1-3) IJ020002: Deployed: file:/opt/jboss/standalone/tmp/vfs/temp340259ddbdf8e058/myappjcora.rar-ef49b46b1049bf6e/contents/

                      12:24:55,055 INFO  [org.jboss.as.deployment.connector] (MSC service thread 1-2) JBAS010401: Bound JCA ConnectionFactory [java:/eis/MyApp/Sap]

                      12:24:55,161 INFO  [org.jboss.as.server.controller] (DeploymentScanner-threads - 2) Deployed "myappjcora.rar"

                      • 8. Re: How to deploy Resource Adapter native library dependencies in JBossas7
                        Jesper Pedersen Master

                        A fix has been committed on master - you can build it yourself or use a nightly snapshot.

                        • 9. Re: How to deploy Resource Adapter native library dependencies in JBossas7
                          tc7 Newbie

                          Sorry for the delay in testing this one Jesper - other project pressures forced me to concentrate on other issues.

                           

                          I've just tested with (Flux Capacitor) and the native (linux x64) library (libsapjco3.so) still fails to load when placed in the root of our jco rar (exception below).

                          The ra.xml and resource-adapter config properties in standalone-full.xml are now read and applied as expected.

                           

                          If I simply extract the native library from the rar into jboss-home/bin/native then it all works as per the workaround above (-Djava.library.path=${JBOSS_NATIVE_LIBRARY_PATH})

                           

                          Is there anything else I should be doing - or can try?

                           

                           

                          exception:

                          20120130 10:19:49,387 ERROR [stderr] (MSC service thread 1-4) java.lang.UnsatisfiedLinkError: no sapjco3 in java.library.path

                          20120130 10:19:49,394 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) Starting deployment of "MyApp.war"

                          20120130 10:19:49,394 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) Starting deployment of "asset.jar"

                          20120130 10:19:49,410 ERROR [stderr] (MSC service thread 1-4)           at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1860)

                          20120130 10:19:49,410 ERROR [stderr] (MSC service thread 1-4)           at java.lang.Runtime.loadLibrary0(Runtime.java:845)

                          20120130 10:19:49,410 ERROR [stderr] (MSC service thread 1-4)           at java.lang.System.loadLibrary(System.java:1084)

                          20120130 10:19:49,411 ERROR [stderr] (MSC service thread 1-4)           at com.sap.conn.jco.rt.DefaultJCoRuntime.loadLibrary(DefaultJCoRuntime.java:425)

                          20120130 10:19:49,411 ERROR [stderr] (MSC service thread 1-4)           at com.sap.conn.jco.rt.DefaultJCoRuntime.registerNativeMethods(DefaultJCoRuntime.java:293)

                          20120130 10:19:49,411 ERROR [stderr] (MSC service thread 1-4)           at com.sap.conn.jco.rt.JCoRuntime.registerNatives(JCoRuntime.java:891)

                          20120130 10:19:49,412 ERROR [stderr] (MSC service thread 1-4)           at com.sap.conn.rfc.driver.CpicDriver.<clinit>(CpicDriver.java:948)

                          20120130 10:19:49,412 ERROR [stderr] (MSC service thread 1-4)           at com.sap.conn.rfc.engine.DefaultRfcRuntime.getVersion(DefaultRfcRuntime.java:41)

                          20120130 10:19:49,412 ERROR [stderr] (MSC service thread 1-4)           at com.sap.conn.rfc.api.RfcApi.RfcGetVersion(RfcApi.java:253)

                          20120130 10:19:49,412 ERROR [stderr] (MSC service thread 1-4)           at com.sap.conn.jco.rt.MiddlewareJavaRfc.<clinit>(MiddlewareJavaRfc.java:195)

                          20120130 10:19:49,415 ERROR [stderr] (MSC service thread 1-4)           at com.sap.conn.jco.rt.DefaultJCoRuntime.initialize(DefaultJCoRuntime.java:74)

                          20120130 10:19:49,415 ERROR [stderr] (MSC service thread 1-4)           at com.sap.conn.jco.rt.JCoRuntimeFactory.<clinit>(JCoRuntimeFactory.java:23)

                          20120130 10:19:49,415 ERROR [stderr] (MSC service thread 1-4)           at com.sap.conn.jco.rt.RuntimeEnvironment.<init>(RuntimeEnvironment.java:40)

                          20120130 10:19:49,416 ERROR [stderr] (MSC service thread 1-4)           at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

                          20120130 10:19:49,416 ERROR [stderr] (MSC service thread 1-4)           at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)

                          20120130 10:19:49,416 ERROR [stderr] (MSC service thread 1-4)           at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

                          20120130 10:19:49,417 ERROR [stderr] (MSC service thread 1-4)           at java.lang.reflect.Constructor.newInstance(Constructor.java:525)

                          20120130 10:19:49,417 ERROR [stderr] (MSC service thread 1-4)           at java.lang.Class.newInstance0(Class.java:372)

                          20120130 10:19:49,417 ERROR [stderr] (MSC service thread 1-4)           at java.lang.Class.newInstance(Class.java:325)

                          20120130 10:19:49,417 ERROR [stderr] (MSC service thread 1-4)           at com.sap.conn.jco.ext.Environment.getInstance(Environment.java:121)

                          20120130 10:19:49,418 ERROR [stderr] (MSC service thread 1-4)           at com.sap.conn.jco.ext.Environment.registerDestinationDataProvider(Environment.java:216)

                          20120130 10:19:49,425 ERROR [stderr] (MSC service thread 1-4)           at com.myapp.connector.jco.JCoManagedConnectionFactory.<clinit>(JCoManagedConnectionFactory.java:135)

                          20120130 10:19:49,426 ERROR [stderr] (MSC service thread 1-4)           at java.lang.Class.forName0(Native Method)

                          20120130 10:19:49,426 ERROR [stderr] (MSC service thread 1-4)           at java.lang.Class.forName(Class.java:264)

                          20120130 10:19:49,426 ERROR [stderr] (MSC service thread 1-4)           at org.jboss.jca.validator.ValidateClass.<init>(ValidateClass.java:88)

                          20120130 10:19:49,427 ERROR [stderr] (MSC service thread 1-4)           at org.jboss.jca.deployers.common.AbstractResourceAdapterDeployer.createObjectsAndInjectValue(AbstractResourceAdapterDeployer.java:1575)

                          20120130 10:19:49,427 ERROR [stderr] (MSC service thread 1-4)           at org.jboss.jca.deployers.common.AbstractResourceAdapterDeployer.createObjectsAndInjectValue(AbstractResourceAdapterDeployer.java:1030)

                          20120130 10:19:49,427 ERROR [stderr] (MSC service thread 1-4)           at org.jboss.as.connector.metadata.deployment.ResourceAdapterDeploymentService$AS7RaDeployer.doDeploy(ResourceAdapterDeploymentService.java:161)

                          20120130 10:19:49,427 ERROR [stderr] (MSC service thread 1-4)           at org.jboss.as.connector.metadata.deployment.ResourceAdapterDeploymentService.start(ResourceAdapterDeploymentService.java:99)

                          20120130 10:19:49,428 ERROR [stderr] (MSC service thread 1-4)           at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824)

                          20120130 10:19:49,428 ERROR [stderr] (MSC service thread 1-4)           at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759)

                          20120130 10:19:49,428 ERROR [stderr] (MSC service thread 1-4)           at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)

                          20120130 10:19:49,429 ERROR [stderr] (MSC service thread 1-4)           at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)

                          20120130 10:19:49,429 ERROR [stderr] (MSC service thread 1-4)           at java.lang.Thread.run(Thread.java:722)

                          20120130 10:19:49,457 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC00001: Failed to start service jboss.ra.deployer.myappjcora: org.jboss.msc.service.StartException in service jboss.ra.deployer.myappjcora: JBAS010446: Failed to start RA deployment [myappjcora]

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

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

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

                                    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [:1.7.0_01]

                                    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [:1.7.0_01]

                                    at java.lang.Thread.run(Thread.java:722) [:1.7.0_01]

                          Caused by: org.jboss.jca.deployers.common.DeployException: IJ020056: Deployment failed: file:/opt/jboss-7-one/standalone/tmp/vfs/tempa9906396ebc8c2d0/myappjcora.rar-91143f7692c39510/contents/

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

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

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

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

                                    ... 5 more

                          Caused by: java.lang.ExceptionInInitializerError: Error getting the version of the native layer: java.lang.UnsatisfiedLinkError: com.sap.conn.rfc.driver.CpicDriver.nativeCpicGetVersion([I)I

                                   at com.sap.conn.jco.rt.MiddlewareJavaRfc.<clinit>(MiddlewareJavaRfc.java:207)

                                    at com.sap.conn.jco.rt.DefaultJCoRuntime.initialize(DefaultJCoRuntime.java:74)

                                    at com.sap.conn.jco.rt.JCoRuntimeFactory.<clinit>(JCoRuntimeFactory.java:23)

                                    at com.sap.conn.jco.rt.RuntimeEnvironment.<init>(RuntimeEnvironment.java:40)

                                    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [:1.7.0_01]

                                    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) [:1.7.0_01]

                                    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [:1.7.0_01]

                                    at java.lang.reflect.Constructor.newInstance(Constructor.java:525) [:1.7.0_01]

                                    at java.lang.Class.newInstance0(Class.java:372) [:1.7.0_01]

                                    at java.lang.Class.newInstance(Class.java:325) [:1.7.0_01]

                                    at com.sap.conn.jco.ext.Environment.getInstance(Environment.java:121)

                                    at com.sap.conn.jco.ext.Environment.registerDestinationDataProvider(Environment.java:216)

                                    at com.myapp.connector.jco.JCoManagedConnectionFactory.<clinit>(JCoManagedConnectionFactory.java:135)

                                    at java.lang.Class.forName0(Native Method) [:1.7.0_01]

                                    at java.lang.Class.forName(Class.java:264) [:1.7.0_01]

                                    at org.jboss.jca.validator.ValidateClass.<init>(ValidateClass.java:88)

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

                                    ... 8 more

                           

                           

                          resource-adapter config (from standalone-full.xml)

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

                                    <resource-adapters>

                                      <resource-adapter>

                                        <archive>myappjcora.rar</archive>

                                        <transaction-support>LocalTransaction</transaction-support>

                                        <connection-definitions>

                                          <connection-definition

                                                class-name="com.myapp.connector.jco.JCoManagedConnectionFactory"

                                                pool-name="myappjcora_Pool"

                                                jndi-name="java:/eis/MyApp/Sap" use-java-context="true" enabled="true" use-ccm="true">

                                            <config-property name="name">test</config-property>

                                            <config-property name="ashost">somemqhost</config-property>

                                            <config-property name="sysnr">23</config-property>

                                            <config-property name="client">300</config-property>

                                            <config-property name="user">someusr</config-property>

                                            <config-property name="passwd">somepass</config-property>

                                            <config-property name="lang">EN</config-property>

                                            <config-property name="pool_capacity">2</config-property>

                                            <!--<config-property name="peek_limit">5</config-property>-->

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

                                            <pool>

                                               <max-pool-size>5</max-pool-size>

                                            </pool>

                                          </connection-definition>

                                        </connection-definitions>

                                      </resource-adapter>

                                    </resource-adapters>

                                  </subsystem> 

                          • 10. Re: How to deploy Resource Adapter native library dependencies in JBossas7
                            Jesper Pedersen Master

                            Can you try and enable TRACE logging for org.jboss.as.connector and look for "Processing library" ?

                            • 11. Re: How to deploy Resource Adapter native library dependencies in JBossas7
                              tc7 Newbie

                              jboss-as-7.1.0.CR1b

                              For some reason I couldn't get the additional logs coming out with our server config, so I've reverted to a vanilla install with just the TRACE log level change and myappjco.rar.

                               

                              Here's the output:

                              bin/standalone.sh --server-config=standalone-full.xml

                              08:23:38,127 INFO  [org.jboss.as.clustering] (ServerService Thread Pool -- 30) JBAS010300: Activating Infinispan subsystem.

                              08:23:38,227 INFO  [org.jboss.as.connector] (MSC service thread 1-1) JBAS010408: Starting JCA Subsystem (JBoss IronJacamar 1.0.6.Final)

                              08:23:38,230 TRACE [org.jboss.as.connector] (MSC service thread 1-1) config=org.jboss.as.connector.subsystems.jca.JcaSubsystemConfiguration@32545868

                              08:23:38,235 DEBUG [org.jboss.as.connector.mdr] (MSC service thread 1-3) Starting sevice MDR

                              08:23:38,255 INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 38) JBAS011800: Activating Naming Subsystem

                              08:23:38,306 DEBUG [org.jboss.as.connector.mdr] (MSC service thread 1-3) Starting service RaRepositoryService

                              08:23:38,308 DEBUG [org.jboss.as.connector] (MSC service thread 1-3) started ManagementRepositoryService service jboss.management_repository

                              08:23:38,281 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 26) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)

                              08:23:38,286 INFO  [org.jboss.as.osgi] (ServerService Thread Pool -- 39) JBAS011910: Activating OSGi Subsystem

                              08:23:38,368 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 44) Activating Security Subsystem

                              08:23:38,386 DEBUG [org.jboss.as.connector] (ServerService Thread Pool -- 33) Building WorkManager

                              08:23:38,461 INFO  [org.jboss.as.webservices] (ServerService Thread Pool -- 48) JBAS015537: Activating WebServices Extension

                              08:23:38,530 DEBUG [org.jboss.as.connector] (ServerService Thread Pool -- 33) Building DefaultBootstrapContext

                              08:23:38,518 INFO  [org.jboss.as.security] (MSC service thread 1-4) Picketbox version=4.0.6.Beta2

                              08:23:38,518 INFO  [org.jboss.as.naming] (MSC service thread 1-1) JBAS011802: Starting Naming Service

                              08:23:38,606 INFO  [org.jboss.as.jaxr] (MSC service thread 1-1) Binding JAXR ConnectionFactory: java:jboss/jaxr/ConnectionFactory

                              08:23:38,639 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-2) JBAS015400: Bound mail session [java:jboss/mail/Default]

                              08:23:38,672 DEBUG [org.jboss.as.connector] (MSC service thread 1-2) Starting JCA WorkManager

                              08:23:38,845 INFO  [org.jboss.as.remoting] (MSC service thread 1-4) Listening on /127.0.0.1:4447

                              08:23:39,060 INFO  [org.jboss.ws.common.management.AbstractServerConfig] (MSC service thread 1-2) JBoss Web Services - Stack CXF Server 4.0.0.GA

                              08:23:39,474 INFO  [org.apache.coyote.http11.Http11AprProtocol] (MSC service thread 1-3) Starting Coyote HTTP/1.1 on http--127.0.0.1-8080

                              08:23:39,782 DEBUG [org.jboss.as.connector] (MSC service thread 1-3) Starting JCA DefaultBootstrapContext

                              08:23:39,793 DEBUG [org.jboss.as.connector] (MSC service thread 1-3) Starting JCA TransactionIntegrationService

                              08:23:39,796 DEBUG [org.jboss.as.connector] (MSC service thread 1-3) Started CcmService service jboss.cached-connection-manager

                              08:23:39,818 TRACE [org.jboss.as.connector.subsystems.datasources.AbstractDataSourceService$AS7DataSourceDeployer] (MSC service thread 1-3) DataSource=<datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true" use-ccm="true" jta="true"><connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1</connection-url><driver>h2</driver><pool><min-pool-size>0</min-pool-size><max-pool-size>20</max-pool-size><prefill>false</prefill><use-strict-min>false</use-strict-min><flush-strategy>FailingConnectionOnly</flush-strategy></pool><security><user-name>sa</user-name><password>sa</password></security><validation><validate-on-match>false</validate-on-match><background-validation>false</background-validation><use-fast-fail>false</use-fast-fail></validation><timeout></timeout><statement><track-statements>nowarn</track-statements></statement></datasource>

                              08:23:39,829 DEBUG [org.jboss.as.connector.subsystems.datasources.AbstractDataSourceService$AS7DataSourceDeployer] (MSC service thread 1-3) Adding management datasource: DataSource@d94b5cf xa=false jndiName=java:jboss/datasources/ExampleDS pool=org.jboss.jca.core.connectionmanager.pool.strategy.OnePool@1e2c3000 poolconfiguration=PoolConfiguration@67035f79[minSize=0 maxSize=20 blockingTimeout=30000 idleTimeoutMinutes=30 backgroundValidation=false backgroundValidationMillis=0 prefill=false strictMin=false useFastFail=false] statistics=org.jboss.jca.adapters.jdbc.statistics.JdbcStatisticsPlugin@e7135c5]

                              08:23:39,840 DEBUG [org.jboss.as.connector.deployer.dsdeployer] (MSC service thread 1-3) Adding datasource: java:jboss/datasources/ExampleDS

                              08:23:39,844 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-2) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]

                              08:23:40,103 INFO  [org.jboss.as.remoting] (MSC service thread 1-1) Listening on /127.0.0.1:9999

                              08:23:40,119 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-4) JBAS015012: Started FileSystemDeploymentService for directory /opt/jboss-as-7.1.0.CR1b_sapcjotest/standalone/deployments

                              08:23:40,125 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015014: Re-attempting failed deployment myappjcora.rar

                              08:23:40,242 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) Starting deployment of "myappjcora.rar"

                              08:23:40,636 TRACE [org.jboss.as.connector] (MSC service thread 1-2) Processing library: libsapjco3.so

                              08:23:40,687 DEBUG [org.jboss.as.connector] (MSC service thread 1-2) Loaded library: /opt/jboss-as-7.1.0.CR1b_sapcjotest/standalone/tmp/vfs/temp8a91a21c17c877ef/myappjcora.rar-480ff2f87f527578/contents/libsapjco3.so

                              08:23:40,745 TRACE [org.jboss.as.connector.deployers.RADeployer] (MSC service thread 1-1) Connector=<?xml version="1.0" encoding="UTF-8"?><connector version="1.5"><vendor-name>MyApp</vendor-name><eis-type>Sap</eis-type><resourceadapter-version>1.0</resourceadapter-version><resourceadapter><resourceadapter-class>com.myapp.connector.jco.JCoResourceAdapter</resourceadapter-class><outbound-resourceadapter><connection-definition><managedconnectionfactory-class>com.myapp.connector.jco.JCoManagedConnectionFactory</managedconnectionfactory-class><config-property><config-property-name>name</config-property-name><config-property-type>java.lang.String</config-property-type><config-property-value>qa</config-property-value></config-property><config-property><config-property-name>ashost</config-property-name><config-property-type>java.lang.String</config-property-type><config-property-value>asapr3q.amcor.net</config-property-value></config-property><config-property><config-property-name>sysnr</config-property-name><config-property-type>java.lang.Integer</config-property-type><config-property-value>23</config-property-value></config-property><config-property><config-property-name>client</config-property-name><config-property-type>java.lang.Integer</config-property-type><config-property-value>300</config-property-value></config-property><config-property><config-property-name>user</config-property-name><config-property-type>java.lang.String</config-property-type><config-property-value>RFC_ISPEK</config-property-value></config-property><config-property><config-property-name>passwd</config-property-name><config-property-type>java.lang.String</config-property-type><config-property-value>1spekrfc</config-property-value></config-property><config-property><config-property-name>lang</config-property-name><config-property-type>java.lang.String</config-property-type><config-property-value>EN</config-property-value></config-property><config-property><config-property-name>pool_capacity</config-property-name><config-property-type>java.lang.Integer</config-property-type><config-property-value>2</config-property-value></config-property><config-property><config-property-name>peak_limit</config-property-name><config-property-type>java.lang.Integer</config-property-type><config-property-value>5</config-property-value></config-property><connectionfactory-interface>javax.resource.cci.ConnectionFactory</connectionfactory-interface><connectionfactory-impl-class>com.myapp.connector.jco.JCoConnectionFactory</connectionfactory-impl-class><connection-interface>javax.resource.cci.Connection</connection-interface><connection-impl-class>com.myapp.connector.jco.JCoConnection</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>

                              08:23:40,746 TRACE [org.jboss.as.connector.deployers.RADeployer] (MSC service thread 1-1) IronJacamar=null

                              08:23:40,746 TRACE [org.jboss.as.connector.deployers.RADeployer] (MSC service thread 1-1) RaXML=null

                              08:23:40,747 TRACE [org.jboss.as.connector.deployers.RADeployer] (MSC service thread 1-1) ActivateDeployment=false

                              08:23:40,806 ERROR [stderr] (MSC service thread 1-1) java.lang.UnsatisfiedLinkError: no sapjco3 in java.library.path

                              08:23:40,807 ERROR [stderr] (MSC service thread 1-1)           at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1860)

                              08:23:40,807 ERROR [stderr] (MSC service thread 1-1)           at java.lang.Runtime.loadLibrary0(Runtime.java:845)

                              08:23:40,807 ERROR [stderr] (MSC service thread 1-1)           at java.lang.System.loadLibrary(System.java:1084)

                              08:23:40,808 ERROR [stderr] (MSC service thread 1-1)           at com.sap.conn.jco.rt.DefaultJCoRuntime.loadLibrary(DefaultJCoRuntime.java:425)

                              08:23:40,808 ERROR [stderr] (MSC service thread 1-1)           at com.sap.conn.jco.rt.DefaultJCoRuntime.registerNativeMethods(DefaultJCoRuntime.java:293)

                              08:23:40,808 ERROR [stderr] (MSC service thread 1-1)           at com.sap.conn.jco.rt.JCoRuntime.registerNatives(JCoRuntime.java:891)

                              08:23:40,808 ERROR [stderr] (MSC service thread 1-1)           at com.sap.conn.rfc.driver.CpicDriver.<clinit>(CpicDriver.java:948)

                              08:23:40,808 ERROR [stderr] (MSC service thread 1-1)           at com.sap.conn.rfc.engine.DefaultRfcRuntime.getVersion(DefaultRfcRuntime.java:41)

                              08:23:40,809 ERROR [stderr] (MSC service thread 1-1)           at com.sap.conn.rfc.api.RfcApi.RfcGetVersion(RfcApi.java:253)

                              08:23:40,809 ERROR [stderr] (MSC service thread 1-1)           at com.sap.conn.jco.rt.MiddlewareJavaRfc.<clinit>(MiddlewareJavaRfc.java:195)

                              08:23:40,809 ERROR [stderr] (MSC service thread 1-1)           at com.sap.conn.jco.rt.DefaultJCoRuntime.initialize(DefaultJCoRuntime.java:74)

                              08:23:40,809 ERROR [stderr] (MSC service thread 1-1)           at com.sap.conn.jco.rt.JCoRuntimeFactory.<clinit>(JCoRuntimeFactory.java:23)

                              08:23:40,809 ERROR [stderr] (MSC service thread 1-1)           at com.sap.conn.jco.rt.RuntimeEnvironment.<init>(RuntimeEnvironment.java:40)

                              08:23:40,809 ERROR [stderr] (MSC service thread 1-1)           at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

                              08:23:40,810 ERROR [stderr] (MSC service thread 1-1)           at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)

                              08:23:40,810 ERROR [stderr] (MSC service thread 1-1)           at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

                              08:23:40,810 ERROR [stderr] (MSC service thread 1-1)           at java.lang.reflect.Constructor.newInstance(Constructor.java:525)

                              08:23:40,810 ERROR [stderr] (MSC service thread 1-1)           at java.lang.Class.newInstance0(Class.java:372)

                              08:23:40,811 ERROR [stderr] (MSC service thread 1-1)           at java.lang.Class.newInstance(Class.java:325)

                              08:23:40,811 ERROR [stderr] (MSC service thread 1-1)           at com.sap.conn.jco.ext.Environment.getInstance(Environment.java:121)

                              08:23:40,811 ERROR [stderr] (MSC service thread 1-1)           at com.sap.conn.jco.ext.Environment.registerDestinationDataProvider(Environment.java:216)

                              08:23:40,811 ERROR [stderr] (MSC service thread 1-1)           at com.myapp.connector.jco.JCoManagedConnectionFactory.<clinit>(JCoManagedConnectionFactory.java:135)

                              08:23:40,811 ERROR [stderr] (MSC service thread 1-1)           at java.lang.Class.forName0(Native Method)

                              08:23:40,811 ERROR [stderr] (MSC service thread 1-1)           at java.lang.Class.forName(Class.java:264)

                              08:23:40,812 ERROR [stderr] (MSC service thread 1-1)           at org.jboss.jca.validator.ValidateClass.<init>(ValidateClass.java:88)

                              08:23:40,812 ERROR [stderr] (MSC service thread 1-1)           at org.jboss.jca.deployers.common.AbstractResourceAdapterDeployer.createObjectsAndInjectValue(AbstractResourceAdapterDeployer.java:1575)

                              08:23:40,812 ERROR [stderr] (MSC service thread 1-1)           at org.jboss.jca.deployers.common.AbstractResourceAdapterDeployer.createObjectsAndInjectValue(AbstractResourceAdapterDeployer.java:1030)

                              08:23:40,812 ERROR [stderr] (MSC service thread 1-1)           at org.jboss.as.connector.metadata.deployment.ResourceAdapterDeploymentService$AS7RaDeployer.doDeploy(ResourceAdapterDeploymentService.java:161)

                              08:23:40,812 ERROR [stderr] (MSC service thread 1-1)           at org.jboss.as.connector.metadata.deployment.ResourceAdapterDeploymentService.start(ResourceAdapterDeploymentService.java:99)

                              08:23:40,813 ERROR [stderr] (MSC service thread 1-1)           at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824)

                              08:23:40,813 ERROR [stderr] (MSC service thread 1-1)           at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759)

                              08:23:40,813 ERROR [stderr] (MSC service thread 1-1)           at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)

                              08:23:40,813 ERROR [stderr] (MSC service thread 1-1)           at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)

                              08:23:40,813 ERROR [stderr] (MSC service thread 1-1)           at java.lang.Thread.run(Thread.java:722)

                              08:23:40,825 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC00001: Failed to start service jboss.ra.deployer.myappjcora: org.jboss.msc.service.StartException in service jboss.ra.deployer.myappjcora: JBAS010446: Failed to start RA deployment [myappjcora]

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

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

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

                                        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [:1.7.0_01]

                                        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [:1.7.0_01]

                                        at java.lang.Thread.run(Thread.java:722) [:1.7.0_01]

                              Caused by: org.jboss.jca.deployers.common.DeployException: IJ020056: Deployment failed: file:/opt/jboss-as-7.1.0.CR1b_sapcjotest/standalone/tmp/vfs/temp8a91a21c17c877ef/myappjcora.rar-480ff2f87f527578/contents/

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

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

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

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

                                        ... 5 more

                              Caused by: java.lang.ExceptionInInitializerError: Error getting the version of the native layer: java.lang.UnsatisfiedLinkError: com.sap.conn.rfc.driver.CpicDriver.nativeCpicGetVersion([I)I

                                        at com.sap.conn.jco.rt.MiddlewareJavaRfc.<clinit>(MiddlewareJavaRfc.java:207)

                                        at com.sap.conn.jco.rt.DefaultJCoRuntime.initialize(DefaultJCoRuntime.java:74)

                                        at com.sap.conn.jco.rt.JCoRuntimeFactory.<clinit>(JCoRuntimeFactory.java:23)

                                        at com.sap.conn.jco.rt.RuntimeEnvironment.<init>(RuntimeEnvironment.java:40)

                                        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [:1.7.0_01]

                                        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) [:1.7.0_01]

                                        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [:1.7.0_01]

                                        at java.lang.reflect.Constructor.newInstance(Constructor.java:525) [:1.7.0_01]

                                        at java.lang.Class.newInstance0(Class.java:372) [:1.7.0_01]

                                        at java.lang.Class.newInstance(Class.java:325) [:1.7.0_01]

                                        at com.sap.conn.jco.ext.Environment.getInstance(Environment.java:121)

                                        at com.sap.conn.jco.ext.Environment.registerDestinationDataProvider(Environment.java:216)

                                        at com.myapp.connector.jco.JCoManagedConnectionFactory.<clinit>(JCoManagedConnectionFactory.java:135)

                                        at java.lang.Class.forName0(Native Method) [:1.7.0_01]

                                        at java.lang.Class.forName(Class.java:264) [:1.7.0_01]

                                        at org.jboss.jca.validator.ValidateClass.<init>(ValidateClass.java:88)

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

                                        ... 8 more

                               

                               

                              08:23:40,836 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015856: Undeploy of deployment "myappjcora.rar" was rolled back with failure message {"JBAS014671: Failed services" => {"jboss.ra.deployer.myappjcora" => "org.jboss.msc.service.StartException in service jboss.ra.deployer.myappjcora: JBAS010446: Failed to start RA deployment [myappjcora]"}}

                              08:23:40,843 ERROR [org.jboss.as] (MSC service thread 1-1) JBoss AS 7.1.0.CR1b "Flux Capacitor" started (with errors) in 4807ms - Started 148 of 221 services (1 services failed or missing dependencies, 70 services are passive or on-demand)

                              08:23:40,861 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) Stopped deployment myappjcora.rar in 21ms

                              08:23:40,862 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report

                              JBAS014777:   Services which failed to start:      service jboss.ra.deployer.myappjcora: org.jboss.msc.service.StartException in service jboss.ra.deployer.myappjcora: JBAS010446: Failed to start RA deployment [myappjcora]

                               

                               

                              08:23:40,863 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) {"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"JBAS014671: Failed services" => {"jboss.ra.deployer.myappjcora" => "org.jboss.msc.service.StartException in service jboss.ra.deployer.myappjcora: JBAS010446: Failed to start RA deployment [myappjcora]"}}}}

                              08:23:43,132 INFO  [org.apache.coyote.http11.Http11AprProtocol] (MSC service thread 1-3) Pausing Coyote HTTP/1.1 on http--127.0.0.1-8080

                              08:23:43,132 INFO  [org.apache.coyote.http11.Http11AprProtocol] (MSC service thread 1-3) Stopping Coyote HTTP/1.1 on http--127.0.0.1-8080

                              08:23:43,145 INFO  [org.apache.catalina.core.StandardContext] (MSC service thread 1-1) Container org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/] has not been started

                              08:23:43,155 INFO  [org.jboss.as.osgi] (MSC service thread 1-2) JBAS011921: Stopping OSGi Framework

                               

                              latest nightly build

                              I've also downloaded the latest (2-2-2012) built artefact from https://ci.jboss.org/jenkins/job/JBoss-AS-7.x-latest/

                              and get a similar error:

                               

                              bin/standalone.sh

                              14:53:07,700 INFO  [org.jboss.as.configadmin] (ServerService Thread Pool -- 27) JBAS016200: Activating ConfigAdmin Subsystem

                              14:53:07,737 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 32) JBAS010280: Activating Infinispan subsystem.

                              14:53:07,821 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 46) JBAS013101: Activating Security Subsystem

                              14:53:07,833 INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 40) JBAS011800: Activating Naming Subsystem

                              14:53:07,832 INFO  [org.jboss.as.osgi] (ServerService Thread Pool -- 41) JBAS011910: Activating OSGi Subsystem

                              14:53:07,873 INFO  [org.jboss.as.webservices] (ServerService Thread Pool -- 50) JBAS015537: Activating WebServices Extension

                              14:53:07,939 INFO  [org.jboss.as.security] (MSC service thread 1-1) JBAS013100: Current PicketBox version=4.0.6.final

                              14:53:08,010 INFO  [org.jboss.as.connector] (MSC service thread 1-2) JBAS010408: Starting JCA Subsystem (JBoss IronJacamar 1.0.7.Final)

                              14:53:08,087 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 28) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)

                              14:53:08,139 INFO  [org.jboss.as.naming] (MSC service thread 1-3) JBAS011802: Starting Naming Service

                              14:53:08,188 INFO  [org.jboss.as.remoting] (MSC service thread 1-2) Listening on /127.0.0.1:4447

                              14:53:08,205 INFO  [org.jboss.as.jaxr] (MSC service thread 1-2) Binding JAXR ConnectionFactory: java:jboss/jaxr/ConnectionFactory

                              14:53:08,218 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-2) JBAS015400: Bound mail session [java:jboss/mail/Default]

                              14:53:08,655 INFO  [org.jboss.ws.common.management.AbstractServerConfig] (MSC service thread 1-2) JBoss Web Services - Stack CXF Server 4.0.0.GA

                              14:53:08,919 INFO  [org.apache.coyote.http11.Http11AprProtocol] (MSC service thread 1-4) Starting Coyote HTTP/1.1 on http--127.0.0.1-8080

                              14:53:09,312 INFO  [org.jboss.as.remoting] (MSC service thread 1-1) Listening on /127.0.0.1:9999

                              14:53:09,343 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-3) JBAS015012: Started FileSystemDeploymentService for directory /opt/jboss-as-7.1.0.Final-SNAPSHOT_sapjcotest/standalone/deployments

                              14:53:09,346 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015014: Re-attempting failed deployment myappjcora.rar

                              14:53:09,626 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-1) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]

                              14:53:09,655 INFO  [org.jboss.as] (MSC service thread 1-3) JBAS015874: JBoss AS 7.1.0.Final-SNAPSHOT "Flux Capacitor" started in 3844ms - Started 137 of 207 services (69 services are passive or on-demand)

                              14:53:09,664 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015876: Starting deployment of "myappjcora.rar"

                              14:53:10,052 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-4) JBAS018567: Deployment "deployment.myappjcora.rar" is using a private module ("org.jboss.iiop-client:main") which may be changed or removed in future versions without notice.

                              14:53:10,053 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-4) JBAS018567: Deployment "deployment.myappjcora.rar" is using a private module ("org.jboss.as.ejb3:main") which may be changed or removed in future versions without notice.

                              14:53:10,053 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-4) JBAS018567: Deployment "deployment.myappjcora.rar" is using a private module ("org.jboss.ironjacamar.api:main") which may be changed or removed in future versions without notice.

                              14:53:10,056 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-4) JBAS018567: Deployment "deployment.myappjcora.rar" is using a private module ("org.jboss.ironjacamar.impl:main") which may be changed or removed in future versions without notice.

                              14:53:10,064 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-4) JBAS018567: Deployment "deployment.myappjcora.rar" is using a private module ("org.jboss.as.ee:main") which may be changed or removed in future versions without notice.

                              14:53:10,065 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-4) JBAS018567: Deployment "deployment.myappjcora.rar" is using a private module ("org.jboss.ws.spi:main") which may be changed or removed in future versions without notice.

                              14:53:10,065 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-4) JBAS018567: Deployment "deployment.myappjcora.rar" is using a private module ("org.jboss.as.security:main") which may be changed or removed in future versions without notice.

                              14:53:10,065 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-4) JBAS018567: Deployment "deployment.myappjcora.rar" is using a private module ("org.apache.log4j:main") which may be changed or removed in future versions without notice.

                              14:53:10,068 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-4) JBAS018567: Deployment "deployment.myappjcora.rar" is using a private module ("org.apache.ws.scout:main") which may be changed or removed in future versions without notice.

                              14:53:10,069 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-4) JBAS018567: Deployment "deployment.myappjcora.rar" is using a private module ("org.jboss.as.jaxr:main") which may be changed or removed in future versions without notice.

                              14:53:10,368 ERROR [stderr] (MSC service thread 1-4) java.lang.UnsatisfiedLinkError: no sapjco3 in java.library.path

                              14:53:10,368 ERROR [stderr] (MSC service thread 1-4)           at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1860)

                              14:53:10,369 ERROR [stderr] (MSC service thread 1-4)           at java.lang.Runtime.loadLibrary0(Runtime.java:845)

                              14:53:10,369 ERROR [stderr] (MSC service thread 1-4)           at java.lang.System.loadLibrary(System.java:1084)

                              14:53:10,375 ERROR [stderr] (MSC service thread 1-4)           at com.sap.conn.jco.rt.DefaultJCoRuntime.loadLibrary(DefaultJCoRuntime.java:425)

                              14:53:10,376 ERROR [stderr] (MSC service thread 1-4)           at com.sap.conn.jco.rt.DefaultJCoRuntime.registerNativeMethods(DefaultJCoRuntime.java:293)

                              14:53:10,378 ERROR [stderr] (MSC service thread 1-4)           at com.sap.conn.jco.rt.JCoRuntime.registerNatives(JCoRuntime.java:891)

                              14:53:10,378 ERROR [stderr] (MSC service thread 1-4)           at com.sap.conn.rfc.driver.CpicDriver.<clinit>(CpicDriver.java:948)

                              14:53:10,379 ERROR [stderr] (MSC service thread 1-4)           at com.sap.conn.rfc.engine.DefaultRfcRuntime.getVersion(DefaultRfcRuntime.java:41)

                              14:53:10,379 ERROR [stderr] (MSC service thread 1-4)           at com.sap.conn.rfc.api.RfcApi.RfcGetVersion(RfcApi.java:253)

                              14:53:10,379 ERROR [stderr] (MSC service thread 1-4)           at com.sap.conn.jco.rt.MiddlewareJavaRfc.<clinit>(MiddlewareJavaRfc.java:195)

                              14:53:10,379 ERROR [stderr] (MSC service thread 1-4)           at com.sap.conn.jco.rt.DefaultJCoRuntime.initialize(DefaultJCoRuntime.java:74)

                              14:53:10,379 ERROR [stderr] (MSC service thread 1-4)           at com.sap.conn.jco.rt.JCoRuntimeFactory.<clinit>(JCoRuntimeFactory.java:23)

                              14:53:10,379 ERROR [stderr] (MSC service thread 1-4)           at com.sap.conn.jco.rt.RuntimeEnvironment.<init>(RuntimeEnvironment.java:40)

                              14:53:10,379 ERROR [stderr] (MSC service thread 1-4)           at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

                              14:53:10,380 ERROR [stderr] (MSC service thread 1-4)           at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)

                              14:53:10,380 ERROR [stderr] (MSC service thread 1-4)           at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

                              14:53:10,380 ERROR [stderr] (MSC service thread 1-4)           at java.lang.reflect.Constructor.newInstance(Constructor.java:525)

                              14:53:10,381 ERROR [stderr] (MSC service thread 1-4)           at java.lang.Class.newInstance0(Class.java:372)

                              14:53:10,381 ERROR [stderr] (MSC service thread 1-4)           at java.lang.Class.newInstance(Class.java:325)

                              14:53:10,381 ERROR [stderr] (MSC service thread 1-4)           at com.sap.conn.jco.ext.Environment.getInstance(Environment.java:121)

                              14:53:10,382 ERROR [stderr] (MSC service thread 1-4)           at com.sap.conn.jco.ext.Environment.registerDestinationDataProvider(Environment.java:216)

                              14:53:10,382 ERROR [stderr] (MSC service thread 1-4)           at com.myapp.connector.jco.JCoManagedConnectionFactory.<clinit>(JCoManagedConnectionFactory.java:135)

                              14:53:10,382 ERROR [stderr] (MSC service thread 1-4)           at java.lang.Class.forName0(Native Method)

                              14:53:10,383 ERROR [stderr] (MSC service thread 1-4)           at java.lang.Class.forName(Class.java:264)

                              14:53:10,384 ERROR [stderr] (MSC service thread 1-4)           at org.jboss.jca.validator.ValidateClass.<init>(ValidateClass.java:88)

                              14:53:10,384 ERROR [stderr] (MSC service thread 1-4)           at org.jboss.jca.deployers.common.AbstractResourceAdapterDeployer.createObjectsAndInjectValue(AbstractResourceAdapterDeployer.java:1575)

                              14:53:10,384 ERROR [stderr] (MSC service thread 1-4)           at org.jboss.jca.deployers.common.AbstractResourceAdapterDeployer.createObjectsAndInjectValue(AbstractResourceAdapterDeployer.java:1030)

                              14:53:10,384 ERROR [stderr] (MSC service thread 1-4)           at org.jboss.as.connector.metadata.deployment.ResourceAdapterDeploymentService$AS7RaDeployer.doDeploy(ResourceAdapterDeploymentService.java:172)

                              14:53:10,384 ERROR [stderr] (MSC service thread 1-4)           at org.jboss.as.connector.metadata.deployment.ResourceAdapterDeploymentService.start(ResourceAdapterDeploymentService.java:101)

                              14:53:10,385 ERROR [stderr] (MSC service thread 1-4)           at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)

                              14:53:10,386 ERROR [stderr] (MSC service thread 1-4)           at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)

                              14:53:10,386 ERROR [stderr] (MSC service thread 1-4)           at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)

                              14:53:10,386 ERROR [stderr] (MSC service thread 1-4)           at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)

                              14:53:10,387 ERROR [stderr] (MSC service thread 1-4)           at java.lang.Thread.run(Thread.java:722)

                              14:53:10,401 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC00001: Failed to start service jboss.ra.deployer.myappjcora: org.jboss.msc.service.StartException in service jboss.ra.deployer.myappjcora: JBAS010446: Failed to start RA deployment [myappjcora]

                                        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.runWorker(ThreadPoolExecutor.java:1110) [:1.7.0_01]

                                        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [:1.7.0_01]

                                        at java.lang.Thread.run(Thread.java:722) [:1.7.0_01]

                              Caused by: org.jboss.jca.deployers.common.DeployException: IJ020056: Deployment failed: file:/opt/jboss-as-7.1.0.Final-SNAPSHOT_sapjcotest/standalone/tmp/vfs/tempaec5614efcb120f5/myappjcora.rar-2a608025ed7de875/contents/

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

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

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

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

                                        ... 5 more

                              Caused by: java.lang.ExceptionInInitializerError: Error getting the version of the native layer: java.lang.UnsatisfiedLinkError: com.sap.conn.rfc.driver.CpicDriver.nativeCpicGetVersion([I)I

                                        at com.sap.conn.jco.rt.MiddlewareJavaRfc.<clinit>(MiddlewareJavaRfc.java:207)

                                        at com.sap.conn.jco.rt.DefaultJCoRuntime.initialize(DefaultJCoRuntime.java:74)

                                        at com.sap.conn.jco.rt.JCoRuntimeFactory.<clinit>(JCoRuntimeFactory.java:23)

                                        at com.sap.conn.jco.rt.RuntimeEnvironment.<init>(RuntimeEnvironment.java:40)

                                        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [:1.7.0_01]

                                        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) [:1.7.0_01]

                                        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [:1.7.0_01]

                                        at java.lang.reflect.Constructor.newInstance(Constructor.java:525) [:1.7.0_01]

                                        at java.lang.Class.newInstance0(Class.java:372) [:1.7.0_01]

                                        at java.lang.Class.newInstance(Class.java:325) [:1.7.0_01]

                                        at com.sap.conn.jco.ext.Environment.getInstance(Environment.java:121)

                                        at com.sap.conn.jco.ext.Environment.registerDestinationDataProvider(Environment.java:216)

                                        at com.myapp.connector.jco.JCoManagedConnectionFactory.<clinit>(JCoManagedConnectionFactory.java:135)

                                        at java.lang.Class.forName0(Native Method) [:1.7.0_01]

                                        at java.lang.Class.forName(Class.java:264) [:1.7.0_01]

                                        at org.jboss.jca.validator.ValidateClass.<init>(ValidateClass.java:88)

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

                                        ... 8 more

                               

                               

                              14:53:10,421 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015870: Deploy of deployment "myappjcora.rar" was rolled back with failure message {"JBAS014671: Failed services" => {"jboss.ra.deployer.myappjcora" => "org.jboss.msc.service.StartException in service jboss.ra.deployer.myappjcora: JBAS010446: Failed to start RA deployment [myappjcora]"}}

                              14:53:10,442 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015877: Stopped deployment myappjcora.rar in 19ms

                              14:53:10,442 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report

                              JBAS014777:   Services which failed to start:      service jboss.ra.deployer.myappjcora: org.jboss.msc.service.StartException in service jboss.ra.deployer.myappjcora: JBAS010446: Failed to start RA deployment [myappjcora]

                               

                              14:53:10,443 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) {"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"JBAS014671: Failed services" => {"jboss.ra.deployer.myappjcora" => "org.jboss.msc.service.StartException in service jboss.ra.deployer.myappjcora: JBAS010446: Failed to start RA deployment [myappjcora]"}}}}

                              14:53:15,592 INFO  [org.apache.catalina.core.StandardContext] (MSC service thread 1-3) Container org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/] has not been started

                               

                               

                              java.library.path

                              and once again adding:

                              JAVA_OPTS="$JAVA_OPTS -Djava.library.path=bin/native"

                              to standalone.conf and extracting the "libsapjco3.so" from the rar and placing in <jboss-home>/bin/native makes it work, eg:

                              bin/standalone.sh

                              14:57:20,933 INFO  [org.jboss.as.configadmin] (ServerService Thread Pool -- 27) JBAS016200: Activating ConfigAdmin Subsystem

                              14:57:20,993 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 32) JBAS010280: Activating Infinispan subsystem.

                              14:57:21,149 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 46) JBAS013101: Activating Security Subsystem

                              14:57:21,155 INFO  [org.jboss.as.osgi] (ServerService Thread Pool -- 41) JBAS011910: Activating OSGi Subsystem

                              14:57:21,173 INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 40) JBAS011800: Activating Naming Subsystem

                              14:57:21,230 INFO  [org.jboss.as.security] (MSC service thread 1-4) JBAS013100: Current PicketBox version=4.0.6.final

                              14:57:21,234 INFO  [org.jboss.as.connector] (MSC service thread 1-2) JBAS010408: Starting JCA Subsystem (JBoss IronJacamar 1.0.7.Final)

                              14:57:21,254 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 28) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)

                              14:57:21,308 INFO  [org.jboss.as.webservices] (ServerService Thread Pool -- 50) JBAS015537: Activating WebServices Extension

                              14:57:21,374 INFO  [org.jboss.as.naming] (MSC service thread 1-1) JBAS011802: Starting Naming Service

                              14:57:21,375 INFO  [org.jboss.as.jaxr] (MSC service thread 1-1) Binding JAXR ConnectionFactory: java:jboss/jaxr/ConnectionFactory

                              14:57:21,413 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-1) JBAS015400: Bound mail session [java:jboss/mail/Default]

                              14:57:21,523 INFO  [org.jboss.as.remoting] (MSC service thread 1-3) Listening on /127.0.0.1:4447

                              14:57:21,818 INFO  [org.jboss.ws.common.management.AbstractServerConfig] (MSC service thread 1-4) JBoss Web Services - Stack CXF Server 4.0.0.GA

                              14:57:22,417 INFO  [org.apache.coyote.http11.Http11AprProtocol] (MSC service thread 1-1) Starting Coyote HTTP/1.1 on http--127.0.0.1-8080

                              14:57:22,651 INFO  [org.jboss.as.remoting] (MSC service thread 1-3) Listening on /127.0.0.1:9999

                              14:57:22,683 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-4) JBAS015012: Started FileSystemDeploymentService for directory /opt/jboss-as-7.1.0.Final-SNAPSHOT_sapjcotest/standalone/deploy

                              14:57:22,693 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015014: Re-attempting failed deployment myappjcora.rar

                              14:57:22,962 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-2) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]

                              14:57:22,994 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015876: Starting deployment of "myappjcora.rar"

                              14:57:23,722 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-1) JBAS018567: Deployment "deployment.myappjcora.rar" is using a private module ("org.jboss.iiop-client:main") which may be changed or

                              14:57:23,724 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-1) JBAS018567: Deployment "deployment.myappjcora.rar" is using a private module ("org.jboss.as.ejb3:main") which may be changed or remo

                              14:57:23,726 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-1) JBAS018567: Deployment "deployment.myappjcora.rar" is using a private module ("org.jboss.ironjacamar.api:main") which may be changed

                              14:57:23,727 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-1) JBAS018567: Deployment "deployment.myappjcora.rar" is using a private module ("org.jboss.ironjacamar.impl:main") which may be change

                              14:57:23,732 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-1) JBAS018567: Deployment "deployment.myappjcora.rar" is using a private module ("org.jboss.as.ee:main") which may be changed or remove

                              14:57:23,736 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-1) JBAS018567: Deployment "deployment.myappjcora.rar" is using a private module ("org.jboss.ws.spi:main") which may be changed or remov

                              14:57:23,736 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-1) JBAS018567: Deployment "deployment.myappjcora.rar" is using a private module ("org.jboss.as.security:main") which may be changed or

                              14:57:23,737 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-1) JBAS018567: Deployment "deployment.myappjcora.rar" is using a private module ("org.apache.log4j:main") which may be changed or remov

                              14:57:23,738 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-1) JBAS018567: Deployment "deployment.myappjcora.rar" is using a private module ("org.apache.ws.scout:main") which may be changed or re

                              14:57:23,740 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-1) JBAS018567: Deployment "deployment.myappjcora.rar" is using a private module ("org.jboss.as.jaxr:main") which may be changed or remo

                              14:57:24,265 INFO  [org.jboss.as] (MSC service thread 1-4) JBAS015874: JBoss AS 7.1.0.Final-SNAPSHOT "Flux Capacitor" started in 5360ms - Started 156 of 228 services (71 services are passive or on-demand)

                              14:57:24,353 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018559: Deployed "myappjcora.rar"

                              14:57:29,321 INFO  [org.apache.coyote.http11.Http11AprProtocol] (MSC service thread 1-2) Pausing Coyote HTTP/1.1 on http--127.0.0.1-8080

                              14:57:29,322 INFO  [org.apache.coyote.http11.Http11AprProtocol] (MSC service thread 1-2) Stopping Coyote HTTP/1.1 on http--127.0.0.1-8080

                              14:57:29,324 INFO  [org.apache.catalina.core.StandardContext] (MSC service thread 1-1) Container org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/] has not been started

                              • 12. Re: How to deploy Resource Adapter native library dependencies in JBossas7
                                Jesper Pedersen Master

                                I have tried various hacks - no luck.

                                 

                                If it is your resource adapter code, can you remove the loadLibrary call and see if it works ?  As loadLibrary needs java.library.path to be set explicit when the VM starts.

                                • 13. Re: How to deploy Resource Adapter native library dependencies in JBossas7
                                  tc7 Newbie

                                  SAP JCO Jar (v7.11.1)

                                  Unfortunately the sap jco code belongs to SAP - so can't get in there and modify the loadLibrary call.

                                  How would the native library be used in this case -  is there an alternative way to make the library available to the VM?

                                   

                                  JBoss 4

                                  When I run the version we had running on JBoss 4.2.3.GA (we do not have to specify the java.library.path) and it works fine.

                                  Interestingly I notice the library is extracted by the container, eg:

                                  find . -name "*.so"

                                  ./tmp/native/libsapjco3.so

                                  ./tmp/deploy/tmp3070720768664715428MyAppJCoResourceAdapter.rar-contents/libsapjco3.so

                                  Perhaps this is how it was delt with preivously (extract to a tmp file and appended to the library path perhaps)?

                                   

                                  Working on JBoss 4

                                  I have successfully deployed the supplied rar (above) to JBoss 4.2.3.GA (using JDK 1.7.0_01 - the same as for JBoss 7.1).

                                  Here's the relevant log message:

                                  20120206 14:59:56 INFO  <RARDeployer> [main] [] - Loading native library: /opt/jboss-4.2.3.GA/server/myapp/tmp/native/libsapjco3.so

                                  ..

                                  20120206 14:59:58 DEBUG <JBossManagedConnectionPool> [main] [] - Creating jboss.jca:service=ManagedConnectionPool,name=MyApp/sap

                                  20120206 14:59:58 DEBUG <JBossManagedConnectionPool> [main] [] - Created jboss.jca:service=ManagedConnectionPool,name=MyApp/sap

                                  ..

                                  20120206 14:59:58 DEBUG <ConnectionFactoryBindingService> [main] [] - Creating jboss.jca:service=ConnectionFactoryBinding,name=MyApp/sap

                                  20120206 14:59:58 DEBUG <ConnectionFactoryBindingService> [main] [] - Created jboss.jca:service=ConnectionFactoryBinding,name=MyApp/sap

                                  20120206 14:59:58 DEBUG <RARDeployment> [main] [] - Starting jboss.jca:service=ManagedConnectionFactory,name=MyApp/sap

                                   

                                  It would be nice to get the library loading correctly in 7.1.