English 中文(简体)
a. 使用“强硬” NetBeans6.9的试验
原标题:A ClassFormatError using StrutsTestCase on NetBeans6.9

我试图利用Stuts 试验Case,利用Stuts 1.3.8框架,对我的java申请进行单位测试。 然而,令人感到非常不安的是,在我撰写测试班并试图操作时,就会出现错误。 错误信息如下。

当我打开HttpServletRequestWrapper这一级时,我感到非常困惑的是,在建筑方法下有一条红线。 我将Java-EE-glassfish-v3作为斜体,当我将其改为Java E6时,情况仍然相同。

我使用Stuts 1.3.8和Stuts 试验Case 2.1.4,我的教育和发展研究所是Net Beans 6.9,操作系统是Fedora 14(Java jdk是开放JDK)。 我没有说明为何出现这一错误。 如果有人能给我任何帮助,我会真心感激。

这里有Net Beans的错误:

Absent Code attribute in method that is not native or abstract in class file javax/servlet/http/HttpServletRequestWrapper java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/servlet/http/HttpServletRequestWrapper at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:634) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:277) at java.net.URLClassLoader.access$000(URLClassLoader.java:73) at java.net.URLClassLoader$1.run(URLClassLoader.java:212) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:205) at java.lang.ClassLoader.loadClass(ClassLoader.java:321) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294) at java.lang.ClassLoader.loadClass(ClassLoader.java:266) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:186)

    at java.lang.ClassLoader.defineClass(ClassLoader.java:634)

我的感谢。

问题回答

Have you defined your main function?
You may try this:

public static void main(String[] args) {
    junit.textui.TestRunner.run(LoginActionTest.class);
}

希望能够帮助你们。

看像一个版本的不匹配。 背书版和折中法文本应相同。





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签