在我的应用程序上执行Ant构建时获取java.net.ConnectException

时间:2014-11-19 18:41:00

标签: java connection-timeout

我正在我的应用程序上执行Ant构建,每次我收到java.net.ConnectException:连接超时:connect 我尝试了类似问题的答案但没有成功。 :( 我附加了Ant Build的堆栈跟踪。

[assemble-jar] java.net.ConnectException: Connection timed out: connect
[assemble-jar] 	at java.net.PlainSocketImpl.socketConnect(Native Method)
[assemble-jar] 	at java.net.PlainSocketImpl.doConnect(Unknown Source)
[assemble-jar] 	at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
[assemble-jar] 	at java.net.PlainSocketImpl.connect(Unknown Source)
[assemble-jar] 	at java.net.SocksSocketImpl.connect(Unknown Source)
[assemble-jar] 	at java.net.Socket.connect(Unknown Source)
[assemble-jar] 	at java.net.Socket.connect(Unknown Source)
[assemble-jar] 	at sun.net.NetworkClient.doConnect(Unknown Source)
[assemble-jar] 	at sun.net.www.http.HttpClient.openServer(Unknown Source)
[assemble-jar] 	at sun.net.www.http.HttpClient.openServer(Unknown Source)
[assemble-jar] 	at sun.net.www.http.HttpClient.<init>(Unknown Source)
[assemble-jar] 	at sun.net.www.http.HttpClient.New(Unknown Source)
[assemble-jar] 	at sun.net.www.http.HttpClient.New(Unknown Source)
[assemble-jar] 	at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
[assemble-jar] 	at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
[assemble-jar] 	at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
[assemble-jar] 	at atg.xml.XMLFileEntityResolver.resolveLocalEntity(XMLFileEntityResolver.java:372)
[assemble-jar] 	at atg.xml.XMLFileEntityResolver.resolveEntity(XMLFileEntityResolver.java:286)
[assemble-jar] 	at atg.dtds.j2ee.J2EEEntityResolver.resolveEntity(J2EEEntityResolver.java:470)
[assemble-jar] 	at atg.dtds.j2ee.J2EEEntityResolver.resolveEntity(J2EEEntityResolver.java:465)
[assemble-jar] 	at com.sun.org.apache.xerces.internal.util.EntityResolverWrapper.resolveEntity(Unknown Source)
[assemble-jar] 	at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.resolveEntityAsPerStax(Unknown Source)
[assemble-jar] 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.dispatch(Unknown Source)
[assemble-jar] 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.next(Unknown Source)
[assemble-jar] 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(Unknown Source)
[assemble-jar] 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
[assemble-jar] 	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
[assemble-jar] 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
[assemble-jar] 	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
[assemble-jar] 	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
[assemble-jar] 	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
[assemble-jar] 	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
[assemble-jar] 	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
[assemble-jar] 	at atg.appassembly.util.MetaInfGeneratorImpl.createUnmarshallerHandler(MetaInfGeneratorImpl.java:568)
[assemble-jar] 	at atg.appassembly.util.MetaInfGeneratorImpl.loadApplicationXm5FromStream(MetaInfGeneratorImpl.java:480)
[assemble-jar] 	at atg.appassembly.EarInfoFactory.getJ2EEModulesForEar(EarInfoFactory.java:261)
[assemble-jar] 	at atg.appassembly.EarInfoFactory.processEARModules(EarInfoFactory.java:235)
[assemble-jar] 	at atg.appassembly.EarInfoFactory.createEarInfo(EarInfoFactory.java:143)
[assemble-jar] 	at atg.appassembly.ApplicationAssembler.getEarInfoFromDynModules(ApplicationAssembler.java:273)
[assemble-jar] 	at atg.appassembly.ant.CreateUnpackedEarTask.execute(CreateUnpackedEarTask.java:476)
[assemble-jar] 	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
[assemble-jar] 	at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
[assemble-jar] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

请帮我解决这个问题。

此致

1 个答案:

答案 0 :(得分:1)

得到同样的问题,在我评论该行后修复 <setproxy proxyhost="<ip>" proxyport="<port>"/>