Question

I'm currently stuck in the middle of a JBoss migration project from version 4.2.2GA to Wildfly 8.0.0.Final. The project uses the Oracle OCI driver for database access and Oracle AQ with it. Now, I'm starting Wildfly with the environment variable 'LD_LIBRARY_PATH' set to the location where the OCI native implementations reside and everything works fine, except AQ. This is the error I get when the AQ API is used: oracle.jms.AQjmsSession.ociinit([JIIZSII)J: java.lang.UnsatisfiedLinkError: oracle.jms.AQjmsSession.ociinit([JIIZSII)J

This is my module:
path: ${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>

So the question now is, what is the reason Wildfly does not propagate the 'LD_LIBRARY_PATH' to the module classloader?

For older JBoss versions I found this issue: https://issues.jboss.org/browse/SOA-3570 which propagates to put the aqapi.jar into the server lib folder as we are doing so for JBoss 4. But how can I solve this issue for Wildfly? Any Ideas?

Thanks!

Was it helpful?

Solution

After a long journey through the shallows of the internet and many tries a colleague of mine finally found a solution.

The solution was to combine both modules to one jdbc/aq module looking so:

path: ${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 think this is somehow related to the module classloaders of wildfly. Maybe the communication between both modules (jdbc and aq) requires the native implementations to be loaded by the same classloader which causes this error when using two modules instead of a single one.

OTHER TIPS

Instead of setting LD_LIBRARY_PATH, a JBoss/WildFly module can also automatically look for native libraries in a module: https://docs.jboss.org/author/display/MODULES/Native+Libraries

So you can load your shared libraries in ${WILDFLY_HOME}/modules/oracle/jdbcaq/main/lib/linux-x86_64/ either by copying .so files or thanks a symbolic link.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top