ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Petar Tahchiev" <paranoia...@gmail.com>
Subject NoClassDefFoundError: org/apache/tools/ant/Task
Date Mon, 05 Feb 2007 07:50:56 GMT
Hi guys,

Here is my problem. I am currently running on a Windows box at work and I
downloaded the ant-1.7 package and installed it. Then I downloaded the
axis-1.4 package and I am trying to use the wsdl2java task, like it is
written in the manual:

<path id="axis.classpath">
  <fileset dir="${axis.home}/build/lib">
    <include name="**/*.jar" />
  </fileset>
</path>


<taskdef resource="axis-tasks.properties"
  classpathref="axis.classpath" />


<axis-wsdl2java
  output="${generated.dir}"
  testcase="true"
  verbose="true"
  url="${local.wsdl}" >
    <mapping
      namespace="http://axis.apache.org/ns/interop"
      package="interop" />
  </axis-wsdl2java>

but I get a classNotFound exception in the ant-core:


axis-init:
[antlib:org.apache.tools.ant] Could not load definitions from resource
org/apac
e/tools/ant/antlib.xml. It could not be found.

BUILD FAILED
C:\Documents and Settings\Petar\My
Documents\workspace\WebServiceClient\build.x
l:11: taskdef A class needed by class
org.apache.axis.tools.ant.wsdl.Wsdl2javaA
tTask cannot be found: org/apache/tools/ant/Task
        at org.apache.tools.ant.taskdefs.Definer.addDefinition(Definer.java
:613

        at org.apache.tools.ant.taskdefs.Definer.loadProperties(Definer.java
:41
)
        at org.apache.tools.ant.taskdefs.Definer.execute(Definer.java:268)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java
:288)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAcce
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(
DispatchUtils.ja
a:105)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:357)
        at org.apache.tools.ant.Target.performTasks(Target.java:385)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java
:1329)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets
(DefaultEx
cutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
        at org.apache.tools.ant.Main.runBuild(Main.java:698)
        at org.apache.tools.ant.Main.startAnt(Main.java:199)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
Caused by: java.lang.NoClassDefFoundError: org/apache/tools/ant/Task
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
        at java.security.SecureClassLoader.defineClass(
SecureClassLoader.java:1
4)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at org.apache.tools.ant.AntClassLoader.findBaseClass(
AntClassLoader.jav
:1414)
        at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java
:10
8)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:242)
        at org.apache.tools.ant.taskdefs.Definer.addDefinition(Definer.java
:583

        ... 19 more
--- Nested Exception ---
java.lang.NoClassDefFoundError: org/apache/tools/ant/Task
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
        at java.security.SecureClassLoader.defineClass(
SecureClassLoader.java:1
4)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at org.apache.tools.ant.AntClassLoader.findBaseClass(
AntClassLoader.jav
:1414)
        at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java
:10
8)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:242)
        at org.apache.tools.ant.taskdefs.Definer.addDefinition(Definer.java
:583

        at org.apache.tools.ant.taskdefs.Definer.loadProperties(Definer.java
:41
)
        at org.apache.tools.ant.taskdefs.Definer.execute(Definer.java:268)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java
:288)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAcce
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(
DispatchUtils.ja
a:105)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:357)
        at org.apache.tools.ant.Target.performTasks(Target.java:385)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java
:1329)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets
(DefaultEx
cutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
        at org.apache.tools.ant.Main.runBuild(Main.java:698)
        at org.apache.tools.ant.Main.startAnt(Main.java:199)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)

Total time: 0 seconds
C:\Documents and Settings\Petar\My Documents\workspace\WebServiceClient>echo
%A
T_HOME%
C:\Documents and Settings\Petar\My Documents\apache-ant-1.7.0

========================================================================

The wierdest thing is that yesterday, at home it was working perfectly on my
Fedora Core 6.

If anyone has an idea what is going on, I would be glad to know.

Thank you.

-- 
Regards, Petar!
Karlovo, Bulgaria.

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