Bryan,

  Thanks for the quick response. Yes I thought it quite strange myself. I was 
trying to debug a processor rather than any bootstrap process. I am pretty sure 
I was connected to the correct process. I did not see any additional java 
processes (other than my IDE) and when I disconnected I saw output in NiFi 
indicating that it was listening to for connections on 8187.


  This morning I tried to reproduce everything I had done yesterday and it 
works using either my port or the original port regardless of whether I suspend 
the process on start up or not. Basically, it all works as expected this 
morning.


  I don't have an explanation for the change in behavior. Yesterday I did 
restart my IDE (NetBeans) but that did not seem to make any difference. This 
morning I did not restart anything (just put my laptop to sleep last night) and 
it all seems to work.


  I apologize for submitting before I tested it again this morning. And I 
sincerely appreciate the help.


tim





________________________________
From: Bryan Rosander <[email protected]>
Sent: Thursday, April 27, 2017 1:22:24 AM
To: [email protected]
Subject: Re: Issues with debugging

Hey Tim,

That's pretty strange that your breakpoints aren't being hit.  In the past when 
things like that have happened to me, it's usually due to me successfully 
connecting but to the wrong JVM.

If you're trying to debug code related to the bootstrap process itself (RunNiFi 
or anything it calls), you'd need to put the debug arg in nifi.sh or nifi.bat 
depending on OS, not in bootstrap.conf.  Our bootstrap process runs in a 
separate JVM from NiFi.

If that isn't the issue, you could run jps  to list all Java processes and be 
sure that only the NiFi instance(s) you expect are running are listed.

If that doesn't show anything unexpected, would you mind setting suspend=y in 
the above property and restarting NiFi?  Having suspend=y will make the NiFi 
JVM wait on a debugger connection before proceeding with startup which would 
rule out things like accidentally connecting to another local NiFi or Java 
process, etc.

Thanks,
Bryan

On Thu, Apr 27, 2017 at 9:11 AM, Tim Zimmerman 
<[email protected]<mailto:[email protected]>> wrote:

Not sure if this is a bug or misunderstanding on my part.


I was trying to enable debugging so that I could troubleshoot a problem. I 
modified bootstrap.conf to enable debugging. I simply uncommented the 
java.arg.debug line and changed the  port to 8187. I was able to attach to the 
process at 8187 but my breakpoints were never hit. If Ieave the address alone, 
set to 8000 it worked as expected.


The following worked as expected: 
java.arg.debug=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000

With address changed to 8187, debugger attached but never stopped on 
breakpoints : 
java.arg.debug=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8187

Input is appreciated.

Thanks,
  tim


Reply via email to