tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Amit Lonkar <amitlon...@yahoo.com.INVALID>
Subject Re: Class Loader Problems with Tomcat 8 + Ant Task
Date Fri, 16 Oct 2015 19:44:37 GMT
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)




> On Oct 15, 2015, at 7:08 PM, Christopher Schultz <chris@christopherschultz.net>
wrote:
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
> 
> Amit,
> 
> On 10/15/15 2:45 PM, Amit Lonkar wrote:
>> All jar files are sitting in the webapp/WEB-INF/lib. Please see
>> attached screen shot.
>> 
>> The ant jar is apache ant 1.9.6.
>> 
>> I have small maven project can be used to reproduce this problem,
>> if that helps I can share it.
> 
> Tomcat can get very angry if you do things like putting its jars into
> your application's WEB-INF/lib directory. It may even prevent you from
> loading those classes from that location.
> 
> What happens if you remove all of the tomcat-*.jar files from
> WEB-INF/lib and move ant*.jar into CATALINA_BASE/lib/ and try again?
> 
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Comment: GPGTools - http://gpgtools.org
> 
> iQIcBAEBCAAGBQJWIE4MAAoJEBzwKT+lPKRYTtsQAMt3+1tToXhBaSR9VvdNdhgK
> M7MRT0w5/BUx/k6NWOXbr8lcOINUV2nTOX7eB45dl6Ch0bGOrSYgLtM8AJfjrh2L
> /9MFsHlR51qhWwi/gxjakHnEyJxtv19xNNgI0mbdO049fZcxS2Zor6qt/rB9eF75
> /gVQ0nMWh8zUWXUtRdgnYkhum6YigkeocoVy5rLUHbgzPY4kGLIS6MNwsHRuyopl
> wJRsngkK6VEE5jlk1MpwfD3xRlElYXsyJZsW38JNQAZvfKTNGEMPUGsoSLDSxhXO
> joFrGqDZsSRONAjXU2uhlAU00PWWnh7GXfjiAFq4HRJ5Y6TgJnDe7/S5f1AVywMJ
> 4b5bUdqRnylTdeK1kWr7Rv8DfrWC9ipBfvRo5Sfp15XmZECUFJJtNqtwpuDcthaI
> 9G5zi94VRhiBrH6Ube84d1ezqruvv2NRSEgmTavC/Ej2Csf1wC3yB9nNGtbFp2oh
> tgJPNYiDQhH8YH7+OWg9JTrZmS8sH1cuhYT0MRPcUCnF3YiGB++dtXI0dOiL3bki
> nu1esyjaQpp9V69ylbZfUUmT8CWZboHFO4Mc8vauXTfzNfafP+oUblhhyzIWRa2p
> KZ32eGfRDrN6BJggtq6y7XyfuFWN4PXcHD6EOC/YpOTY7oRhPIJCf0s6tmi/HMuv
> Cufh+PoWkxFuRzBLyVlP
> =BCiV
> -----END PGP SIGNATURE-----
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message