简体   繁体   中英

Netbeans debugger not stopping on breakpoints

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.

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?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM