1 Reply Latest reply on May 7, 2013 5:33 PM by ovegag

    How do I make RAR classes visible to separate EAR modules? JBoss 7.1.1.Final, IronJacamar 1.0.16.Final, JDK 6

    ovegag

      I developed a new resource adapter. I'm currently using the following library versions:

       

        <version.org.jboss.ironjacamar>1.0.16.Final</version.org.jboss.ironjacamar>

        <version.org.jboss.as>7.1.1.Final</version.org.jboss.as>

        <version.jdk>1.6</version.jdk>

       

      The classes that make up the resource adapter (managed connection factory, admin object interfaces) are separated out in 3 jar files (*-api.jar, *-spi.jar, *-specific-spi.jar). Inside that .rar, I also included all the jar files my adapter depends on.

       

           The structure of the resource adapter is as follows (class structure on the left panel, jboss-deployement-structure.xml on the right panel):

       

                     resource-adapter.rar.jpeg

      I was seemingly able to deploy my resource adapter by following the steps listed on https://community.jboss.org/thread/204895 and https://community.jboss.org/message/782656#782656

       

      resource-adapter-deployed.jpeg

       

      I then created a sample Ear file to make sure I could access my resource adapter from separate modules (ear, jar). The structure of my sample ear is as follows (class structure on the left panel, jboss-deployement-structure.xml on the right panel):

       

      sample-ear.ear.jpeg

       

      The issue I'm facing shows up when I try to deploy this sample ear. It seems that the classes inside the RAR are not visible from the classes on the EAR file.

       

      sample-ear-deployment-failure.jpeg

       

      I thought I could solve this issue  on my own by creating one jboss-deployment-structure.xml for the RAR and EAR modules as described here:  https://docs.jboss.org/author/display/AS71/Class+Loading+in+AS7.

      But all my attempts to make the RAR classes visible to a separate EAR have failed so far.

       

      Attached you'll find the jboss-deployment-structure.xml included inside the RAR file as well as the jboss-deployment-structure.xml included inside the EAR file.

       

      Any help would be greatly appreciated,

      Omar Vega.

        • 1. Re: How do I make RAR classes visible to separate EAR modules? JBoss 7.1.1.Final, IronJacamar 1.0.16.Final, JDK 6
          ovegag

          After a careful reading https://community.jboss.org/message/626315#626315 and https://community.jboss.org/thread/219118 and https://docs.jboss.org/author/display/AS71/Class+Loading+in+AS7 I was able to fix the issue above by modifying the jboss-deployment-structure.xml on the EAR file as well as the jboss-deployment-structure.xml on the RAR.

           

          The contents of the jboss-deployment-structure.xml file on the RAR (sevensys-cloud-adapter-aws.rar):

           

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

          <jboss-deployment-structure>

                    <deployment>

                              <exports>

                                        <include path="mx/sevensys/cloud/api**" />

                                        <include path="org/jclouds**" />

                              </exports>

                              <dependencies>

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

                                        <module name="javax.ws.rs.api"/>

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

                              </dependencies>

                    </deployment>

          </jboss-deployment-structure>

           

           

          The contents of the jboss-deployment-structure.xml file on the EAR:

           

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

          <jboss-deployment-structure>

            <ear-subdeployments-isolated>false</ear-subdeployments-isolated>

            <sub-deployment name="sample-ear-ejb.jar">

            <dependencies>

            <module name="deployment.sevensys-cloud-adapter-aws.rar"/>

            </dependencies>

            </sub-deployment>

          </jboss-deployment-structure>

          1 of 1 people found this helpful