gpt4 book ai didi

java - Lwjgl 小程序加载器崩溃,RuntimeExceptoin : java. lang.Reflect.InitationException

转载 作者:行者123 更新时间:2023-12-01 04:16:02 25 4
gpt4 key购买 nike

我正在尝试运行我的 LWJGL 小程序,但收到这些错误,但不知道这意味着什么。

这是我的文件层次结构的屏幕截图。

File hierarchy

这是我的 html 文件的内容。

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>AppletLoader</title>
</head>
<body>

<applet code="org.lwjgl.util.applet.AppletLoader" archive="lwjgl_util_applet.jar, lzma.jar" codebase="." width="347" height="355">

<!-- The following tags are mandatory -->

<!-- Name of Applet, will be used as name of directory it is saved in, and will uniquely identify it in cache -->
<param name="al_title" value="Sudoku">

<!-- Main Applet Class -->
<param name="al_main" value="sud.main.MainClass">

<!-- logo to paint while loading, will be centered -->
<!--param name="al_logo" value="appletlogo.png">

<!-- progressbar to paint while loading. Will be painted on top of logo, width clipped to percentage done -->
<!--param name="al_progressbar" value="appletprogress.gif">

<!-- List of Jars to add to classpath -->
<param name="al_jars" value="sudoku.jar, lwjgl_applet.jar.pack.lzma, lwjgl.jar.pack.lzma, jinput.jar.pack.lzma, lwjgl_util.jar.pack.lzma, slick.jar">

<!-- signed windows natives jar in a jar -->
<param name="al_windows" value="windows_natives.jar.lzma">

<!-- signed linux natives jar in a jar -->
<param name="al_linux" value="linux_natives.jar.lzma">

<!-- signed mac osx natives jar in a jar -->
<param name="al_mac" value="macosx_natives.jar.lzma">

<!-- signed solaris natives jar in a jar -->
<param name="al_solaris" value="solaris_natives.jar.lzma">

<!-- Tags under here are optional -->

<!-- Version of Applet, important otherwise applet won't be cached, version change will update applet, must be int or float -->
<!-- <param name="al_version" value="0.1"> -->

<!-- whether to use cache - defaults to true -->
<!-- <param name="al_cache" value="true"> -->

<!-- background color to paint with, defaults to white -->
<!-- <param name="boxbgcolor" value="#000000"> -->

<!-- foreground color to paint with, defaults to black -->
<!-- <param name="boxfgcolor" value="#ffffff"> -->

<!-- whether to run in debug mode -->
<!-- <param name="al_debug" value="true"> -->

<!-- whether to prepend host to cache path - defaults to true -->
<!-- <param name="al_prepend_host" value="true"> -->

<!-- main applet specific params -->

<param name="separate_jvm" value="true">
</applet>

<p>
if <code>al_debug</code> is true the applet will load and extract resources with a delay, to be able to see the loader process.
</p>

</body>
</html>

这是它返回的错误。

network: Cache entry not found [url: file:/C:/Users/Rose/Desktop/Applet%20Test/lwjgl_util_applet.jar, version: null]
basic: exception: java.lang.reflect.InvocationTargetException.
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at sun.plugin2.applet.Plugin2ClassLoader.defineClassHelper(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.access$100(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader$2.run(Unknown Source)
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(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.initAppletAdapter(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
... 14 more
Caused by: java.lang.NullPointerException
at sun.plugin2.applet.Plugin2ClassLoader.loadAllowedCodebases(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.getPermissions(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.getPermissions(Unknown Source)
at java.security.SecureClassLoader.getProtectionDomain(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
... 18 more
Ignored exception: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
basic: Dialog type is not candidate for embedding
basic: Removed progress listener: sun.plugin.util.ProgressMonitorAdapter@1cb8654
security: Reset deny session certificate store

有什么需要问的都可以问我。

最佳答案

我们遇到了和你一样的崩溃。切换到使用 JNLP 修复了它:

(1) 为您的小程序创建 JNLP 文件。请参阅http://docs.oracle.com/javase/tutorial/deployment/applet/deployingApplet.html 。如果/当您对小程序进行更改时,您可能需要清除 JNLP 缓存才能使它们生效(在命令行中执行“javaws -uninstall”)。

(2) 更改标记以使用 jnlp_href 标记而不是 archive 和 codebase 标记。将其指向您在 (1) 中创建的 .jnlp 文件。看: http://docs.oracle.com/javase/tutorial/deployment/applet/html.html

这为我们解决了崩溃问题。请注意,在尝试修复崩溃时,我们还更新了 list 文件以使用 Codebase、Application-Library-Allowable-Codebase、Caller-Allowable-Codebase 和 Permissions 字段。但崩溃仍然发生,直到我们改用 JNLP。

关于java - Lwjgl 小程序加载器崩溃,RuntimeExceptoin : java. lang.Reflect.InitationException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19445745/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com