0

I have successfully developed and deployed a java servlet in a tomcat server.

But in that servlet i call a dll file. In my computer that i run the tomcat server and i call the library i use System.load("C:/java/src/calldllfile.dll"); and it works fine .

The problem is that in jelastic tomcat i don't really know what path i should use and where i should place my dll file for my servlet to call... and i catch in my code with a try it returns a UnsatisfiedLinkError so it really must be the path ...

Following a similar answer in jelastic forum that is on comments below i tried to set my file into home folder and call it with

System.loadLibrary(System.getProperty("user.home")+"/"+"calldllfile.dll"); but it didnt work.

So i don't really know what to do ... i include below an image of my deployed servlet with the location of the dll library that i cannot call. It would be just really helpfull if someone tell me what path i should use in System.load("?????");. Thanks

enter image description here

user878813
  • 785
  • 2
  • 16
  • 28
  • Have you already tried this? http://community.jelastic.com/index.php/topic/121-how-to-load-a-native-dllso-in-apache-tomcat/ – David Lavender Feb 27 '13 at 16:19
  • yes i did what the guy sais there, i upload in home my dll and then try to call it ... but still the same problem... – user878813 Feb 27 '13 at 16:47
  • if only someone could explain me what is the path to WEBINF for example in jelastic...i printer "user.home" and /opt/tomcat/temp comes up so how can i get my dll in there so i can call it ? – user878813 Feb 27 '13 at 17:12

2 Answers2

2

Folders webapps and home are located on the same level and the root folder for them is /opt/tomcat/ (equivalent of environment variable CATALINA.HOME - portion of docs). If you are talking about WEB-INF folder which is definitely located under your context (ROOT for example), to get it you need to use /opt/tomcat/webapps/ROOT/WEB-INF (or System.getProperty("catalina.home")+ "webapps/ROOT/WEB-INF/").

Concerning .dll libs you can check this

Anton
  • 64
  • 3
0

I know this is an old thread, but the answer can be useful for someone.

To access the home folder from a Tomcat installation you have to use the real path /opt/tomcat/

This way you can access your dll with the path /opt/tomcat/temp/calldllfile.dll

henriqueor
  • 849
  • 1
  • 17
  • 38