我们正面临java.net.ConnectException:连接超时:在进行ANT构建时连接,这发生在所有使用ANT的Java开发人员机器中。我们试图在网络中阻止下面的标记.xml因为 java.sun.com 是问题的原因。
但这似乎仍然不能解决问题。请帮助我们解决此问题。
下面是堆栈跟踪,
[xmltask] java.net.ConnectException: Connection timed out: connect
[xmltask] at java.net.PlainSocketImpl.socketConnect(Native Method)
[xmltask] at java.net.PlainSocketImpl.doConnect(Unknown Source)
[xmltask] at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
[xmltask] at java.net.PlainSocketImpl.connect(Unknown Source)
[xmltask] at java.net.SocksSocketImpl.connect(Unknown Source)
[xmltask] at java.net.Socket.connect(Unknown Source)
[xmltask] at java.net.Socket.connect(Unknown Source)
[xmltask] at sun.net.NetworkClient.doConnect(Unknown Source)
[xmltask] at sun.net.www.http.HttpClient.openServer(Unknown Source)
[xmltask] at sun.net.www.http.HttpClient.openServer(Unknown Source)
[xmltask] at sun.net.www.http.HttpClient.<init>(Unknown Source)
[xmltask] at sun.net.www.http.HttpClient.New(Unknown Source)
[xmltask] at sun.net.www.http.HttpClient.New(Unknown Source)
[xmltask] at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
[xmltask] at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
[xmltask] at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
[xmltask] at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
[xmltask] at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
[xmltask] at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(Unknown Source)
[xmltask] at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startDTDEntity(Unknown Source)
[xmltask] at com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.setInputSource(Unknown Source)
[xmltask] at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.dispatch(Unknown Source)
[xmltask] at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.next(Unknown Source)
[xmltask] at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(Unknown Source)
[xmltask] at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
[xmltask] at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
[xmltask] at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
[xmltask] at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
[xmltask] at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
[xmltask] at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
[xmltask] at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
[xmltask] at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
[xmltask] at com.oopsconsultancy.xmltask.ant.XmlTask.documentFromStream(XmlTask.java:354)
[xmltask] at com.oopsconsultancy.xmltask.ant.XmlTask.documentFromFile(XmlTask.java:371)
[xmltask] at com.oopsconsultancy.xmltask.ant.XmlTask.access$000(XmlTask.java:27)
[xmltask] at com.oopsconsultancy.xmltask.ant.XmlTask$InputFile.getDocument(XmlTask.java:215)
[xmltask] at com.oopsconsultancy.xmltask.ant.XmlTask.execute(XmlTask.java:620)
[xmltask] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
[xmltask] at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
[xmltask] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[xmltask] at java.lang.reflect.Method.invoke(Unknown Source)
[xmltask] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[xmltask] at org.apache.tools.ant.Task.perform(Task.java:348)
[xmltask] at org.apache.tools.ant.Target.execute(Target.java:390)
[xmltask] at org.apache.tools.ant.Target.performTasks(Target.java:411)
[xmltask] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
[xmltask] at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
[xmltask] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[xmltask] at org.eclipse.ant.internal.launching.remote.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
[xmltask] at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
[xmltask] at org.eclipse.ant.internal.launching.remote.InternalAntRunner.run(InternalAntRunner.java:424)
[xmltask] at org.eclipse.ant.internal.launching.remote.InternalAntRunner.main(InternalAntRunner.java:138)
BUILD FAILED
C:SIGMASIGMA_6.0javasource_6.0buildbuild_ecams_ehr.xml:2037: Connection timed out: connect
您是否在公司代理后面工作?这将阻止与互联网的连接。您可以将 ANT 脚本配置为使用代理:
https://ant.apache.org/manual/proxy.html
我从未使用过xmltask,但我推测它可能无法解析XML文档中的命名空间。
<root xmlns:e="http://my.domain.com/exampleschema">
<e:customer>
<e:name>Joe Bloggs</e:name>
<e:age>80</e:age>
</e:table>
</root>
xmltask 不是标准的 ANT 任务,它是一个第三方扩展:
http://www.oopsconsultancy.com/software/xmltask/
如果您在公司网络上,则情况是您的本地网络 DEV/(无论其名称如何)环境连接遇到网络连接问题。 构建过程的一部分是尝试建立活动连接以动态下载构建 ant-file,但失败。
如果代理配置为使用 ant(检查 env),请检查其配置是否正确,否则手动编辑 ANT 的代理设置,它应该正确构建。 点击: https://ant.apache.org/manual/proxy.html
这应该有效。