tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: Class Loader Problems with Tomcat 8 + Ant Task
Date Thu, 22 Oct 2015 14:32:24 GMT
Amit,

On 10/16/15 3:44 PM, Amit Lonkar wrote:
> Thanks Chris
> 
> Tried two scenarios
> 
> 1. Removed any tomcat-*.jar files from webapp/WEB-INF/lib folder. Also moved ant-1.9.6.jar
from webapp/WEB-INF/lib to catalina/lib. All works fine now.
> 
> 2. Removed any tomcat-*.jar files from webapp/WEB-INF/lib folder, but this time left
the  ant-1.9.6.jar in webapp/WEB-INF/lib. Got the following error. Since Ant is not shipped
with tomcat we are bundling it with our application. Any reason why Ant needs to be in tomcat/lib
folder?
> 
> type Exception report
> 
> message Servlet execution threw an exception
> 
> description The server encountered an internal error that prevented it from fulfilling
this request.
> 
> exception
> 
> javax.servlet.ServletException: Servlet execution threw an exception
> 	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
> root cause
> 
> java.lang.NoClassDefFoundError: org/apache/tools/ant/Task
> 	java.lang.ClassLoader.defineClass1(Native Method)
> 	java.lang.ClassLoader.defineClass(ClassLoader.java:760)
> 	java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
> 	java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
> 	java.net.URLClassLoader.access$100(URLClassLoader.java:73)
> 	java.net.URLClassLoader$1.run(URLClassLoader.java:368)
> 	java.net.URLClassLoader$1.run(URLClassLoader.java:362)

It's all going to come down to which ClassLoader is in effect then the
thread tries to load that class. Was that the full stack trace? That
looks like an anonymous permission-executor class to elevate privileges
for a certain operation.

-chris

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message