2010-07-16 91 views
7

我剛剛從我的用戶那裏得到了這條錯誤消息。 (IE8,Java 1.6.20)。它來自一個從Javascript接收指令並在客戶端執行某些進程的小程序。java.lang.RuntimeException:錯誤:無法恢復損壞的緩存條目

RangeError 
java.lang.RuntimeException: ERROR: Failed to recover corrupt cache entry 
at com.sun.deploy.cache.CacheEntry.recover 
at com.sun.deploy.cache.CacheEntry.getSignerMap 
at com.sun.deploy.cache.CachedJarFile.getSignerMap 
at com.sun.deploy.cache.CachedJarFile.access$100 
.... 

任何iddeas什麼可能導致這種情況?

+0

我有與Java 1.7相同的問題。 – Horcrux7 2011-11-11 11:18:50

+0

與Java 1.6相同的問題,更新29 – 2012-02-01 17:41:56

+0

更多信息:這發生在webstart上,並且清除緩存沒有幫助。另外,它似乎在這裏再次報道:https://forums.oracle.com/forums/thread.jspa?messageID=10114803 – 2012-02-01 17:49:58

回答

0

我在java1.8_0.31上遇到過這個問題,而且我發現迄今爲止唯一的解決方法是將壓縮jar(pack.gz)放到與jar相同的目錄中。當跟蹤的servlet我看到

JnlpDownloadServlet(3): Request: /MyWeb/signed.jnlp 
JnlpDownloadServlet(3): User-Agent: JNLP/1.7.0 javaws/11.31.2.13 (<internal>) Java/1.8.0_31 
JnlpDownloadServlet(4): DownloadRequest[path=/signed.jnlp encoding=gzip isPlatformRequest=false] 
JnlpDownloadServlet(4): Basic Protocol lookup 
JnlpDownloadServlet(4): JnlpResource: JnlpResource[WAR Path: /signed.jnlp lastModified=Wed Feb 11 09:13:42 EET 2015]] 
JnlpDownloadServlet(3): Resource returned: /signed.jnlp 
JnlpDownloadServlet(4): SupportQuery in Href: true 
JnlpDownloadServlet(4): lastModified: 1423638822000 Wed Feb 11 09:13:42 EET 2015 
JnlpDownloadServlet(3): Request: /MyWeb/GUIJars/signed/main.jar?version-id=1.101 
JnlpDownloadServlet(3): User-Agent: JNLP/1.7.0 javaws/11.31.2.13 (<internal>) Java/1.8.0_31 
JnlpDownloadServlet(4): DownloadRequest[path=/GUIJars/signed/main.jar encoding=pack200-gzip,gzip query=version-id=1.101 version=1.101 isPlatformRequest=false] 
JnlpDownloadServlet(4): Version-based/Extension based lookup 
JnlpDownloadServlet(4): JnlpResource: JnlpResource[WAR Path: /GUIJars/signed/main__V1.101.jar versionId=1.101 name=main.jar lastModified=Fri Feb 13 16:28:36 EET 2015] returnVersionId=1.101] 
JnlpDownloadServlet(3): Resource returned: /GUIJars/signed/main__V1.101.jar 
JnlpDownloadServlet(4): Real resource returned: JnlpResource[WAR Path: /GUIJars/signed/main__V1.101.jar versionId=1.101 name=main.jar lastModified=Fri Feb 13 16:28:36 EET 2015] returnVersionId=1.101] 

而在客戶端時,跟蹤日誌表明

