使用build.xml在Eclipse中构建错误

时间:2010-06-16 16:15:50

标签: java eclipse build

我正在使用Eclipse开发Java项目。该项目需要第二个项目(不是我的),在其构建路径中命名为 sams sams 提供了build.xml文件,它应该在构建时使用Apache CXF生成一些代码。当我在Eclipse上使用Apache ANT并从其构建文件运行 cxf.generated 命令时,我收到以下错误:

Buildfile: C:\Docs\ZacRocha\Desktop\sams\build.xml
cxf.generated:
  [echo] Generating code using Apache CXF wsdl2java...
  [java] 16-Jun-2010 16:04:08 org.apache.cxf.binding.corba.CorbaConduit prepare
  [java] SEVERE: Could not resolve target object
  [java] 16-Jun-2010 16:04:08 org.apache.cxf.binding.corba.CorbaConduit prepare
  [java] SEVERE: Could not resolve target object
  [java] WSDLToJava Error: org.apache.cxf.wsdl11.WSDLRuntimeException: Fail to create wsdl definition from : file:/C:/Docs/ZacRocha/Desktop/sams/$%7barchivesoftware.wsdl%7d
  [java] Caused by : WSDLException: faultCode=PARSER_ERROR: Problem parsing 'file:/C:/Docs/ZacRocha/Desktop/sams/$%7barchivesoftware.wsdl%7d'.: java.io.FileNotFoundException: C:\Docs\ZacRocha\Desktop\sams\${archivesoftware.wsdl} (The system cannot find the file specified) 
  [java] 16-Jun-2010 16:04:10 org.apache.cxf.binding.corba.CorbaConduit prepare
  [java] SEVERE: Could not resolve target object
  [java] 16-Jun-2010 16:04:10 org.apache.cxf.binding.corba.CorbaConduit prepare
  [java] SEVERE: Could not resolve target object
  [java] WSDLToJava Error: org.apache.cxf.wsdl11.WSDLRuntimeException: Fail to create wsdl definition from : file:/C:/Docs/ZacRocha/Desktop/sams/$%7barchivehardware.wsdl%7d
  [java] Caused by : WSDLException: faultCode=PARSER_ERROR: Problem parsing 'file:/C:/Docs/ZacRocha/Desktop/sams/$%7barchivehardware.wsdl%7d'.: java.io.FileNotFoundException: C:\Docs\ZacRocha\Desktop\sams\${archivehardware.wsdl} (The system cannot find the file specified) 
BUILD SUCCESSFUL

总时间:4秒

我习惯在Eclipse上编程,而且我对使用Apache ANT进行构建知之甚少。有人能告诉我问题到底在哪里吗?提前致谢!

3 个答案:

答案 0 :(得分:0)

您需要将适当的罐子添加到类路径中,或者您的团队决定存储正确的罐子的地方

答案 1 :(得分:0)

  

java.io.FileNotFoundException:C:\ Docs \ ZacRocha \ Desktop \ sams \ $ {archivehardware.wsdl}

看起来属性${archivehardware.wsdl}尚未解析。此类属性通常在构建脚本或单独的build.properties文件中设置。

答案 2 :(得分:0)

从wsdl生成java代码的ant任务似乎使用了一个名为'archivehardware.wsdl'的属性。将此属性添加到构建脚本。 例如,

 <property name="archivehardware.wsdl" value="mydef.wsdl"/>

或者如果属性(变量)已在属性文件中定义,请确保包含属性文件。 例如,

 <property file="build.properties"/>