0

我在使用 Java Web Start 运行我的 java 应用程序时遇到了这个错误。尽管应用程序在 Eclipse 中运行得非常好,并且应用程序也在 Java Web 启动中正确加载。该代码正在尝试打开文件选择器,但无法执行此操作。

Exception in thread "AWT-EventQueue-0" java.lang.AssertionError
    at sun.awt.shell.Win32ShellFolder2$4.call(Unknown Source)
    at sun.awt.shell.Win32ShellFolder2$4.call(Unknown Source)
    at sun.awt.shell.Win32ShellFolderManager2$ComInvoker.invoke(Unknown Source)
    at sun.awt.shell.ShellFolder.invoke(Unknown Source)
    at sun.awt.shell.Win32ShellFolder2.getIShellFolder(Unknown Source)
    at sun.awt.shell.Win32ShellFolder2.access$200(Unknown Source)
    at sun.awt.shell.Win32ShellFolder2$2.call(Unknown Source)
    at sun.awt.shell.Win32ShellFolder2$2.call(Unknown Source)
    at sun.awt.shell.Win32ShellFolderManager2$ComInvoker.invoke(Unknown Source)
    at sun.awt.shell.ShellFolder.invoke(Unknown Source)
    at sun.awt.shell.Win32ShellFolder2.<init>(Unknown Source)
    at sun.awt.shell.Win32ShellFolderManager2.createShellFolderFromRelativePIDL(Unknown Source)
    at sun.awt.shell.Win32ShellFolder2$11.call(Unknown Source)
    at sun.awt.shell.Win32ShellFolder2$11.call(Unknown Source)
    at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at sun.awt.shell.Win32ShellFolderManager2$ComInvoker$3.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
4

2 回答 2

2

好的,所以我刚刚找到了我自己问题的答案。我已经禁用了 JNLP 文件中的断言,并且代码开始工作得很好。

我改变了

<j2se version="1.5+" java-vm-args="-esa -Xnoclassgc"/>

<j2se version="1.5+" java-vm-args="-dsa -Xnoclassgc"/>

希望这对其他人也有帮助。

于 2012-09-30T04:32:37.683 回答
2

看看那个类的源代码。只有 2assert条语句,它们都出现在匿名类中。因此它们与您的堆栈跟踪完美匹配

assert(isDirectory());
assert(parent != null);

不要禁用这些断言,只需检查为什么不满足这些条件并修复它。

于 2012-09-30T07:57:37.087 回答