我们正面临 java.net.ConnectException: Connection timed out: connect while doing ANT build,这发生在所有使用 ANT 的 java 开发人员机器上。我们试图阻止 web.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:\SIGMA\SIGMA_6.0\javasource_6.0\build\build_ecams_ehr.xml:2037: Connection timed out: connect