3 Replies Latest reply on Mar 25, 2014 8:50 AM by shi_1

    Oracle AQ on Wildfly 8 with OCI driver throwing java.lang.UnsatisfiedLinkError

    shi_1

      Hi, I need to migrate an application from JBoss 4 to Wildfly 8 and currently I get a java.lang.UnsatisfiedLinkError as soon as the application tries to create a QueueSession. This is the error message:

      oracle.jms.AQjmsSession.ociinit([JIIZSII)J: java.lang.UnsatisfiedLinkError: oracle.jms.AQjmsSession.ociinit([JIIZSII)J

       

      I am using the Oracle OCI driver (configured as a JBoss module) and have set the 'LD_LIBRARY_PATH' variable to the location where the shared object files are located. Everything works as expected with this driver!

      But now, I have set up the AQ API as a module which depends on the driver module. As soon as the application tries to create a QueueSession, the native implementation is called and fails with a linkage error. I found an issue ([SOA-3570] Consider these suggested improvements to OracleAQ quickstart - JBoss Issue Tracker) that propagates to include the aqapi.jar in the server lib folder to get it working, but this is only a suitable approch for older versions of JBoss, not for the module-based Wildfly. In JBoss 4.2.2 we are doing exactly this and everything works fine.

       

      Does anyone have experience with AQ on Wildfly and such issues?

        • 1. Re: Oracle AQ on Wildfly 8 with OCI driver throwing java.lang.UnsatisfiedLinkError
          ctomc

          What kind of OCI driver are you using?

          If you are using type4 (thin driver) it does not require any native libs at all.

           

          In any case show us how does your module structure look like so we can help you more.

           

          also take a look at Native Libraries - JBoss Modules - Project Documentation Editor to see how to configure native libs for static modules,

           

          but as i said, i would recommend you to move to type 4 instead of type2 driver, so you would not need any native dependencies.

           

           

          --

          tomaz

          • 2. Re: Re: Oracle AQ on Wildfly 8 with OCI driver throwing java.lang.UnsatisfiedLinkError
            shi_1

            Hi, we're using the oci driver (type 2 with native libraries), not thin. So at least the error messages make sense. Unfortunately I'm not able to move to type 4 driver instead of type 2 since the old system used type 4 driver for years now which had been set by management once. A change won't be accepted.

            The strange thing is that the driver works as expected but as soon as the AQ lib requires natively implemented parts of the driver, I get these errors.

             

            Ok, here's my oracle module structure:

            • JDBC driver: ${WILDFLY_HOME}/modules/oracle/jdbc/main
              • contents: ojdbc5.jar, module.xml
              • module.xml:

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

                      <module xmlns="urn:jboss:module:1.0" name="oracle.jdbc">

                        <resources>

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

                        </resources>

                        <dependencies>

                          <module name="javax.api"/>

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

                        </dependencies>

                      </module>

            • AQ API: ${WILDFLY_HOME}/modules/oracle/aq/api/main
              • contents: aqapi.jar, module.xml
              • module.xml:

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

                      <module xmlns="urn:jboss:module:1.0" name="oracle.aq.api">

                        <resources>

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

                        </resources>

                        <dependencies>

                          <module name="javax.api"/>

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

                          <module name="oracle.jdbc"/>

                        </dependencies>

                      </module>


            I also had a look at the native libraries documentation and tried it out for linux-i686 but without success. My driver module then had an additional lib/linux-i686 folder containing the libs but nothing changed. After that I also tried to add the lib folder to the AQ module, but again no change!

            • 3. Re: Oracle AQ on Wildfly 8 with OCI driver throwing java.lang.UnsatisfiedLinkError
              shi_1

              Hi, after trying out several approaches we finally found a working solution. The key was to combine both modules to a single one looking so:

              • JDBC/AQ module: ${WILDFLY_HOME}/modules/oracle/jdbcaq/main
                • contents: ojdbc5.jar, aqapi.jar, orai18n.jar, module.xml
                • module.xml:

                        <?xml version="1.0" encoding="UTF-8"?>
                        <module xmlns="urn:jboss:module:1.0" name="oracle.jdbcaq">
                         
              <resources>
                            <resource-root path="aqapi.jar" />
                           
              <resource-root path="ojdbc5.jar"/>
                           
              <resource-root path="orai18n.jar"/>
                         
              </resources>
                         
              <dependencies>
                           
              <module name="javax.api"/>
                           
              <module name="javax.jms.api" />
                           
              <module name="javax.transaction.api"/>
                         
              </dependencies>
                        </module>


              I guess the encountered behavior is based on the module classloaders of wildfly which may require that the native implementations are loaded by the same classloader to be able to communicate with each other. But this is only a suspicion which I cannot proof at the moment.