[英]java web start is unable to launch on the second run
我編寫了一個基本的Java程序來測試jnlp並從eclipse中導出為可運行的jar,並用jarsigner簽名。
jnlp文件如下
<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0+" codebase="http://192.168.2.15/test" href="test.jnlp">
<information>
<title>test</title>
<vendor>test</vendor>
<homepage href="http://192.168.2.15/test" />
<description>test</description>
</information>
<security>
<all-permissions/>
</security>
<resources>
<j2se version="1.6+" />
<jar href="test.jar" />
</resources>
<application-desc main-class="Test.main">
</application-desc>
</jnlp>
當我使用[javaws http://192.168.2.15/test/test.jnlp]進行測試時,它可以像預期的那樣在首次運行時運行。
當我第二次重試時,Java Web Start無法午餐程序並給出以下錯誤
java.io.IOException: Server returned HTTP response code: 500 for URL: [http://192.168.2.15/test/test.jar] at sun.reflect.GeneratedConstructorAccessor2.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(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(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source) at com.sun.deploy.net.BasicHttpRequest.doRequest(Unknown Source) at com.sun.deploy.net.BasicHttpRequest.doGetRequestEX(Unknown Source) at com.sun.deploy.net.DownloadEngine.isUpdateAvailable(Unknown Source) at com.sun.deploy.net.DownloadEngine.isUpdateAvailable(Unknown Source) at com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(Unknown Source) at com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(Unknown Source) at com.sun.deploy.net.DownloadEngine.getResource(Unknown Source) at com.sun.javaws.LaunchDownload$DownloadTask.call(Unknown Source) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: java.io.IOException: Server returned HTTP response code: 500 for URL: [http://192.168.2.15/test/test.jar] at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source) at java.net.HttpURLConnection.getResponseCode(Unknown Source) ... 13 more
當我通過javaws -uninstall
從緩存中卸載程序並嘗試通過javaws [http://192.168.2.15/test/test.jnlp]運行時,通常它會再次運行於第一次運行,但是當我第二次嘗試時,在上面得到同樣的錯誤。
我的測試平台是Windows 7 Ultimate,並安裝了最新的Java版本。
我是Java新手,找不到問題。 你可以幫幫我嗎?
用JaNeLA檢查我的JNLP文件的結果:
JaNeLA報告-版本11.05.17
報告http://192.168.2.15/sistem/toplanti/test.jnlp
我仍在嘗試解決問題,當我在具有OS作為Windows XP的PC上測試jnlp時,我沒有收到任何錯誤,同一jnlp始終在運行(第一次運行,第二次運行,...)也是我在上進行測試的另一台PC(Windows 7 Professional),並且得到了相同的錯誤,即第一次工作,第二次運行時得到了錯誤...
經過一些測試,我終於解決了我的問題。 我發現它與web.config有關,對於我的應用程序,我正在使用telerik工具,並且web.config中有一行用於壓縮,因此[add name="RadCompression" type="Telerik.Web.UI.RadCompression" preCondition="integratedMode" ]
。 我通過注釋(刪除)此行解決了我的問題。
:)
看起來您正在使用的Web服務器在嘗試訪問URL時返回錯誤500。
如果是這樣,這不是Java WebStart的問題,而是Web服務器的問題。 您如何設置的?
使用JaNeLA檢查JNLP。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.