开发者

Runtime error when JUnit testing

I am pretty shaky with Unit testing but I have a part of my code I really need to be certain of its consistency. I am attempting to transfer data from an object to an external file using JSON so I want to make sure when I pull the data from the external file it wi开发者_StackOverflowll be the same.

I am using a Unit test to assert this equality but I am encountering a problem I am not sure how to handle. It is a runtime error and this is what the console reads.

A fatal error has been detected by the Java Runtime Environment:

Internal Error (classFileParser.cpp:3494), pid=5032, tid=7048
Error: ShouldNotReachHere()

JRE version: 6.0_25-b06
Java VM: Java HotSpot(TM) 64-Bit Server VM (20.0-b11 mixed mode windows-amd64 compressed oops)
An error report file with more information is saved as:
L:\fliphouseWorkspace\Luas\hs_err_pid5032.log

If you would like to submit a bug report, please visit:
http://java.sun.com/webapps/bugreport/crash.jsp

Any help would be appreciated thanks.


If you are using Eclipse to develop an Android app, here's another possible explanation: http://independentlyemployed.co.uk/2010/11/17/worked-out-why/. (Apparently, this can also occur if you try / have tried to develop Android and regular Java in the same Eclipse Workspace; see https://stackoverflow.com/a/3223929/139985)

If you are not, then I think that the general problem is that the JVM is falling over while trying to parse (probably load) a class file. The most likely cause seems to be that the class file is mangled in some way. If that's the case, then this is not a JVM bug. The JVM may have no choice but to report this kind of problem via a crash report, because it could happen during JVM bootstrapping.


Here's an entry in the Java Bug Database that reports this: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7032077. Unfortunately, it has been closed as not reproducible.


That's nothing to do with your code, that looks like a genuine JVM bug to me. The JVM should never crash like that. File a bug report with Oracle.


I am assuming you are using android, because most of the people seem to be having issues with android and junit.
I found this blog entry where they discuss the particular issue in the comments section. One of the comments mentions this particular error. You could find some help here. http://dtmilano.blogspot.com/2008/11/android-testing-on-android-platform.html

One of the options suggested is to delete the "bin" and "gen" directory, and try again. ShouldNotReachhere classFileParser ANDROID

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