简体   繁体   English

使用加载依赖的罐子 <applet> 要么 <object> 标签

[英]loading dependent jars using <applet> or <object> tag

I am here with a peculiar problem while loading applets. 加载小程序时,我遇到了一个特殊的问题。 My applet is dependent on 2 jar files, so I am using "cache-archive" and "archive" param tags to point to jars. 我的applet依赖于2个jar文件,因此我使用“ cache-archive”和“ archive” param标签指向jar。

Say my applet is embedded in a.jar and is dependent on dep1.jar(size in KB only) & dep2.jar(size 3MB) respectively. 假设我的applet嵌入在a.jar中,分别依赖于dep1.jar(仅KB大小)和dep2.jar(3MB大小)。 While loading my applet a.jar, dep1.jar loaded successfully but dep2.jar failed to load and throws ClassNotFoundException. 加载我的applet a.jar时,dep1.jar成功加载,但dep2.jar加载失败并引发ClassNotFoundException。

When I tried to load a sample applet jar with no dependent jars, I am able to load the applet successfully with both as well as tags. 当我尝试加载不包含相关jar的示例applet jar时,我能够同时使用标签和标签成功加载applet。

Now comes the interesting part, applet load failure happens only when JAVA PLUGIN CONTROL has the setting "caching enabled" ONLY. 现在来了有趣的部分,只有在JAVA PLUGIN CONTROL设置了“启用缓存”的情况下,才发生applet加载失败。 If caching is disabled, then applet is getting loaded without any issues. 如果禁用了缓存,则将加载applet,而不会出现任何问题。

I hope you got the problem by this time, I am trying to programmatically delete the java plugin cache and load the jars afresh, as I cannot go and say my users to delete the java plugin cache manually. 我希望您这次能解决这个问题,我正试图以编程方式删除Java插件缓存并重新加载jar,因为我不能说用户要手动删除Java插件缓存。

Question: Is there any way to programmatically delete the java plugin control cache. 问题:有什么方法可以以编程方式删除java插件控件缓存。 And also can any one let me know why dep2.jar fails to load when java plugin control settings enabled to cache the resources. 而且还可以让我知道为什么在启用Java插件控件设置以缓存资源时为什么dep2.jar无法加载。

Appreciation inadvance. 欣赏不足。

As far as I know, there is no way to modify the client's file cache from your application. 据我所知,无法从您的应用程序修改客户端的文件缓存。 Also, it sounds like you are running into versioning issues with the cache. 另外,听起来您正在遇到缓存的版本控制问题。 To combat this, you need to ensure your JNLP and associated jars are using proper versioning techniques. 为了解决这个问题,您需要确保您的JNLP和关联的jar使用正确的版本控制技术。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM