简体   繁体   中英

Unable to hit a break point inside a function in Java

I am running my eclipse project in a remote server using maven build. I have set a couple of break points in some of the java files to check the control flow of the code. I am unable to reach the break point inside a function implementation block. I have two break points in a java file like the one shown below:

.) public List<classType> functionName(args) throws someException{

.) System.out.println("You should stop here");

//try{
//some more code}
//catch{}

} 

The two .) represents the break points I have set. The system stops at the first one but not at the second. I don't really understand what I am missing here. Looks like the system reaches the block and also performs the desired function, but just does not stop at the break point.

PS: I execute the project in command prompt by giving mvn install command and turn on the debug mode to look for the flow.

Usually, failure to hit a remote breakpoint means that the compiled code on the remote system is not exactly the same version as the source code you are seeing in your Eclipse session. Breakpoints are set by line number and if the line numbers don't match the breakpoint could point to a line number that is not executable (ie not a candidate for a breakpoint) on the remote system. In that case the breakpoint would not be set and would appear to be skipped.

You must ensure that the code running on the remote was compiled from exactly the same source as you are seeing in your local Eclipse.

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