Bug 58112 - o.a.c.ant.DeployTask depends on o.a.tomcat.util.* - packaging or documentation issue ?
o.a.c.ant.DeployTask depends on o.a.tomcat.util.* - packaging or documentatio...
Status: RESOLVED FIXED
Product: Tomcat 7
Classification: Unclassified
Component: Documentation
trunk
PC Windows NT
: P2 normal (vote)
: ---
Assigned To: Tomcat Developers Mailing List
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2015-07-07 14:27 UTC by Violeta Georgieva
Modified: 2015-07-28 15:06 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Violeta Georgieva 2015-07-07 14:27:48 UTC
Hi,

While I was looking at issue 58086 I found that o.a.c.ant.DeployTask depends on o.a.tomcat.util.*

java.lang.NoClassDefFoundError: org/apache/tomcat/util/buf/B2CConverter
        at org.apache.catalina.ant.AbstractCatalinaTask.execute(AbstractCatalinaTask.java:202)
        at org.apache.catalina.ant.DeployTask.execute(DeployTask.java:195)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:392)
        at org.apache.tools.ant.Target.performTasks(Target.java:413)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
        at org.apache.tools.ant.Main.runBuild(Main.java:811)
        at org.apache.tools.ant.Main.startAnt(Main.java:217)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: java.lang.ClassNotFoundException: org.apache.tomcat.util.buf.B2CConverter
        at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
        ... 19 more

According to the documentation one needs only catalina-ant.jar [1]

"Copy the file server/lib/catalina-ant.jar from your Tomcat installation into Ant's library directory ($ANT_HOME/lib)."

Is this a packaging issue or a documentation issue?

Regards,
Violeta

[1] http://tomcat.apache.org/tomcat-7.0-doc/manager-howto.html#Executing_Manager_Commands_With_Ant
Comment 1 Mark Thomas 2015-07-07 15:31:35 UTC
I'd say documentation.
Comment 2 Konstantin Kolinko 2015-07-08 12:26:03 UTC
I'd say that the recommended way to enable those tasks in Ant is to use one of the following:

a) bin/catalina-tasks.xml from usual Tomcat 7.0.x distribution
b) build.xml from Tomcat 7.0.x deployer distribution

Both import all *.jars.
Comment 3 Mark Thomas 2015-07-28 15:06:25 UTC
Fixed to use importing bin/catalina-tasks.xml in trunk, 8.0.x (for 8.0.25 onwards), 7.0.x (for 7.0.64 onwards) and 6.0.x (for 6.0.45 onwards).