tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Amit Lonkar <amitlon...@yahoo.com.INVALID>
Subject Class Loader Problems with Tomcat 8 + Ant Task
Date Thu, 24 Sep 2015 18:24:17 GMT
Hi

We are trying to upgrade from Tomcat 7 to Tomcat 8. One of the functionalities we have is
to deploy a war file using the DeployTask class. I have a simple test servlet that uses the
DeployClass. I keep getting he following exception. I have ant 1.9.6 and catalina-ant-8.0.26
 in the class path. The maven project is attached. Works fine on Tomcat 7.0.64 but not on
Tomcat 8.0.26.

Tomcat Version: 8.0.26
Java: jdk1.8.0_45
OS: OSX
Class Path:
ant-1.9.6
ant-launcher-1.9.6
javax.servlet-api-3.1.0
tomcat-api-8.0.26
tomcat-catalina-ant-8.0.26
tomcat-juli-8.0.26
tomcat-servlet-api-8.0.26
tomcat-util-8.0.26
tomcat-util-scan-8.0.26

Exception Message:
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)

// Exception is thrown when trying to instantiate DeployTask
DeployTask oTask = new DeployTask();
oTask.setAlwaysLog(true);
oTask.setAppend(false);
oTask.setCreateEmptyFiles(true);
oTask.setError(oTaskError);
oTask.setFailonerror(true);
oTask.setLogError(true);
oTask.setOutput(oTaskOutput);
oTask.setPassword("adminManagerScript");
oTask.setPath("/broker");
oTask.setProject(new Project());
oTask.setTag("v7");
oTask.setUpdate(true);
oTask.setUrl("http://localhost:8080/manager/text");
oTask.setUsername("adminManagerScript");
oTask.setWar("/Users/amitlonkar/Documents/Builds/2015-09-23_1612/v7broker.war");
oTask.execute();


Thanks
Amit Lonkar


Mime
View raw message