1

我在终端运行 play(1.2.5) 测试并访问 该页面显示的
localhost/@tests

 Oops: NullPointerException
An unexpected error occured caused by exception NullPointerException:
null

然后在终端中打印以下错误堆栈

Internal Server Error (500) for request GET /@tests

Oops: NullPointerException
An unexpected error occured caused by exception NullPointerException: null

play.exceptions.UnexpectedException: Unexpected Error
    at play.Play.start(Play.java:556)
    at play.Play.detectChanges(Play.java:642)
    at play.Invoker$Invocation.init(Invoker.java:198)
    at Invocation.HTTP Request(Play!)
Caused by: java.lang.NullPointerException
    at play.classloading.ApplicationCompiler$2.acceptResult(ApplicationCompiler.java:266)
    at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:478)
    at play.classloading.ApplicationCompiler.compile(ApplicationCompiler.java:282)
    at play.classloading.ApplicationClassloader.getAllClasses(ApplicationClassloader.java:426)
    at play.Play.start(Play.java:516)
    ... 3 more
4

1 回答 1

2

最后我找到了如何解决这个异常。因为我有一个包含两个类的文件。就像

Foo.java:

public class Foo {}
class Bar{}

然后我把Bar类改写成嵌套类,一切正常!Thoung 我不知道为什么,似乎是由于 eclipse java 编译器的一些错误

于 2013-02-19T02:24:15.133 回答