【问题标题】:Applet fails to reload after page refresh or after navigating to same page, getting classNotFoundException second time (after page refresh)页面刷新后或导航到同一页面后,Applet 无法重新加载,第二次获取 classNotFoundException(页面刷新后)
【发布时间】:2013-02-12 21:53:07
【问题描述】:

Applet 第一次加载并成功运行,但是当我们离开页面时 并再次尝试导航到同一页面获取类未找到异常。

使用 jnlp

exception: JNLP file error: applet-test-applet.jnlp. Please make sure the file exists and check if "codebase" and "href" in the JNLP file are correct..
java.io.FileNotFoundException: JNLP file error: applet-test-applet.jnlp. Please make sure the file exists and check if "codebase" and "href" in the JNLP file are correct.
    at sun.plugin2.applet.JNLP2Manager.loadJarFiles(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Exception: java.io.FileNotFoundException: JNLP file error: applet-test-applet.jnlp. Please make sure the file exists and check if "codebase" and "href" in the JNLP file are correct.

使用罐子

load: class com.*.*.uidai.auth.*.class not found.
java.lang.ClassNotFoundException: com.*.cpos.uidai.auth.*.class
    at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Exception: java.lang.ClassNotFoundException: 

请提供解决方案

【问题讨论】:

  • 今天早上我的小程序也遇到了同样的问题。

标签: java jar applet japplet


【解决方案1】:

我遇到了同样的问题,但在我的情况下是关于从 location.href 中捕获 URL。 使用 JSF 时,第一次访问并没有带来真正的页面 URL,但巧合的是,小程序就在那里。第二次点击后,会显示真实的页面URL,并且找不到applet jar。 我通过放置一个相对于基本 URL 的固定 jar 位置来解决,而不是当前页面的位置。

【讨论】:

    猜你喜欢
    • 2011-10-22
    • 1970-01-01
    • 2013-12-25
    • 1970-01-01
    • 2014-10-04
    • 1970-01-01
    • 2020-11-08
    • 1970-01-01
    • 2012-11-23
    相关资源
    最近更新 更多