小程序试图从哪里加载一个类?

时间:2011-12-08 17:42:05

标签: java http applet classloader

我正在尝试使用下面的堆栈跟踪(在Java控制台上)调试偶尔会失败的applet。

看起来它正在尝试加载二进制文件并且它正在获得一个不合法的HTTP REDIRECT(可能是因为applet沙箱?)。

有没有办法在Java控制台上打开详细的类加载输出(或其他可能有用的调试)?如果这是一个标准的Java应用程序(而不是applet),我会在命令行中放置“-verbose:class”,看看我得到了什么 - 但我不知道如何使用applet。

我无权访问applet的源代码 - 因此我无法在代码本身中添加任何类型的工具。

  

java.lang.SecurityException:非法URL重定向               at com.sun.deploy.net.HttpUtils.followRedirects(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.cache.DeployCacheHandler.get(Unknown Source)               在sun.net.www.protocol.http.HttpURLConnection.plainConnect(未知   资源)               在sun.net.www.protocol.http.HttpURLConnection.connect(未知来源)               在sun.net.www.protocol.http.HttpURLConnection.getInputStream(未知   资源)               在sun.plugin.PluginURLJarFileCallBack.downloadJAR(未知来源)               at sun.plugin.PluginURLJarFileCallBack.access $ 000(未知来源)               在sun.plugin.PluginURLJarFileCallBack $ 2.run(未知来源)               at java.security.AccessController.doPrivileged(Native Method)               在sun.plugin.PluginURLJarFileCallBack.retrieve(未知来源)               at sun.net.www.protocol.jar.URLJarFile.retrieve(Unknown Source)               在sun.net.www.protocol.jar.URLJarFile.getJarFile(未知来源)               在sun.net.www.protocol.jar.JarFileFactory.get(未知来源)               在sun.net.www.protocol.jar.JarURLConnection.connect(未知来源)               在sun.plugin.net.protocol.jar.CachedJarURLConnection.connect(未知   资源)               at sun.plugin.net.protocol.jar.CachedJarURLConnection.getJarFileInternal(Unknown)   资源)               在sun.plugin.net.protocol.jar.CachedJarURLConnection.getJarFile(未知   资源)               at com.sun.deploy.security.DeployURLClassPath $ JarLoader.getJarFile(Unknown   资源)               在com.sun.deploy.security.DeployURLClassPath $ JarLoader.access $ 800(未知   资源)               在com.sun.deploy.security.DeployURLClassPath $ JarLoader $ 1.run(未知   资源)               at java.security.AccessController.doPrivileged(Native Method)               在com.sun.deploy.security.DeployURLClassPath $ JarLoader.ensureOpen(未知   资源)               在com.sun.deploy.security.DeployURLClassPath $ JarLoader。(未知   资源)               at com.sun.deploy.security.DeployURLClassPath $ 3.run(Unknown Source)               at java.security.AccessController.doPrivileged(Native Method)               at com.sun.deploy.security.DeployURLClassPath.getLoader(Unknown Source)               at com.sun.deploy.security.DeployURLClassPath.getLoader(Unknown Source)               at com.sun.deploy.security.DeployURLClassPath.getResource(Unknown Source)               在sun.plugin2.applet.Plugin2ClassLoader $ 2.run(未知来源)               at java.security.AccessController.doPrivileged(Native Method)               at sun.plugin2.applet.Plugin2ClassLoader.findClassHelper(Unknown Source)               at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)               at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(未知来源)               at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)               at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(未知来源)               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   资源)               at java.lang.Thread.run(Unknown Source)异常:java.lang.SecurityException:非法URL重定向

2 个答案:

答案 0 :(得分:1)

您可以通过转到控制面板,Java,Java,View,然后编辑“运行时参数”,将-verbose:class添加到java的命令行。

答案 1 :(得分:0)

要让您的applet获取源而不是来自其本机主机,您必须对其进行签名;

Here are some helpful tutorials


报告帮助