Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Loading *.so files into Websphere

My JSP program is set to run on Websphere under HP-UX.

I have some .jar files and a .so file which contains classes that my program needs to run.

By placing my .jar files into \MyProgram\WEB-INF\lib\ folder, I was able to get some to work.

However, I see an UnsatisfiedLinkError which is caused by my lib.so file not being recognised.

One of the ways I found was:

  1. In Administrative Console, go to Environment -> Shared Libraries -> New

  2. Enter the .jar file locations into Classpath, enter the .so file location into Native Library Path

  3. In Administrative Console, go to Applications -> Application Types -> Enterprise Applications

  4. Under MyProgram -> Shared library references -> Shared Library Mapping, assign the library to the program by moving it from Available to Selected.

I have two questions:

  1. Can I just get the .jar files and the .so file to work from my program's \lib\ folder instead?

  2. If I can't, is it possible to list the classpath and native library path from my application folder? Something like uploading my application.war with a websphere variable directory %MYPROGRAM%\WEB-INF\lib\lib.so rather than placing the file in the physical server with an absolute path C:\IBM\WebSphere\AppServer\bin\lib.so?

[EDIT-01] Further details below:

Error received: "Error 500: java.lang.UnsatisfiedLinkError: com.chrysalisits.crypto.LunaAPI.Initialize()V"

I am trying to get Websphere to interface with LunaSA HSM to retrieve public/private keys. They have provided me with: libLunaAPI.sl, libLunaAPI.so, LunaJCASP.jar, LunaJCESP.jar. From IBM's Websphere V8 -> References -> Class Loading Exceptions, it indicates that I need the *.so file for HP-UX so I did that accordingly. The path set are absolute paths which I have specified in the Websphere. This relates to my second question.

The first question is me actually wondering whether I can put these files into myProgram.war and run off from there instead of using WinSCP to access the server and putting files there for absolute paths references. Perhaps specify that the above mentioned files are located in my program, under \WEB-INF\lib\ instead. This is because only this program of mine will be accessing the LunaSA HSM.

** PS. I tried both methods but it still fails. sigh.

like image 663
Em Cee Avatar asked Jul 05 '12 08:07

Em Cee


Video Answer


1 Answers

For the Shared Library implementation, I believe you specify just the directory in the Native Library Path, not the file name. That is, with your current file location, /opt/apps/WebSphere/AppServer/bin.

On the other hand, I'd expect that directory to already be in WebSphere's WAS_LIBPATH and SHLIB_PATH, so it should be unnecessary to list it at all. (Check $WAS_HOME/bin/setupCmdLine.sh.)

However, I think it would be better to create a subdirectory somewhere for your luna files, and point your Shared Library Native Library Path to that instead.

like image 128
dbreaux Avatar answered Sep 22 '22 04:09

dbreaux