Setting path for DLL in JBOSS 7.1.1

We have some DLL related to Java,VB . In Joss 4.X we used to place in the bin directory in the Application Server section.

We migrated to JBOSS 7.1.1 and when I deleted bin from the directory and placed them in the library folder in C:\jboss-as-7.1.1.Final\modules\com\correction\main\libraries .

I get this exception

 java.lang.UnsatisfiedLinkError: no xxxJavaWrapper in java.library.path java.library.path = C:\Program Files\Java\jdk1.6.0_24\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\apache-maven-3.0.4;C:\apache-maven-3.0.4\bin;C:\Python27;C:\Program Files\Java\jdk1.6.0_24;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem java.lang.UnsatisfiedLinkError: com.xxxJavaWrapperJNI.new_xxx()J 

module.xml

 <?xml version="1.0" encoding="UTF-8"?> <module xmlns="urn:jboss:module:1.0" name="com.correction"> <resources> <resource-root path="xxx.jar"/> <resource-root path="xyz.jar"/> <resource-root path="libraries"/> </resources> <dependencies> <system export="true"> <paths> <path name="libraries"/> </paths> <exports> <include-set> <path name="libraries"/> </include-set> </exports> </system> </dependencies> </module> 

But I put the same DLL in the bin folder, it works fine. I want to put them in the module folder and set the path from there instead of bin so that I can have all the application-related applications, properties and DLL files in one place for easy maintenance.

I also want to know how to set the path to txt files and properties in jboss 7.1.1

Relations Srini

+4
source share
1 answer

Customize module.xml as shown below:

 <module xmlns="urn:jboss:module:1.1" name="com.correction"> <resources> <resource-root path="xxx.jar"/> <resource-root path="xyz.jar"/> <resource-root path="lib/win-x86_64"/> </resources> <dependencies> <module name="sun.jdk"/> </dependencies> </module> 

Place the DLLs in the lib / win-x86_64 directory. Check out other dependencies of your project.

In the WEB-INF of your application creating the jboss-deployment-structure.xml file and placing the content below:

 <jboss-deployment-structure> <deployment> <dependencies> <module name="com.correction"/> </dependencies> </deployment> </jboss-deployment-structure> 

What all.

Another question: how can you make these property files available to applications deployed on JBoss 7?

create a custom module in which you put your properties files and put jboss-deployment-structure.xml in your application archive (WAR / EAR) to use this custom module.

Create a new module directory in $ JBOSS_HOME / modules (using app / conf in this example)

 mkdir -p $JBOSS_HOME/modules/app/conf/main/properties/ 

Put your property files in $ JBOSS_HOME / modules / app / conf / main / properties /

Create a module. xmlhere $ JBOSS_HOME / modules / app / conf / main / module.xml

 <module xmlns="urn:jboss:module:1.1" name="app.conf"> <resources> <resource-root path="properties"/> </resources> </module> 

enter jboss-deployment-structure.xml in WEB-INF :

 <?xml version="1.0" encoding="UTF-8"?> <jboss-deployment-structure> <deployment> <dependencies> <module name="app.conf" /> </dependencies> </deployment> </jboss-deployment-structure> 

You can then access your property files using the code below (the example assumes you have example.propertiesfile in $ JBOSS_HOME / modules / app / conf / main / properties / )

 Thread.currentThread().getContextClassLoader().getResource("example.properties"); 

Ps: I used JBoss AS 7.1.2 (JBoss EAP 6)

Relations Mauricio Magnani

+5
source

Source: https://habr.com/ru/post/1438346/


All Articles