我有一個簡單的ant腳本來從sdl構建我的類。不幸的是,wsimport立即失敗。我懷疑它與類路徑有關。Ant wsimport任務失敗
<taskdef name="wsimport" classname="com.sun.tools.ws.ant.WsImport">
<classpath>
<pathelement location="${jaxws.lib.dir}/jaxws-tools.jar" />
</classpath>
</taskdef>
<wsimport
wsdl="${project.wsdl.dir}\some.wsdl"
destdir="${jaxws.output.dir}"
keep="false"
extension="true"
verbose="true"
wsdlLocation="http://localhost/wsdl"
target="2.1">
<depends file="${project.wsdl.dir}"/>
<produces dir="${jaxws.output.dir}"/>
</wsimport>
的,這是它產生的輸出:
[wsimport] 15 Mar 2013 12:23:25 PM com.sun.xml.bind.v2.util.XmlFactory createDocumentBuilderFactory [wsimport] SEVERE: null [wsimport] java.lang.AbstractMethodError: javax.xml.parsers.DocumentBuilderFactory.setFeature(Ljava/lang/String;Z)V [wsimport] at com.sun.xml.bind.v2.util.XmlFactory.createDocumentBuilderFactory(XmlFactory.java:176) [wsimport] at com.sun.tools.xjc.reader.internalizer.DOMForest.(DOMForest.java:162) [wsimport] at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.resetSchema(SchemaCompilerImpl.java:215) [wsimport] at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.(SchemaCompilerImpl.java:114) [wsimport] at com.sun.tools.xjc.api.XJC.createSchemaCompiler(XJC.java:72) [wsimport] at com.sun.tools.ws.wscompile.WsimportOptions.(WsimportOptions.java:152) [wsimport] at com.sun.tools.ws.wscompile.WsimportTool.(WsimportTool.java:89) [wsimport] at com.sun.tools.ws.wscompile.WsimportTool.(WsimportTool.java:92) [wsimport] at com.sun.tools.ws.ant.WsImport2.execute(WsImport2.java:848) [wsimport] at com.sun.istack.tools.ProtectedTask.execute(ProtectedTask.java:103) [wsimport] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:269) [wsimport] at org.apache.tools.ant.Task.perform(Task.java:364) [wsimport] at org.apache.tools.ant.Target.execute(Target.java:301) [wsimport] at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:135) [wsimport] at org.eclipse.ant.internal.launching.remote.InternalAntRunner.parseBuildFile(InternalAntRunner.java:192) [wsimport] at org.eclipse.ant.internal.launching.remote.InternalAntRunner.run(InternalAntRunner.java:401) [wsimport] at org.eclipse.ant.internal.launching.remote.InternalAntRunner.main(InternalAntRunner.java:138)
如果我運行命令行的詳細日誌記錄創建,上的wsimport,從JAX-WS bin目錄一切完美
[wsimport] command line: wsimport -d C:\Development\Source\ccs\jaxws-output -extension -verbose -target 2.1 C:\Development\Source\ccs\wsdl\some.wsdl -wsdllocation http://localhost/wsdl
我試過尋找解決方案,但現在我的想法不存在了
這意味着它是一隻螞蟻的具體問題。 – ACV 2015-10-02 07:16:41