title: Loading *.so files into Websphere
body: <p>My JSP program is set to run on Websphere under HP-UX.</p>
  
  <p>I have some .jar files and a .so file which contains classes that my program needs to run.</p>
  
  <p>By placing my .jar files into <code>\MyProgram\WEB-INF\lib\</code> folder, I was able to get some to work.</p>
  
  <p>However, I see an <code>UnsatisfiedLinkError</code> which is caused by my lib.so file not being recognised.</p>
  
  <p>One of the ways I found was:</p>
  
  <ol>
  <li><p>In Administrative Console, go to Environment -> Shared Libraries -> New</p></li>
  <li><p>Enter the .jar file locations into Classpath, enter the .so file location into Native Library Path</p></li>
  <li><p>In Administrative Console, go to Applications -> Application Types -> Enterprise Applications</p></li>
  <li><p>Under MyProgram -> Shared library references -> Shared Library Mapping, assign the library to the program by moving it from Available to Selected.</p></li>
  </ol>
  
  <p>I have two questions:</p>
  
  <ol>
  <li><p>Can I just get the .jar files and the .so file to work from my program's <code>\lib\</code> folder instead?</p></li>
  <li><p>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 <code>%MYPROGRAM%\WEB-INF\lib\lib.so</code> rather than placing the file in the physical server with an absolute path <code>C:\IBM\WebSphere\AppServer\bin\lib.so</code>?</p></li>
  </ol>
  
  <p>[EDIT-01] Further details below:</p>
  
  <blockquote>
    <p>Error received: "Error 500: java.lang.UnsatisfiedLinkError: com.chrysalisits.crypto.LunaAPI.Initialize()V"</p>
  </blockquote>
  
  <p>I am trying to get Websphere to interface with LunaSA HSM to retrieve public/private keys. They have provided me with: <em>libLunaAPI.sl, libLunaAPI.so, LunaJCASP.jar, LunaJCESP.jar</em>. From IBM's Websphere V8 -> References -> Class Loading Exceptions, it indicates that I need the *.so file for HP-UX so I did that <a href="http://i49.tinypic.com/292u445.jpg" rel="nofollow">accordingly</a>. The path set are absolute paths which I have specified in the Websphere. This relates to my second question.</p>
  
  <p>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.</p>
  
  <p>** PS. I tried both methods but it still fails. sigh.</p>