意外异常:java.lang.reflect.InvocationTargetException
异常:
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)
at com.sun.javaws.Launcher.executeApplication(Unknown Source)
at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
at com.sun.javaws.Launcher.continueLaunch(Unknown Source)
at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
at com.sun.javaws.Launcher.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: org/jdesktop/layout/GroupLayout$Group
at Main.main(Main.java:26)
... 11 more在Main.java的第26行,只有这个语句啊( new NewJFrame()).setVisible(true);单独运行程序是没有问题的,不知道用web start运行怎么出问题了.程序的jnlp文件如下
<jnlp spec="1.0+" codebase="http://wga:8080/test/" href="http://wga:8080/test/ceshi.jnlp">
<information>
<title>ceshi</title>
<vendor>kop</vendor>
<homepage href="http://aaa:8080"/>
<description>ceshi</description>
<description kind="short">A ceshi demo </description>
<offline-allowed/>
</information>
<resources>
<j2se version="1.5+"/>
<jar href="http://aaa:8080/test/ceshi.jar" download="eager" main="false"/>
</resources>
<application-desc main-class="ceshi.Main"/>
</jnlp>
异常:
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)
at com.sun.javaws.Launcher.executeApplication(Unknown Source)
at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
at com.sun.javaws.Launcher.continueLaunch(Unknown Source)
at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
at com.sun.javaws.Launcher.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: org/jdesktop/layout/GroupLayout$Group
at Main.main(Main.java:26)
... 11 more在Main.java的第26行,只有这个语句啊( new NewJFrame()).setVisible(true);单独运行程序是没有问题的,不知道用web start运行怎么出问题了.程序的jnlp文件如下
<jnlp spec="1.0+" codebase="http://wga:8080/test/" href="http://wga:8080/test/ceshi.jnlp">
<information>
<title>ceshi</title>
<vendor>kop</vendor>
<homepage href="http://aaa:8080"/>
<description>ceshi</description>
<description kind="short">A ceshi demo </description>
<offline-allowed/>
</information>
<resources>
<j2se version="1.5+"/>
<jar href="http://aaa:8080/test/ceshi.jar" download="eager" main="false"/>
</resources>
<application-desc main-class="ceshi.Main"/>
</jnlp>
大哥, newFrame是我写的一个类,是用netbean向导生成的JFrame,俺只是把名字改成newFrame而已.
TO gtlang78() ( ) :
大哥,我照你说的做了.没有效果. 事情是这样的,最开始的public static void main(String[] args) 函数中,我是直接写:( new NewJFrame()).setVisible(true);这样直接在netbean中运行或是单击ceshi.jar运行都木问题.就是用web start时候出现意外异常.后来,我改写main函数,如下:
public static void main(String[] args)
{
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
:( new NewJFrame()).setVisible(true);
}
});
}
这回好了,没有再报错,就是啥都没有.窗口也没出来.查进程,发现多了javaw.exe,嗨,烦人那.