I'm calling a dll through jni call in tomcat. I'm able to load the dll and able to call the dll function. The dll internally calls other dll. And that dll call's some files present in the same path as dll. As a stand alone java application everything is working fine. But inside tomcat the dll is not able to find the files which it calls. All dll's and files are in the same path.
What could be the solution? Any suggestion?
posted 9 years ago
If the dll is looking for files in the "current path" (very bad design, btw, and also a very common mistake, too), then you might try putting those files in the tomcat\bin folder. However, Windows doesn't gurantee that the current path will stay the same for the life of a process, so don't be surprised if your application works on startup and stops working in between.
When you ran your code in a standalone app, all your files must be in the folder that you started from, which is the current path at startup. However, tomcat starts from tomcat/bin I beleive and your code is looking for files there.