-
1. Re: Path setting for DLL's in JBOSS 7.1.1
guinotphil Oct 8, 2012 5:02 AM (in response to srinivas.bijjam)1 of 1 people found this helpfulIt seems you can easily add native libraries within any module if you follow this schema:
In module.xml add the line
<resource-root path="lib"/>
(well, I think libraries may work as well, but lib is more standard)
And create this lib directory. Inside it, don't just put the libraries, but subdirectories:
win-i686 : win 32 dll
win-x86_64 : win 64 dll
linux-i686 : linux 32 library
linux-x86_64 : linux 64
macosx-i686 : etc..
macosx-x86_64 ...
By the way, a question for the JBoss AS Team, the org.jboss.as.web comes with a lib directory with the JBoss Web native libraries. But I can't find the <resource-root path="lib"/> line within the module.xml. Why ?
Regards,
Philippe
-
2. Re: Path setting for DLL's in JBOSS 7.1.1
ctomc Oct 8, 2012 5:42 AM (in response to guinotphil)Hi,
lib is a special folder name and it is automatically recognized.
read more about this here https://docs.jboss.org/author/display/MODULES/Native+Libraries
--
tomaz
-
3. Re: Path setting for DLL's in JBOSS 7.1.1
guinotphil Oct 8, 2012 9:06 AM (in response to ctomc)Thank you for the link, it's more comprehensive than what I said...
I was actually confused because the org.hornetq package has the line
<resource-root path="lib"/>
Is there a specific reason for it ? Anyway, I have to consider the deletion of these lines from my own packages.
-
4. Re: Path setting for DLL's in JBOSS 7.1.1
srinivas.bijjam Oct 8, 2012 12:13 PM (in response to guinotphil)I placed my java related wrapper dll's under folder lib in one of the module and in module.xml I mentioned as <resource-root path="lib"/> but still I am 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
If I keep the same wrapper dlls in bin folder , I am not getting any exception.
-
5. Re: Path setting for DLL's in JBOSS 7.1.1
guinotphil Oct 9, 2012 4:53 AM (in response to srinivas.bijjam)Have you put the DLL inside a win-i686 folder ?
-
6. Re: Path setting for DLL's in JBOSS 7.1.1
srinivas.bijjam Oct 11, 2012 10:55 AM (in response to guinotphil)If I keep the DLL based on 32 or 64 bit, then JBOSS will stick to the particular bit and there wont be portable.
We want JBOSS independent and common for both 32 and 64 bit
-
7. Re: Path setting for DLL's in JBOSS 7.1.1
kazaag Oct 11, 2012 12:42 PM (in response to srinivas.bijjam)You can put the 32bit DLL in the win-i686 folder and the 64bit one in the win-x86_64 folder
DLL is by definition architecture dependant, the 32 DLL won't work with the 64bit JVM as the oposit.
If you have native lib you will need to provide a lib for each os-arch you want to support.
-
8. Re: Path setting for DLL's in JBOSS 7.1.1
srinivas.bijjam Oct 12, 2012 11:16 PM (in response to guinotphil)Thanks to Philippe now dll's are getting recognised and that exception is solved
But I am getting new exception
java.lang.UnsatisfiedLinkError: C:\Application Server\modules\com\correctionDll\main\lib\win-i686\testJavaWrapper.dll: Can't find dependent libraries
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.test.testJavaWrapperJNI.new_test()J
It is not able to take the jars which I set in the resource path
Here are my files and module.xml
I have created the following directory structure under the modules directory.
com\testDll\main
|- module.xml
|- test.jar
| - lib
|- win-i686
|- testJavaWrapper.dll
module.xml
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="com.testDll">
<resources>
<resource-root path="lib"/>
<resource-root path="test.jar"/>
</resources>
</module>
jboss-deployment-structure.xml
<jboss-deployment-structure>
<ear-subdeployments-isolated>false</ear-subdeployments-isolated>
<deployment>
<dependencies>
<module name="javaee.api" export="true"/>
<module name="sun.jdk" export="true"/>
<module name="com.lib" export="true"/>
<module name="com.correctionDll" services="import" export="true"/>
</dependencies>
</deployment>
</jboss-deployment-structure>
Iam using "JBoss AS 7.2.0.Alpha1-SNAPSHOT" version
Regards
Srini
-
9. Re: Path setting for DLL's in JBOSS 7.1.1
kazaag Oct 14, 2012 5:31 PM (in response to srinivas.bijjam)The libraties you use in our dll should also be present in the lib directory.
-
10. Re: Path setting for DLL's in JBOSS 7.1.1
srinivas.bijjam Oct 18, 2012 10:06 AM (in response to kazaag)Dear Francois
If I keep jars in the win-i686 folder then how to give resource-root path in module.xml as I am getting exception in recognizing the jars?
Regards
Srini
-
11. Re: Path setting for DLL's in JBOSS 7.1.1
kazaag Oct 18, 2012 12:19 PM (in response to srinivas.bijjam)The java.lang.UnsatisfiedLinkError is due to issue when loading the native part, so no jar loading issue.
I am not a jni specilist but I think if it can't find the depedency lib of the dll it is probalby the native library used by our dll. The fact that java.library.path is the property used to shearch the libs is another indication that it can't find some native element (otherwise the classpath will be displayed).