SocketTimeoutException during signing process

若如初见. 提交于 2019-12-24 00:42:32

问题


We have some trouble with our automated maven build process. From time to time the build is broken by the signing process of install4j. Sometimes it works very well sometimes we get the following exception:

...
[15:51:29] :         [myapp] [INFO]     Compiling launcher 'Standalone updater':
[15:51:29] :         [myapp] [INFO]       replaced variable 'launcher.name' with 'MyApp' in string '${compiler:launcher.name} Update'
[15:51:29] :         [myapp] [INFO]       using icon file D:\BuildAgent7\work\1c0ed506bc73bcb4\target\install4j\resource\updater.ico
[15:51:29] :         [myapp] [INFO]       replaced variable 'sys.fullName' with 'My Application' in string 'Starts the ${compiler:sys.fullName} update'
[15:51:29] :         [myapp] [INFO]       Creating GUI mode application.
[15:51:29] :         [myapp] [INFO]       Signing executable
[15:51:37] :         [myapp] [INFO]   Creating media file: 
[15:51:37] :         [myapp] [INFO]     replaced variable 'launcher.name' with 'MyApp' in string '${compiler:launcher.name} Uninstall'
[15:51:37] :         [myapp] [INFO]     output file is D:\BuildAgent7\temp\buildTmp\install4j374202026546155444_dir\set1\launcheruninstaller\app.ico
[15:51:37] :         [myapp] [INFO]     replaced variable 'sys.fullName' with 'My Application' in string 'Remove the ${compiler:sys.fullName} installation'
[15:51:37] :         [myapp] [INFO]     Creating GUI mode application.
[15:51:37] :         [myapp] [INFO]     Signing executable
[15:51:47] :         [myapp] [INFO] com.a.a.d: error during counter signing
[15:51:47] :         [myapp] [INFO]     at com.install4j.c.b.d.a(ejt:137)
[15:51:47] :         [myapp] [INFO]     at com.install4j.c.b.d.a(ejt:94)
[15:51:47] :         [myapp] [INFO]     at com.install4j.c.b.g.a(ejt:68)
[15:51:47] :         [myapp] [INFO]     at com.install4j.b.g.c.a(ejt:189)
[15:51:47] :         [myapp] [INFO]     at com.install4j.b.g.c.a(ejt:82)
[15:51:47] :         [myapp] [INFO]     at com.install4j.b.g.g.a(ejt:60)
[15:51:47] :         [myapp] [INFO]     at com.install4j.b.b.d(ejt:392)
[15:51:47] :         [myapp] [INFO]     at com.install4j.b.b.c(ejt:360)
[15:51:47] :         [myapp] [INFO]     at com.install4j.b.b.a(ejt:135)
[15:51:47] :         [myapp] [INFO]     at com.install4j.b.h.a(ejt:440)
[15:51:47] :         [myapp] [INFO]     at com.install4j.b.h.a(ejt:214)
[15:51:47] :         [myapp] [INFO]     at com.install4j.b.h.d(ejt:106)
[15:51:47] :         [myapp] [INFO]     at com.install4j.Install4JApplication.c(ejt:436)
[15:51:47] :         [myapp] [INFO]     at com.a.a.a(ejt:286)
[15:51:47] :         [myapp] [INFO]     at com.install4j.Install4JApplication.main(ejt:93)
[15:51:47] :         [myapp] [INFO]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[15:51:47] :         [myapp] [INFO]     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[15:51:47] :         [myapp] [INFO]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[15:51:47] :         [myapp] [INFO]     at java.lang.reflect.Method.invoke(Unknown Source)
[15:51:47] :         [myapp] [INFO]     at com.exe4j.runtime.LauncherEngine.launch(Unknown Source)
[15:51:47] :         [myapp] [INFO]     at com.exe4j.runtime.WinLauncher.main(Unknown Source)
[15:51:47] :         [myapp] [INFO]     at com.install4j.runtime.launcher.WinLauncher.main(Unknown Source)
[15:51:47] :         [myapp] [INFO] Caused by: java.io.IOException: Read timed out
[15:51:47] :         [myapp] [INFO] You can set a different timestamp signing service by setting the VM parameter -Dinstall4j.timestampUrl=http://... in bin/install4j.vmoptions
[15:51:47] :         [myapp] [INFO]     at com.install4j.c.b.d.b(ejt:174)
[15:51:47] :         [myapp] [INFO]     at com.install4j.c.b.d.a(ejt:110)
[15:51:47] :         [myapp] [INFO]     ... 21 more
[15:51:47] :         [myapp] [INFO] Caused by: java.net.SocketTimeoutException: Read timed out
[15:51:47] :         [myapp] [INFO]     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[15:51:47] :         [myapp] [INFO]     at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
[15:51:47] :         [myapp] [INFO]     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
[15:51:47] :         [myapp] [INFO]     at java.lang.reflect.Constructor.newInstance(Unknown Source)
[15:51:47] :         [myapp] [INFO]     at sun.net.www.protocol.http.HttpURLConnection$6.run(Unknown Source)
[15:51:47] :         [myapp] [INFO]     at sun.net.www.protocol.http.HttpURLConnection$6.run(Unknown Source)
[15:51:47] :         [myapp] [INFO]     at java.security.AccessController.doPrivileged(Native Method)
[15:51:47] :         [myapp] [INFO]     at sun.net.www.protocol.http.HttpURLConnection.getChainedException(Unknown Source)
[15:51:47] :         [myapp] [INFO]     at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
[15:51:47] :         [myapp] [INFO]     at com.install4j.runtime.installer.helper.content.Downloader.connect(Unknown Source)
[15:51:47] :         [myapp] [INFO]     at com.install4j.c.b.d.b(ejt:156)
[15:51:47] :         [myapp] [INFO]     ... 22 more
[15:51:47] :         [myapp] [INFO] Caused by: java.net.SocketTimeoutException: Read timed out
[15:51:47] :         [myapp] [INFO]     at java.net.SocketInputStream.socketRead0(Native Method)
[15:51:47] :         [myapp] [INFO]     at java.net.SocketInputStream.read(Unknown Source)
[15:51:47] :         [myapp] [INFO]     at java.net.SocketInputStream.read(Unknown Source)
[15:51:47] :         [myapp] [INFO]     at java.io.BufferedInputStream.fill(Unknown Source)
[15:51:47] :         [myapp] [INFO]     at java.io.BufferedInputStream.read1(Unknown Source)
[15:51:47] :         [myapp] [INFO]     at java.io.BufferedInputStream.read(Unknown Source)
[15:51:47] :         [myapp] [INFO]     at sun.net.www.http.HttpClient.parseHTTPHeader(Unknown Source)
[15:51:47] :         [myapp] [INFO]     at sun.net.www.http.HttpClient.parseHTTP(Unknown Source)
[15:51:47] :         [myapp] [INFO]     at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
[15:51:47] :         [myapp] [INFO]     at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(Unknown Source)
[15:51:47] :         [myapp] [INFO]     at java.net.URLConnection.getHeaderFieldLong(Unknown Source)
[15:51:47] :         [myapp] [INFO]     at java.net.URLConnection.getContentLengthLong(Unknown Source)
[15:51:47] :         [myapp] [INFO]     at java.net.URLConnection.getContentLength(Unknown Source)
[15:51:47] :         [myapp] [INFO]     ... 24 more
[15:51:47] :         [myapp] [INFO] install4j: compilation failed. Reason: error during counter signing
[15:51:47] :         [myapp] [Maven Watcher] 
[15:51:47]E:         [myapp] Failed to execute goal org.sonatype.install4j:install4j-maven-plugin:1.0.5:compile (build-installer) on project myapp: null returned: 1
...

That's a problem to stabilize our continuous build. The SocketTimeoutException leads me to the conclusion of a missing connection to the verisign server. But for the updater there was already a connection during signing execution. Now I am not sure if this may be a problem of our build environment or the signing process of install4j itself. What value is set as the default for the connection timeout? Is it possible to override this value?

For the signing we are using a pfx-file and install4j with version 5.1.12.


回答1:


The read timeout is set to 10000 milliseconds by default. You can increase it by adding the line

-Dinstall4j.readTimeout=20000

to the file bin/install4j.vmoptions in your install4j installation.

Just for reference, there is a similar VM parameter install4j.connectTimeout for the connect timeout, also with a default value of 10000 ms.


Update (2014-11-20):

Since install4j 6.0, a failed counter signature is retried 10 times with a pause of 3 seconds. The maximum number of retries can be increased with the VM parameter

-Dinstall4j.counterSignRetry=20


来源:https://stackoverflow.com/questions/25680587/sockettimeoutexception-during-signing-process

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!