2

My Netbeans debugger mysteriously stopped working a couple days ago and I don't recall making any serious changes.

The oddest part is that if I choose to run the project, it correctly passes my arguments and runs the program. Also note that this is for every netbeans project, even ones that previously were debuggable three days ago.

Here is the basic rundown

  • I set a breakpoint on the first line in main (and yes, I am sure that the program should be getting to that line).
  • I hit debug
  • The debugger does not stop at my breakpoint and says the program completed successfully, even if it should have thrown an ArrayOutOfBoundsException.

I have tried restarting my JVM, restarting Netbeans, restarting my VM, to no avail.

The eclipse debugger, on the other hand, does work which tells me it is not something with my java distro but rather with Netbeans.

My nbactions file

<action>
    <actionName>run</actionName>
    <packagings>
        <packaging>jar</packaging>
    </packagings>
    <goals>
        <goal>process-classes</goal>
        <goal>org.codehaus.mojo:exec-maven-plugin:1.2.1:exec</goal>
    </goals>
    <properties>
        <exec.args>-classpath %classpath GlobalFunctions 13392</exec.args>
        <exec.executable>java</exec.executable>
    </properties>
</action>
<action>
    <actionName>debug</actionName>
    <packagings>
        <packaging>jar</packaging>
    </packagings>
    <goals>
        <goal>process-classes</goal>
        <goal>org.codehaus.mojo:exec-maven-plugin:1.2.1:exec</goal>
    </goals>
    <properties>
        <exec.args>-Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address} -classpath %classpath GlobalFunctions 13392 </exec.args>
        <exec.executable>java</exec.executable>
        <jpda.listen>true</jpda.listen>
    </properties>
</action>

I've done some checking an it seems like most issues similar to this arise when debugging PHP. This is not the case as I am developing Java.

I know I can simply reinstall Netbeans, but I'd like to find out why this is happening.

3
  • This has happened to me before (I had the same class defined in multiple places on the classpath). If you create a new project with no dependenices and a single class, does this problem still occur? Commented Dec 10, 2013 at 23:20
  • Yup, just tried creating a new project, Test with main class Test, put a single string creation in the main method and slapped a breakpoint on it to no avail :( Commented Dec 11, 2013 at 3:07
  • Shoot. I don't know much about the nbactions file (or maven for that matter) but I know it's possible to run individual targets from your build.xml or build-impl.xml files (and define "precondition" targets in build.xml). Separately, I know from experience that NetBeans can get confused if your source tree contains a "nbproject" folder. Commented Dec 11, 2013 at 20:40

1 Answer 1

1

After closing a Hadoop project that had 8 or so classes with main methods, this bug was resolved. Perhaps netbeans doesn't know which main class to use in projects that have too many?

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.