JavaFX启动时奇怪的连接

时间:2013-09-13 20:34:51

标签: java connection javafx

最近,我的JavaFX应用程序总是尝试在启动时连接到某些东西。 这个过程使我的应用程序暂停了一段时间,使我的应用启动时间延长了大约20秒。这是我看到的错误:

java.net.ConnectException: Connection timed out: connect
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
rce)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at sun.net.www.protocol.http.HttpURLConnection$6.run(Unknown Source)
        at sun.net.www.protocol.http.HttpURLConnection$6.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.net.www.protocol.http.HttpURLConnection.getChainedException(Unkno
wn Source)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown So
urce)
        at com.sun.deploy.net.proxy.AbstractAutoProxyHandler.getJSFileFromURL(Un
known Source)
        at com.sun.deploy.net.proxy.AbstractAutoProxyHandler.init(Unknown Source
)
        at com.sun.deploy.net.proxy.DynamicProxyManager.reset(Unknown Source)
        at com.sun.deploy.net.proxy.DeployProxySelector.reset(Unknown Source)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at com.javafx.main.Main.tryToSetProxy(Main.java:572)
        at com.javafx.main.Main.launchApp(Main.java:640)
        at com.javafx.main.Main.main(Main.java:805)
Caused by: java.net.ConnectException: Connection timed out: connect
        at java.net.DualStackPlainSocketImpl.connect0(Native Method)
        at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
        at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
        at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
        at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
        at java.net.PlainSocketImpl.connect(Unknown Source)
        at java.net.SocksSocketImpl.connect(Unknown Source)
        at java.net.Socket.connect(Unknown Source)
        at java.net.Socket.connect(Unknown Source)
        at sun.net.NetworkClient.doConnect(Unknown Source)
        at sun.net.www.http.HttpClient.openServer(Unknown Source)
        at sun.net.www.http.HttpClient.openServer(Unknown Source)
        at sun.net.www.http.HttpClient.<init>(Unknown Source)
        at sun.net.www.http.HttpClient.New(Unknown Source)
        at sun.net.www.http.HttpClient.New(Unknown Source)
        at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown
Source)
        at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Sour
ce)
        at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown So
urce)
        at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(Unknown So
urce)
        at java.net.URLConnection.getContentType(Unknown Source)
        at com.sun.deploy.net.proxy.AbstractAutoProxyHandler.isSupportedINSFile(
Unknown Source)
        ... 10 more

如果我从IDE运行,我没有看到它尝试连接。这是某种基于神谕的间谍尝试吗?是什么给了什么?

1 个答案:

答案 0 :(得分:0)

我认为它试图以某种方式自动检测代理。

我能够在Java控制面板中解决这个问题。在General标签的Network Settings...对话框中,从Use browser settings切换到Direct connection

(但我找不到在Firefox或IE中指定的任何代理设置。)