Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Jni problem

 
kamal pathak
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Jayesh Lalwani
Ranch Hand
Posts: 502
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic