bubbles
bubbles

Reputation: 881

GWT Appliaction with 3rd Party Library works in Development mode but not Deployed mode

I am working on a GWT application and I am using 3rd party Java-R wrapper library. This will be converted into Java Bytecode and (I guess) call some methods via the R libraries.. I was able to successfully get it to work on eclipse development mode.

In order to get it to work, I had to add the .jar to the classpath, and add to the java path (Under Run-Configurations->Environment Variables) variable to add location of the folder containing several .dll which are required for the execution of the program.

Everything seems to work fine in development mode but stuff seems to break when I deploy it via Tomcat 7. Is there anything else I need to do when I modify the environment variables in GWT?

Initially the Tomcat server would crash because of

May 06, 2013 4:08:22 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/r] is still processing a request that has yet to finish. This is very likely to create a memory leak. You can control the time allowed for requests to finish by using the unloadDelay attribute of the standard Context implementation.

I changed the code a little differently and now the it just entered what appears to be an infinite while loop. These details seem unimportant to my question, however.

I assume there's two ways of using third party libraries for GWT

  1. It's just a Jar that you just include (as well as in your web-inf/lab) and everything works
  2. You use a Jar and a bunch of other .dlls whose path you set in the Enviroment Variables for the project. this what I did and, again, it works in development mode but not in deployed mode.

Any and all feedback/advice is GREATLY appreaciated. Thanks!

Upvotes: 0

Views: 169

Answers (1)

skywalker
skywalker

Reputation: 415

The jar you are including in the classpath are not available in the server runtime, If you do not want to put them explicitly in WEB-INF/lib, you can try by copying those jars into tomcat's server/lib folder

Since you have .dlls also they need to set by passing the jvm argument

java -Djava.library.path=/dlls.folder

for tomcat you can edit the bin/startup.sh (or .bat) and modify java.library.path variable, in some systems you might need to set LD_LIBRARY_PATH variable too see similar discussion here

Upvotes: 1

Related Questions