如果系统通过代理连接到Internet,则不会进行自动更新。我可以通过Chrome浏览器访问http://gt-test-asca-release.xxx/GreytipAstra_windows_3_0_1.exe
(我在Chrome浏览器中配置了代理),但使用install4j构建的应用无法自动更新。我在任务管理器中看到bgupdater.exe正在运行。请帮助。
注意:如果计算机直接连接到没有代理的互联网,则会成功进行自动更新。
编辑1:以下是jstack日志:
2017-10-17 02:28:57
Full thread dump Java HotSpot(TM) Client VM (24.80-b11 mixed mode, sharing):
"AWT-EventQueue-0" prio=6 tid=0x04ecb400 nid=0x2758 waiting on condition [0x0507e000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x29bf92d0> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(Unknown Source)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source)
at java.awt.EventQueue.getNextEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.WaitDispatchSupport$2.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$300(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Locked ownable synchronizers:
- None
"AWT-Shutdown" prio=6 tid=0x05118400 nid=0x3cf4 in Object.wait() [0x04f5f000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x29bf9418> (a java.lang.Object)
at java.lang.Object.wait(Object.java:503)
at sun.awt.AWTAutoShutdown.run(Unknown Source)
- locked <0x29bf9418> (a java.lang.Object)
at java.lang.Thread.run(Unknown Source)
Locked ownable synchronizers:
- None
"AWT-Windows" daemon prio=6 tid=0x04e80000 nid=0x385c runnable [0x04fef000]
java.lang.Thread.State: RUNNABLE
at sun.awt.windows.WToolkit.eventLoop(Native Method)
at sun.awt.windows.WToolkit.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Locked ownable synchronizers:
- None
"Java2D Disposer" daemon prio=10 tid=0x04e7f000 nid=0x1eec in Object.wait() [0x04caf000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x29bf94a8> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(Unknown Source)
- locked <0x29bf94a8> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(Unknown Source)
at sun.java2d.Disposer.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Locked ownable synchronizers:
- None
"Service Thread" daemon prio=6 tid=0x01ffa400 nid=0x1df4 runnable [0x00000000]
java.lang.Thread.State: RUNNABLE
Locked ownable synchronizers:
- None
"C1 CompilerThread0" daemon prio=10 tid=0x01ff7c00 nid=0x2b00 waiting on condition [0x00000000]
java.lang.Thread.State: RUNNABLE
Locked ownable synchronizers:
- None
"Attach Listener" daemon prio=10 tid=0x01ff6400 nid=0x30c0 waiting on condition [0x00000000]
java.lang.Thread.State: RUNNABLE
Locked ownable synchronizers:
- None
"Signal Dispatcher" daemon prio=10 tid=0x01ff4c00 nid=0xdfc runnable [0x00000000]
java.lang.Thread.State: RUNNABLE
Locked ownable synchronizers:
- None
"Finalizer" daemon prio=8 tid=0x01f81c00 nid=0x18a8 in Object.wait() [0x0439f000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x29a7ce48> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(Unknown Source)
- locked <0x29a7ce48> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(Unknown Source)
at java.lang.ref.Finalizer$FinalizerThread.run(Unknown Source)
Locked ownable synchronizers:
- None
"Reference Handler" daemon prio=10 tid=0x01f80400 nid=0x238c in Object.wait() [0x0430f000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x29a7ced8> (a java.lang.ref.Reference$Lock)
at java.lang.Object.wait(Object.java:503)
at java.lang.ref.Reference$ReferenceHandler.run(Unknown Source)
- locked <0x29a7ced8> (a java.lang.ref.Reference$Lock)
Locked ownable synchronizers:
- None
"main" prio=6 tid=0x01f5c800 nid=0x43ec in Object.wait() [0x0124e000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x29c13b80> (a java.awt.Component$AWTTreeLock)
at java.lang.Object.wait(Object.java:503)
at java.awt.WaitDispatchSupport.enter(Unknown Source)
- locked <0x29c13b80> (a java.awt.Component$AWTTreeLock)
at java.awt.Dialog.show(Unknown Source)
at java.awt.Component.show(Unknown Source)
at java.awt.Component.setVisible(Unknown Source)
at java.awt.Window.setVisible(Unknown Source)
at java.awt.Dialog.setVisible(Unknown Source)
at com.install4j.runtime.util.CustomDialog.setVisible(CustomDialog.java:26)
at com.install4j.runtime.util.StandardDialog.setVisible(StandardDialog.java:44)
at com.install4j.runtime.installer.helper.content.ProxyDialog.setVisible(ProxyDialog.java:70)
at com.install4j.runtime.installer.helper.content.ProxyConfig$15.run(ProxyConfig.java:283)
at com.install4j.runtime.installer.helper.content.ProxyConfig.showInternal(ProxyConfig.java:289)
at com.install4j.runtime.installer.helper.content.ProxyConfig.access$1300(ProxyConfig.java:25)
at com.install4j.runtime.installer.helper.content.ProxyConfig$20.run(ProxyConfig.java:401)
at com.install4j.runtime.installer.helper.comm.actions.RunAction.execute(RunAction.java:11)
at com.install4j.runtime.installer.helper.comm.HelperCommunication.executeActionDirect(HelperCommunication.java:271)
at com.install4j.runtime.installer.helper.comm.HelperCommunication.executeActionInt(HelperCommunication.java:246)
at com.install4j.runtime.installer.helper.comm.HelperCommunication.executeActionChecked(HelperCommunication.java:184)
at com.install4j.runtime.installer.helper.content.ProxyConfig.show(ProxyConfig.java:398)
at com.install4j.runtime.installer.helper.content.HttpRequestHandler.handleProxyFailure(HttpRequestHandler.java:322)
at com.install4j.runtime.installer.helper.content.HttpRequestHandler.getURLConnection(HttpRequestHandler.java:277)
at com.install4j.runtime.installer.helper.content.HttpRequestHandler.connect(HttpRequestHandler.java:124)
at com.install4j.runtime.installer.helper.content.Downloader.connect(Downloader.java:151)
at com.install4j.runtime.installer.helper.content.Downloader.connect(Downloader.java:24)
at com.install4j.runtime.installer.helper.content.HttpRequestHandler.connect(HttpRequestHandler.java:117)
at com.install4j.runtime.installer.helper.content.Downloader.connect(Downloader.java:146)
at com.install4j.runtime.beans.actions.update.CheckForUpdateAction.execute(CheckForUpdateAction.java:35)
at com.install4j.runtime.beans.actions.SystemInstallOrUninstallAction.install(SystemInstallOrUninstallAction.java:29)
at com.install4j.runtime.installer.ContextImpl$9.executeAction(ContextImpl.java:1701)
at com.install4j.runtime.installer.ContextImpl$9.fetchValue(ContextImpl.java:1692)
at com.install4j.runtime.installer.ContextImpl$9.fetchValue(ContextImpl.java:1689)
at com.install4j.runtime.installer.helper.comm.actions.FetchObjectAction.execute(FetchObjectAction.java:14)
at com.install4j.runtime.installer.helper.comm.HelperCommunication.executeActionDirect(HelperCommunication.java:271)
at com.install4j.runtime.installer.helper.comm.HelperCommunication.executeActionInt(HelperCommunication.java:246)
at com.install4j.runtime.installer.helper.comm.HelperCommunication.executeActionChecked(HelperCommunication.java:184)
at com.install4j.runtime.installer.helper.comm.HelperCommunication.fetchObjectChecked(HelperCommunication.java:167)
at com.install4j.runtime.installer.ContextImpl.performActionIntStatic(ContextImpl.java:1689)
at com.install4j.runtime.installer.InstallerContextImpl.performActionInt(InstallerContextImpl.java:159)
at com.install4j.runtime.installer.ContextImpl.performAction(ContextImpl.java:1114)
at com.install4j.runtime.installer.controller.Controller.executeAction(Controller.java:377)
at com.install4j.runtime.installer.controller.Controller.executeActions(Controller.java:343)
at com.install4j.runtime.installer.controller.Controller.handleCommand(Controller.java:204)
at com.install4j.runtime.installer.controller.Controller.handleStartup(Controller.java:125)
at com.install4j.runtime.installer.controller.Controller.start(Controller.java:82)
at com.install4j.runtime.installer.Application.runApplication(Application.java:91)
at com.install4j.runtime.installer.Application.main(Application.java:51)
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.exe4j.runtime.LauncherEngine.launch(LauncherEngine.java:81)
at com.exe4j.runtime.WinLauncher.main(WinLauncher.java:94)
at com.install4j.runtime.launcher.WinLauncher.main(WinLauncher.java:25)
Locked ownable synchronizers:
- None
"VM Thread" prio=10 tid=0x01f7ec00 nid=0x25cc runnable
"VM Periodic Task Thread" prio=10 tid=0x01fff000 nid=0x3f00 waiting on condition
JNI global references: 409
编辑2: 下面是我没有将任何代理详细信息作为后台更新下载程序的参数传递但是代理在Windows 10以及我的默认浏览器(Google Chrome)中配置时的日志:
[INFO] logger started at Tue Oct 24 02:00:00 IST 2017
[INFO] executable name: C:\Program Files (x86)\Greytip Astra\.install4j\bgupdater.exe
[INFO] install4j version: 7.0.3 (build 7072)
[INFO] Properties:
-- listing properties --
install4j.shutdownFile=C:\WINDOWS\TEMP\i4jshd687484241557081...
java.runtime.name=Java(TM) SE Runtime Environment
exe4j.moduleName=C:\Program Files (x86)\Greytip Astra\...
sun.boot.library.path=c:\program files (x86)\greytip astra\...
exe4j.semaphoreName=Local\c:_program_files_(x86)_greytip_...
java.vm.version=24.80-b11
install4j.fromService=false
java.vm.vendor=Oracle Corporation
java.vendor.url=http://java.oracle.com/
path.separator=;
exe4j.consoleCodepage=cp0
java.vm.name=Java HotSpot(TM) Client VM
file.encoding.pkg=sun.io
user.script=
user.country=US
sun.os.patch.level=
install4j.exeDir=C:\Program Files (x86)\Greytip Astra\...
java.vm.specification.name=Java Virtual Machine Specification
user.dir=C:\Program Files (x86)\Greytip Astra
java.runtime.version=1.7.0_80-b15
java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment
java.endorsed.dirs=c:\program files (x86)\greytip astra\...
os.arch=x86
java.io.tmpdir=C:\WINDOWS\TEMP\
line.separator=
java.vm.specification.vendor=Oracle Corporation
user.variant=
exe4j.tempDir=
os.name=Windows NT (unknown)
sun.jnu.encoding=Cp1252
java.library.path=C:\Program Files (x86)\Greytip Astra\...
install4j.launcherId=626
java.specification.name=Java Platform API Specification
java.class.version=51.0
sun.management.compiler=HotSpot Client Compiler
exe4j.isInstall4j=true
os.version=10.0
install4j.swt=false
user.home=C:\Windows\System32\config\systemprofile
user.timezone=Asia/Calcutta
java.awt.printerjob=sun.awt.windows.WPrinterJob
java.specification.version=1.7
file.encoding=Cp1252
user.name=ABHISHEK-PC$
java.class.path=C:\Program Files (x86)\Greytip Astra\...
java.vm.specification.version=1.7
sun.arch.data.model=32
java.home=c:\program files (x86)\greytip astra\jre
sun.java.command=C:\Program Files (x86)\Greytip Astra\...
exe4j.launchName=C:\PROGRA~2\GREYTI~1\INSTAL~1\BGUPDA~...
java.specification.vendor=Oracle Corporation
user.language=en
awt.toolkit=sun.awt.windows.WToolkit
java.vm.info=mixed mode, sharing
exe4j.unextractedPosition=0
java.version=1.7.0_80
java.ext.dirs=c:\program files (x86)\greytip astra\...
sun.boot.class.path=c:\program files (x86)\greytip astra\...
java.vendor=Oracle Corporation
install4j.appDir=C:\Program Files (x86)\Greytip Astra\
file.separator=\
java.vendor.url.bug=http://bugreport.sun.com/bugreport/
apple.awt.UIElement=true
sun.cpu.endian=little
sun.io.unicode.encoding=UnicodeLittle
install4j.alternativeLogfile=E:/install4j-log/bgupdater.txt
install4j.keepLog=true
sun.desktop=windows
sun.cpu.isalist=pentium_pro+mmx pentium_pro pentium+m...
[INFO] Variable changed: sys.resolveUserSpecificInstallationDir=false[class java.lang.String]
[INFO] com.install4j.runtime.beans.actions.control.RunScriptAction [ID 628]: Execute action
Property rollbackScript: null
Property script: com.install4j.script.I4jScript_Internal_237
Property rollbackSupported: false
Execute action successful after 9 ms
[INFO] com.install4j.runtime.beans.actions.update.CheckForUpdateAction [ID 629]: Execute action
Property connectTimeout: 10000
Property connectionFailureScript: null
Property readTimeout: 20000
Property requestHeaders: []
Property url: http://gt-test-asca-release.s3.ap-south-1.amazonaws.com/updates.xml
Property variable: updateDescriptor
Property acceptAllCertificates: false
Property askForProxy: true
Property rollbackSupported: false
Property showError: true
[ERROR] com.install4j.runtime.beans.actions.update.CheckForUpdateAction [ID 629]: could not download file
java.net.SocketTimeoutException: connect timed out
java.net.SocketTimeoutException: connect timed out
at java.net.DualStackPlainSocketImpl.waitForConnect(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 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 Source)
at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
at com.install4j.runtime.installer.helper.content.HttpRequestHandler.getURLConnection(HttpRequestHandler.java:258)
at com.install4j.runtime.installer.helper.content.HttpRequestHandler.connect(HttpRequestHandler.java:124)
at com.install4j.runtime.installer.helper.content.Downloader.connect(Downloader.java:151)
at com.install4j.runtime.installer.helper.content.Downloader.connect(Downloader.java:24)
at com.install4j.runtime.installer.helper.content.HttpRequestHandler.connect(HttpRequestHandler.java:117)
at com.install4j.runtime.installer.helper.content.Downloader.connect(Downloader.java:146)
at com.install4j.runtime.beans.actions.update.CheckForUpdateAction.execute(CheckForUpdateAction.java:35)
at com.install4j.runtime.beans.actions.SystemInstallOrUninstallAction.install(SystemInstallOrUninstallAction.java:29)
at com.install4j.runtime.installer.ContextImpl$9.executeAction(ContextImpl.java:1701)
at com.install4j.runtime.installer.ContextImpl$9.fetchValue(ContextImpl.java:1692)
at com.install4j.runtime.installer.ContextImpl$9.fetchValue(ContextImpl.java:1689)
at com.install4j.runtime.installer.helper.comm.actions.FetchObjectAction.execute(FetchObjectAction.java:14)
at com.install4j.runtime.installer.helper.comm.HelperCommunication.executeActionDirect(HelperCommunication.java:271)
at com.install4j.runtime.installer.helper.comm.HelperCommunication.executeActionInt(HelperCommunication.java:246)
at com.install4j.runtime.installer.helper.comm.HelperCommunication.executeActionChecked(HelperCommunication.java:184)
at com.install4j.runtime.installer.helper.comm.HelperCommunication.fetchObjectChecked(HelperCommunication.java:167)
at com.install4j.runtime.installer.ContextImpl.performActionIntStatic(ContextImpl.java:1689)
at com.install4j.runtime.installer.InstallerContextImpl.performActionInt(InstallerContextImpl.java:159)
at com.install4j.runtime.installer.ContextImpl.performAction(ContextImpl.java:1114)
at com.install4j.runtime.installer.controller.Controller.executeAction(Controller.java:377)
at com.install4j.runtime.installer.controller.Controller.executeActions(Controller.java:343)
at com.install4j.runtime.installer.controller.Controller.handleCommand(Controller.java:204)
at com.install4j.runtime.installer.controller.Controller.handleStartup(Controller.java:125)
at com.install4j.runtime.installer.controller.Controller.start(Controller.java:82)
at com.install4j.runtime.installer.Application.runApplication(Application.java:91)
at com.install4j.runtime.installer.Application.main(Application.java:51)
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.exe4j.runtime.LauncherEngine.launch(LauncherEngine.java:81)
at com.exe4j.runtime.WinLauncher.main(WinLauncher.java:94)
at com.install4j.runtime.launcher.WinLauncher.main(WinLauncher.java:25)
Execute action not successful after 10173 ms
[INFO] Canceled
编辑3:
我在下面的代码中添加了-Djava.net.useSystemProxies=true
但是获得了与 EDIT 2 相同的日志。以下是代码段:
ApplicationLauncher.launchApplication("626", new String[]{"-Dinstall4j.keepLog=true","-Dinstall4j.alternativeLogfile=E:/install4j-log/bgupdater.txt","-Djava.net.useSystemProxies=true"}, false, new ApplicationLauncher.Callback() {
关于系统代理和代理凭据,我在下面添加了它的快照:
系统代理:
代理凭据: