This is not the typo. I actually use JNA (Java Native Access) to access shared libraries (DLLs on Windows) instead of JNI.
I added the jna.librabry.path to conf.bat as follows:
rem # Path to jna.library.path
set "JAVA_OPTS=%JAVA_OPTS% -Djna.library.path=C:\Software\VMWare\VSphere-4.1"
I also added this code to my class:
static {
System.setProperty("jna.library.path", "C:\\Software\\VMWare\\VSphere-4.1");
}
When I run the program in Jboss, I still got the following error:
java.lang.UnsatisfiedLinkError: Unable to load library 'vix': The specified module could not be found.
2011-05-06 10:26:45,950 ERROR [STDERR] (WorkManager(2)-3) at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:163)
2011-05-06 10:26:45,950 ERROR [STDERR] (WorkManager(2)-3) at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:236)
It seems that JBOSS could not find the DLLs resulting to UnsatisfiedLinkError.
BTW, I tested this code in Eclispe and it ran fine! Certainly, Eclispe and JBOSS are two different environments.
Also, I could not find the properties MBean in JMX-Console.
Please let me know what additional info is needed for debug purpose.
Any help from the community is greatly appreciated!
Tuan