views:

103

answers:

2

I am creating a j2me application, and when I try to debug it in netbeans, I get an error when I reach a point in my code.

The code is as follows

class MyClass{
    public MyClass()
    {
        OtherClass oc = new OtherClass();
        oc.MyMethod();
    }
}

The other method is as follows:

public void MyMethod()
{
    boolean isValue = true; // I get an exception right here...
    if(...) { /*Code not reached*/ } ...
}

The exception I get looks like this:

java.lang.InternalError: Location with invalid code index
    at com.sun.tools.jdi.ConcreteMethodImpl.codeIndexToLineInfo(ConcreteMethodImpl.java:167)
    at com.sun.tools.jdi.LocationImpl.getBaseLineInfo(LocationImpl.java:108)
    at com.sun.tools.jdi.LocationImpl.getLineInfo(LocationImpl.java:122)
    at com.sun.tools.jdi.LocationImpl.sourcePath(LocationImpl.java:187)
    at com.sun.tools.jdi.LocationImpl.sourcePath(LocationImpl.java:182)
    at org.netbeans.modules.debugger.jpda.models.CallStackFrameImpl.getSourcePath(CallStackFrameImpl.java:238)
    at org.netbeans.modules.debugger.jpda.ui.EditorContextBridge.getRelativePath(EditorContextBridge.java:355)
    at org.netbeans.modules.debugger.jpda.ui.CurrentThreadAnnotationListener$AnnotateCallStackTask.run(CurrentThreadAnnotationListener.java:344)
    at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572)
    at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997)
A: 

I'd try using the newest version of netbeans, out today.

Danra
+1  A: 

Does the JRE used by your emulator match the JDK version you built the code with? Since this is an internal error, either a mismatch has occurred, data corruption (e.g., the JPDA injection), or an actual bug in the JRE.

From the looks of the error, the failure is in trying to find the code line that matches up with the exception. If you turn off JPDA debugging, or run it outside of netbeans, do you get the error?

caskey