network: ResponseCode for http://mydomain.com.tr/MyWeb/GUIJars/signed/main.jar?version-id=1.101 : 200 
network: Encoding for http://mydomain.com.tr/MyWeb/GUIJars/signed/main.jar?version-id=1.101 : gzip 
network: Server response: (length: -1, lastModified: Fri Feb 13 16:28:36 EET 2015, downloadVersion: 1.101, mimeType: application/java-archive) 
network: Created version ID: 1.101 
network: Created version ID: 1.101 
network: Created version ID: 1.101 
network: Cache entry not found [url: http://mydomain.com.tr/MyWeb/GUIJars/signed/main.jar, version: 1.101] 
network: Downloading resource: http://mydomain.com.tr/MyWeb/GUIJars/signed/main.jar?version-id=1.101 
    Content-Length: -1 
    Content-Encoding: gzip 
network: Wrote URL http://mydomain.com.tr/MyWeb/GUIJars/signed/main.jar?version-id=1.101 to File C:\myCache\MyWeb\6.0\33\5a0dab21-647c684d-1.101--temp 
network: Disconnect connection to http://mydomain.com.tr/MyWeb/GUIJars/signed/main.jar?version-id=1.101 
network: Cache: Enable a new CacheEntry: http://mydomain.com.tr/MyWeb/GUIJars/signed/main.jar 
network: Downloaded http://mydomain.com.tr/MyWeb/GUIJars/signed/main.jar: C:\myCache\MyWeb\6.0\33\5a0dab21-647c684d-1.101- 
cache: Adding MemoryCache entry: http://mydomain.com.tr/MyWeb/GUIJars/signed/main.jar 
java.util.zip.ZipException: error in opening zip file 
    at java.util.zip.ZipFile.open(Native Method) 
    at java.util.zip.ZipFile.<init>(Unknown Source) 
    at java.util.zip.ZipFile.<init>(Unknown Source) 
    at java.util.jar.JarFile.<init>(Unknown Source) 
    at java.util.jar.JarFile.<init>(Unknown Source) 
    at com.sun.deploy.security.EnhancedJarVerifier.validate(Unknown Source) 
    at com.sun.deploy.cache.CacheEntry.getJarSigningData(Unknown Source) 
    at com.sun.deploy.cache.CacheEntry.getCodeSigners(Unknown Source) 
    at com.sun.deploy.ref.CodeRef.getCodeSigners(Unknown Source) 
    at com.sun.deploy.security.ruleset.RuleId.contains(Unknown Source) 
    at com.sun.deploy.security.ruleset.DRSHelper.findRule(Unknown Source) 
    at com.sun.deploy.security.ruleset.DeploymentRuleSet.getDRS(Unknown Source) 
    at com.sun.deploy.security.ruleset.DeploymentRuleSet.findDRS(Unknown Source) 
    at com.sun.javaws.jnl.LaunchDesc.getMainDeploymentRuleSet(Unknown Source) 
    at com.sun.javaws.jnl.LaunchDesc.getMatchImpl(Unknown Source) 
    at com.sun.javaws.jnl.LaunchDesc.getJREMatcher(Unknown Source) 
    at com.sun.javaws.Launcher.prepareLaunchFile(Unknown Source) 
    at com.sun.javaws.Launcher.prepareAllResources(Unknown Source) 
    at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source) 
    at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source) 
    at com.sun.javaws.Launcher.launch(Unknown Source) 
    at com.sun.javaws.Main.launchApp(Unknown Source) 
    at com.sun.javaws.Main.continueInSecureThread(Unknown Source) 
    at com.sun.javaws.Main.access$000(Unknown Source) 
    at com.sun.javaws.Main$1.run(Unknown Source) 
    at java.lang.Thread.run(Unknown Source) 
cache: Trying to recover cache entry for http://mydomain.com.tr/MyWeb/GUIJars/signed/main.jar 
cache: MemoryCache: removed entry http://mydomain.com.tr/MyWeb/GUIJars/signed/main.jar 
network: Remove cache entry: http://mydomain.com.tr/MyWeb/GUIJars/signed/main.jar 
network: Cache entry not found [url: http://mydomain.com.tr/MyWeb/GUIJars/signed/main.jar, version: 1.101] 
java.lang.RuntimeException: ERROR: Recovery got null entry 
    at com.sun.deploy.cache.CacheEntry.recover(Unknown Source) 
    at com.sun.deploy.cache.CacheEntry.getJarSigningData(Unknown Source) 
    at com.sun.deploy.cache.CacheEntry.getCodeSigners(Unknown Source) 
    at com.sun.deploy.ref.CodeRef.getCodeSigners(Unknown Source) 
    at com.sun.deploy.security.ruleset.RuleId.contains(Unknown Source) 
    at com.sun.deploy.security.ruleset.DRSHelper.findRule(Unknown Source) 
    at com.sun.deploy.security.ruleset.DeploymentRuleSet.getDRS(Unknown Source) 
    at com.sun.deploy.security.ruleset.DeploymentRuleSet.findDRS(Unknown Source) 
    at com.sun.javaws.jnl.LaunchDesc.getMainDeploymentRuleSet(Unknown Source) 
    at com.sun.javaws.jnl.LaunchDesc.getMatchImpl(Unknown Source) 
    at com.sun.javaws.jnl.LaunchDesc.getJREMatcher(Unknown Source) 
    at com.sun.javaws.Launcher.prepareLaunchFile(Unknown Source) 
    at com.sun.javaws.Launcher.prepareAllResources(Unknown Source) 
    at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source) 
    at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source) 
    at com.sun.javaws.Launcher.launch(Unknown Source) 
    at com.sun.javaws.Main.launchApp(Unknown Source) 
    at com.sun.javaws.Main.continueInSecureThread(Unknown Source) 
    at com.sun.javaws.Main.access$000(Unknown Source) 
    at com.sun.javaws.Main$1.run(Unknown Source) 
    at java.lang.Thread.run(Unknown Source) 

客戶行爲會來臨普通JAR文件打包和gziped罐子。也許需要檢查HTTP標頭爲什麼客戶端這樣做。

+0

第二種解決方案是,在我們的情況下,我們不使用JnlpDownloadServlet和HTTP服務器(IBM HTTP SERVER)將gzip應用於純JAR文件。我們配置「不要將gzip應用於jar請求」並且問題消失了。 – mbsau 2015-02-18 09:59:28

+0

就我而言,Apache服務於jar文件。 SetOutputFilter DEFLATE包含在Apache conf文件中。向該過濾器添加一個異常(SetEnvIfNoCase Request_URI \ .jar $ no-gzip dont-vary)修復了我的問題。 – lOlive 2018-02-07 22:07:01