Ant构建问题:NoClassDefFoundError

时间:2013-05-14 18:28:48

标签: ant jboss wsdl wsdl2java

我是Ant和这个应用程序的新手。我无法解码此错误消息。

C:\Eclipse\sources_int\external-sources>ant netstudy-generate-client
Buildfile: C:\Eclipse\sources_int\external-sources\build.xml

netstudy-generate-client:
   [delete] Deleting directory C:\Eclipse\ext_sources_int\external-sources\build\generated_classe
s
    [mkdir] Created dir: C:\Eclipse\sources_int\external-sources\build\generated_classes

     [java] java.lang.NoClassDefFoundError: org/apache/cxf/tools/wsdlto/WSDLToJava
     [java] Caused by: java.lang.ClassNotFoundException: org.apache.cxf.tools.wsdlto.WSDLToJava
     [java]     at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
     [java]     at java.security.AccessController.doPrivileged(Native Method)
     [java]     at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
     [java]     at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
     [java]     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
     [java]     at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
     [java] Could not find the main class: org.apache.cxf.tools.wsdlto.WSDLToJava.  Program will exit.
     [java] Exception in thread "main"
     [java] Java Result: 1

BUILD FAILED
C:\Eclipse\sources_int\external-sources\build.xml:183: srcdir "C:\Eclipse\sources_int\
external-sources\build\generated_src" does not exist!

2 个答案:

答案 0 :(得分:0)

ant构建的一部分是尝试运行Java应用程序。无法找到主类(包含main方法的Java类)。检查你的路径并确保你包含的jar文件包含org.apache.cxf.tools.wsdlto.WSDLToJava类。

可能它希望在无法找到的目录中找到这个类。

答案 1 :(得分:0)

JBoss附带wsconsume以生成客户端。我试图强制使用wsdltojava但它没有用,我有同样的问题。 因此,请尝试使用 wsconsume