Finding the right dll after JBoss redirect (hot)?

My web application uses a native DLL for some of its functionality (the location of which is provided in the PATH). Everything works until I make changes to WAR and JBoss hot. At this point the dll is no longer found and I need to manually restart the server.

What is the best way to load a DLL into an application after a hot deployment?

+2


source to share


1 answer


It might not be that easy. Usually the DLL is bound to a specific classloader. On redeployment, this means the original classloader used for your application will be destroyed. Unfortunately, the Java virtual machine does not allow the second classloader to reload the DLL again.

You should have something static that will never be unloaded by the virtual machine. Perhaps having a second application loading the DLL would be a solution, since redeploying the first application would not affect the DLL. I am assuming that it is also possible to create a Jar file that loads the DLL and adds it to the JBoss classpath rather than adding it to your application. Typically, these servers have a "common" directory where jar files can be added for use by all applications.



The following bug from SUN sheds light on this issue, which is more general than just loading servlets:

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4225434

+1


source







All Articles