Classloader problems Tomcat 6 javagent

Posted by alecswan on Stack Overflow See other posts from Stack Overflow or by alecswan
Published on 2010-03-25T19:03:18Z Indexed on 2010/03/28 7:23 UTC
Read the original article Hit count: 340

Filed under:
|
|
|

I am using Salve Dependency Injection library that instruments the byte code of the web application. I specified -javaagent in Tomcat VM options and pointed it to the Salve agent jar.

The agent jar gets loaded, but then it throws a java.lang.NoClassDefFoundError unable to find classes that are in other Salve jars which are located in WEB-INF/lib folder of my web app.

I can solve this problem by putting those JARs in Tomcat/endorsed folder. However, some of those jars depend on third-party libraries, such as Spring and servlet-api.jar. Therefore, I am forced to put all these dependencies in Tomcat/endorsed as well.

Could anybody suggest a better way for handling dependencies of a Tomcat javaagent?

Thanks.

© Stack Overflow or respective owner

Related posts about tomcat

Related posts about java