You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@nifi.apache.org by Darren Govoni <da...@ontrenet.com> on 2020/10/26 15:52:35 UTC

Run Nifi in IntelliJ to debug?

Hi
   Is it possible to run Nifi from inside IntelliJ with debugging such that I can hit the app from my browser and trigger breakpoints?

If anyone has done this can you please share any info?

Thanks in advance!
Darren

Sent from my Verizon, Samsung Galaxy smartphone
Get Outlook for Android<https://aka.ms/ghei36>

Re: Run Nifi in IntelliJ to debug?

Posted by Darren Govoni <da...@ontrenet.com>.
That did the trick! Thank you for everyones input and if i missed an obvious suggestion along the way my regrets.

Should be good now!

Sent from my Verizon, Samsung Galaxy smartphone
Get Outlook for Android<https://aka.ms/ghei36>

________________________________
From: Bryan Bende <bb...@gmail.com>
Sent: Tuesday, October 27, 2020 12:30:31 PM
To: users@nifi.apache.org <us...@nifi.apache.org>
Subject: Re: Run Nifi in IntelliJ to debug?

I haven't fully read this thread, but there is already a line in
nifi's bootstrap.conf that you can uncomment:

# Enable Remote Debugging
#java.arg.debug=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000

Change the port if desired, and then create a Remote Debug
configuration in IntelliJ for that port.

This will debug the main application, not bootstrap.

On Tue, Oct 27, 2020 at 12:08 PM Darren Govoni <da...@ontrenet.com> wrote:
>
> Hello,
>    So i was able to get intelliJ to debug nifi but only inside the bootstrap process. It looks like nifi spawns a new process and that process does not run the debug options.
>
> Is there a way to instruct nifi to enable debug port on its main process? That will have the actual app code i need to trace.
>
> Thanks for any tips. Much appreciated!
> Darren
>
> Sent from my Verizon, Samsung Galaxy smartphone
> Get Outlook for Android
>
> ________________________________
> From: Mike Thomsen <mi...@gmail.com>
> Sent: Monday, October 26, 2020 10:15:33 PM
> To: users@nifi.apache.org <us...@nifi.apache.org>
> Subject: Re: Run Nifi in IntelliJ to debug?
>
> Are you using a binary derived from the source code in your IDE? Like
> a 1.12.1 binary and the source code from the release?
>
> On Mon, Oct 26, 2020 at 7:47 PM Russell Bateman <ru...@windofkeltia.com> wrote:
> >
> > Hmmm... It's rare that I debug NiFi code. And it's also rare that I debug my own in that context since the NiFi test runner allows me to fend off most surprises via my JUnit tests.
> >
> > I think back in 2016, I was debugging a start-up problem involving NiFi start-up and incompatibility with the Java Flight Recorder. As I recall, I downloaded the relevant NiFi code sources matching the version of NiFi I was debugging remotely. I remember ultimately making a slight (and only temporary) change to NiFi start-up that fixed the problem. At that point I must have been building my own copy to have seen it fixed.. It had to do with the order in which NiFi was getting command-line arguments making it so the JFR wasn't running. I'd have to dig back to figure out what I was doing, but it's probably not too relevant to what you need to do.
> >
> > What do you need to see in this?
> >
> > Russ
> >
> > On 10/26/20 5:38 PM, Darren Govoni wrote:
> >
> > Correct. Primarily the nifi-web-api module and AccessResource class. For starters.
> >
> > Sent from my Verizon, Samsung Galaxy smartphone
> > Get Outlook for Android
> >
> > ________________________________
> > From: Russell Bateman <ru...@windofkeltia.com>
> > Sent: Monday, October 26, 2020 7:37:13 PM
> > To: Darren Govoni <da...@ontrenet.com>; users@nifi.apache.org <us...@nifi.apache.org>
> > Subject: Re: Run Nifi in IntelliJ to debug?
> >
> > Darren,
> >
> > This is just Apache NiFi code out of NARs you want to step through or is it yours? You haven't stripped debug information or anything, right?
> >
> > Russ
> >
> > On 10/26/20 5:30 PM, Darren Govoni wrote:
> >
> > Kevin/Russel
> >
> > Thanks for the info. I did set things up this way.
> >
> > IntelliJ does connect to the nifi jvm and nifi runs and works but intellij isnt breaking on code it should.
> >
> > I did set the module where the code/classes are located (in the remote connection dialog) and i see the exception im tracking print on the console output but intellij never breaks.
> >
> > Is there an extra step needed? Generate sources?
> >
> > For future it would be nice if there was a maven goal for debug.
> >
> > Much appreciated!
> > Darren
> >
> > Sent from my Verizon, Samsung Galaxy smartphone
> > Get Outlook for Android
> > ________________________________
> > From: Russell Bateman <ru...@windofkeltia.com>
> > Sent: Monday, October 26, 2020 4:09:50 PM
> > To: users@nifi.apache.org <us...@nifi.apache.org>; Darren Govoni <da...@ontrenet.com>
> > Subject: Re: Run Nifi in IntelliJ to debug?
> >
> > Darren,
> >
> > I was out this morning and didn't see your plea until I got in just now. Here's a step by step I wrote up for both IntelliJ IDEA and Eclipse (I'm more an IntelliJ guy). It also covers using an IP tunnel.
> >
> > https://www.javahotchocolate.com/notes/nifi.html#20160323
> >
> > On 10/26/20 9:52 AM, Darren Govoni wrote:
> >
> > Hi
> >    Is it possible to run Nifi from inside IntelliJ with debugging such that I can hit the app from my browser and trigger breakpoints?
> >
> > If anyone has done this can you please share any info?
> >
> > Thanks in advance!
> > Darren
> >
> > Sent from my Verizon, Samsung Galaxy smartphone
> > Get Outlook for Android
> >
> >
> >
> >

Re: Run Nifi in IntelliJ to debug?

Posted by Bryan Bende <bb...@gmail.com>.
I haven't fully read this thread, but there is already a line in
nifi's bootstrap.conf that you can uncomment:

# Enable Remote Debugging
#java.arg.debug=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000

Change the port if desired, and then create a Remote Debug
configuration in IntelliJ for that port.

This will debug the main application, not bootstrap.

On Tue, Oct 27, 2020 at 12:08 PM Darren Govoni <da...@ontrenet.com> wrote:
>
> Hello,
>    So i was able to get intelliJ to debug nifi but only inside the bootstrap process. It looks like nifi spawns a new process and that process does not run the debug options.
>
> Is there a way to instruct nifi to enable debug port on its main process? That will have the actual app code i need to trace.
>
> Thanks for any tips. Much appreciated!
> Darren
>
> Sent from my Verizon, Samsung Galaxy smartphone
> Get Outlook for Android
>
> ________________________________
> From: Mike Thomsen <mi...@gmail.com>
> Sent: Monday, October 26, 2020 10:15:33 PM
> To: users@nifi.apache.org <us...@nifi.apache.org>
> Subject: Re: Run Nifi in IntelliJ to debug?
>
> Are you using a binary derived from the source code in your IDE? Like
> a 1.12.1 binary and the source code from the release?
>
> On Mon, Oct 26, 2020 at 7:47 PM Russell Bateman <ru...@windofkeltia.com> wrote:
> >
> > Hmmm... It's rare that I debug NiFi code. And it's also rare that I debug my own in that context since the NiFi test runner allows me to fend off most surprises via my JUnit tests.
> >
> > I think back in 2016, I was debugging a start-up problem involving NiFi start-up and incompatibility with the Java Flight Recorder. As I recall, I downloaded the relevant NiFi code sources matching the version of NiFi I was debugging remotely. I remember ultimately making a slight (and only temporary) change to NiFi start-up that fixed the problem. At that point I must have been building my own copy to have seen it fixed.. It had to do with the order in which NiFi was getting command-line arguments making it so the JFR wasn't running. I'd have to dig back to figure out what I was doing, but it's probably not too relevant to what you need to do.
> >
> > What do you need to see in this?
> >
> > Russ
> >
> > On 10/26/20 5:38 PM, Darren Govoni wrote:
> >
> > Correct. Primarily the nifi-web-api module and AccessResource class. For starters.
> >
> > Sent from my Verizon, Samsung Galaxy smartphone
> > Get Outlook for Android
> >
> > ________________________________
> > From: Russell Bateman <ru...@windofkeltia.com>
> > Sent: Monday, October 26, 2020 7:37:13 PM
> > To: Darren Govoni <da...@ontrenet.com>; users@nifi.apache.org <us...@nifi.apache.org>
> > Subject: Re: Run Nifi in IntelliJ to debug?
> >
> > Darren,
> >
> > This is just Apache NiFi code out of NARs you want to step through or is it yours? You haven't stripped debug information or anything, right?
> >
> > Russ
> >
> > On 10/26/20 5:30 PM, Darren Govoni wrote:
> >
> > Kevin/Russel
> >
> > Thanks for the info. I did set things up this way.
> >
> > IntelliJ does connect to the nifi jvm and nifi runs and works but intellij isnt breaking on code it should.
> >
> > I did set the module where the code/classes are located (in the remote connection dialog) and i see the exception im tracking print on the console output but intellij never breaks.
> >
> > Is there an extra step needed? Generate sources?
> >
> > For future it would be nice if there was a maven goal for debug.
> >
> > Much appreciated!
> > Darren
> >
> > Sent from my Verizon, Samsung Galaxy smartphone
> > Get Outlook for Android
> > ________________________________
> > From: Russell Bateman <ru...@windofkeltia.com>
> > Sent: Monday, October 26, 2020 4:09:50 PM
> > To: users@nifi.apache.org <us...@nifi.apache.org>; Darren Govoni <da...@ontrenet.com>
> > Subject: Re: Run Nifi in IntelliJ to debug?
> >
> > Darren,
> >
> > I was out this morning and didn't see your plea until I got in just now. Here's a step by step I wrote up for both IntelliJ IDEA and Eclipse (I'm more an IntelliJ guy). It also covers using an IP tunnel.
> >
> > https://www.javahotchocolate.com/notes/nifi.html#20160323
> >
> > On 10/26/20 9:52 AM, Darren Govoni wrote:
> >
> > Hi
> >    Is it possible to run Nifi from inside IntelliJ with debugging such that I can hit the app from my browser and trigger breakpoints?
> >
> > If anyone has done this can you please share any info?
> >
> > Thanks in advance!
> > Darren
> >
> > Sent from my Verizon, Samsung Galaxy smartphone
> > Get Outlook for Android
> >
> >
> >
> >

Re: Run Nifi in IntelliJ to debug?

Posted by Andy LoPresto <al...@apache.org>.
Did you follow Kevin’s guide below? If you put a breakpoint inside any of the code other than the bootstrap, the IDE should pause there. Many of the NiFi developers perform this process daily. 

If you are still having trouble, please share your bootstrap.conf file and the locations of the breakpoints within your code. 

Andy LoPresto
alopresto@apache.org
alopresto.apache@gmail.com
He/Him
PGP Fingerprint: 70EC B3E5 98A6 5A3F D3C4  BACE 3C6E F65B 2F7D EF69

> On Oct 27, 2020, at 9:08 AM, Darren Govoni <da...@ontrenet.com> wrote:
> 
> Hello,
>    So i was able to get intelliJ to debug nifi but only inside the bootstrap process. It looks like nifi spawns a new process and that process does not run the debug options. 
> 
> Is there a way to instruct nifi to enable debug port on its main process? That will have the actual app code i need to trace.
> 
> Thanks for any tips. Much appreciated!
> Darren
> 
> Sent from my Verizon, Samsung Galaxy smartphone
> Get Outlook for Android <https://aka.ms/ghei36>
> From: Mike Thomsen <mi...@gmail.com>
> Sent: Monday, October 26, 2020 10:15:33 PM
> To: users@nifi.apache.org <us...@nifi.apache.org>
> Subject: Re: Run Nifi in IntelliJ to debug?
>  
> Are you using a binary derived from the source code in your IDE? Like
> a 1.12.1 binary and the source code from the release?
> 
> On Mon, Oct 26, 2020 at 7:47 PM Russell Bateman <ru...@windofkeltia.com> wrote:
> >
> > Hmmm... It's rare that I debug NiFi code. And it's also rare that I debug my own in that context since the NiFi test runner allows me to fend off most surprises via my JUnit tests.
> >
> > I think back in 2016, I was debugging a start-up problem involving NiFi start-up and incompatibility with the Java Flight Recorder. As I recall, I downloaded the relevant NiFi code sources matching the version of NiFi I was debugging remotely. I remember ultimately making a slight (and only temporary) change to NiFi start-up that fixed the problem. At that point I must have been building my own copy to have seen it fixed.. It had to do with the order in which NiFi was getting command-line arguments making it so the JFR wasn't running. I'd have to dig back to figure out what I was doing, but it's probably not too relevant to what you need to do.
> >
> > What do you need to see in this?
> >
> > Russ
> >
> > On 10/26/20 5:38 PM, Darren Govoni wrote:
> >
> > Correct. Primarily the nifi-web-api module and AccessResource class. For starters.
> >
> > Sent from my Verizon, Samsung Galaxy smartphone
> > Get Outlook for Android
> >
> > ________________________________
> > From: Russell Bateman <ru...@windofkeltia.com>
> > Sent: Monday, October 26, 2020 7:37:13 PM
> > To: Darren Govoni <da...@ontrenet.com>; users@nifi.apache.org <us...@nifi.apache.org>
> > Subject: Re: Run Nifi in IntelliJ to debug?
> >
> > Darren,
> >
> > This is just Apache NiFi code out of NARs you want to step through or is it yours? You haven't stripped debug information or anything, right?
> >
> > Russ
> >
> > On 10/26/20 5:30 PM, Darren Govoni wrote:
> >
> > Kevin/Russel
> >
> > Thanks for the info. I did set things up this way.
> >
> > IntelliJ does connect to the nifi jvm and nifi runs and works but intellij isnt breaking on code it should.
> >
> > I did set the module where the code/classes are located (in the remote connection dialog) and i see the exception im tracking print on the console output but intellij never breaks.
> >
> > Is there an extra step needed? Generate sources?
> >
> > For future it would be nice if there was a maven goal for debug.
> >
> > Much appreciated!
> > Darren
> >
> > Sent from my Verizon, Samsung Galaxy smartphone
> > Get Outlook for Android
> > ________________________________
> > From: Russell Bateman <ru...@windofkeltia.com>
> > Sent: Monday, October 26, 2020 4:09:50 PM
> > To: users@nifi.apache.org <us...@nifi.apache.org>; Darren Govoni <da...@ontrenet.com>
> > Subject: Re: Run Nifi in IntelliJ to debug?
> >
> > Darren,
> >
> > I was out this morning and didn't see your plea until I got in just now. Here's a step by step I wrote up for both IntelliJ IDEA and Eclipse (I'm more an IntelliJ guy). It also covers using an IP tunnel.
> >
> > https://www.javahotchocolate.com/notes/nifi.html#20160323 <https://www.javahotchocolate.com/notes/nifi.html#20160323>
> >
> > On 10/26/20 9:52 AM, Darren Govoni wrote:
> >
> > Hi
> >    Is it possible to run Nifi from inside IntelliJ with debugging such that I can hit the app from my browser and trigger breakpoints?
> >
> > If anyone has done this can you please share any info?
> >
> > Thanks in advance!
> > Darren
> >
> > Sent from my Verizon, Samsung Galaxy smartphone
> > Get Outlook for Android
> >
> >
> >
> >


Re: Run Nifi in IntelliJ to debug?

Posted by Darren Govoni <da...@ontrenet.com>.
Hello,
   So i was able to get intelliJ to debug nifi but only inside the bootstrap process. It looks like nifi spawns a new process and that process does not run the debug options.

Is there a way to instruct nifi to enable debug port on its main process? That will have the actual app code i need to trace.

Thanks for any tips. Much appreciated!
Darren

Sent from my Verizon, Samsung Galaxy smartphone
Get Outlook for Android<https://aka.ms/ghei36>

________________________________
From: Mike Thomsen <mi...@gmail.com>
Sent: Monday, October 26, 2020 10:15:33 PM
To: users@nifi.apache.org <us...@nifi.apache.org>
Subject: Re: Run Nifi in IntelliJ to debug?

Are you using a binary derived from the source code in your IDE? Like
a 1.12.1 binary and the source code from the release?

On Mon, Oct 26, 2020 at 7:47 PM Russell Bateman <ru...@windofkeltia.com> wrote:
>
> Hmmm... It's rare that I debug NiFi code. And it's also rare that I debug my own in that context since the NiFi test runner allows me to fend off most surprises via my JUnit tests.
>
> I think back in 2016, I was debugging a start-up problem involving NiFi start-up and incompatibility with the Java Flight Recorder. As I recall, I downloaded the relevant NiFi code sources matching the version of NiFi I was debugging remotely. I remember ultimately making a slight (and only temporary) change to NiFi start-up that fixed the problem. At that point I must have been building my own copy to have seen it fixed.. It had to do with the order in which NiFi was getting command-line arguments making it so the JFR wasn't running. I'd have to dig back to figure out what I was doing, but it's probably not too relevant to what you need to do.
>
> What do you need to see in this?
>
> Russ
>
> On 10/26/20 5:38 PM, Darren Govoni wrote:
>
> Correct. Primarily the nifi-web-api module and AccessResource class. For starters.
>
> Sent from my Verizon, Samsung Galaxy smartphone
> Get Outlook for Android
>
> ________________________________
> From: Russell Bateman <ru...@windofkeltia.com>
> Sent: Monday, October 26, 2020 7:37:13 PM
> To: Darren Govoni <da...@ontrenet.com>; users@nifi.apache.org <us...@nifi.apache.org>
> Subject: Re: Run Nifi in IntelliJ to debug?
>
> Darren,
>
> This is just Apache NiFi code out of NARs you want to step through or is it yours? You haven't stripped debug information or anything, right?
>
> Russ
>
> On 10/26/20 5:30 PM, Darren Govoni wrote:
>
> Kevin/Russel
>
> Thanks for the info. I did set things up this way.
>
> IntelliJ does connect to the nifi jvm and nifi runs and works but intellij isnt breaking on code it should.
>
> I did set the module where the code/classes are located (in the remote connection dialog) and i see the exception im tracking print on the console output but intellij never breaks.
>
> Is there an extra step needed? Generate sources?
>
> For future it would be nice if there was a maven goal for debug.
>
> Much appreciated!
> Darren
>
> Sent from my Verizon, Samsung Galaxy smartphone
> Get Outlook for Android
> ________________________________
> From: Russell Bateman <ru...@windofkeltia.com>
> Sent: Monday, October 26, 2020 4:09:50 PM
> To: users@nifi.apache.org <us...@nifi.apache.org>; Darren Govoni <da...@ontrenet.com>
> Subject: Re: Run Nifi in IntelliJ to debug?
>
> Darren,
>
> I was out this morning and didn't see your plea until I got in just now. Here's a step by step I wrote up for both IntelliJ IDEA and Eclipse (I'm more an IntelliJ guy). It also covers using an IP tunnel.
>
> https://www.javahotchocolate.com/notes/nifi.html#20160323
>
> On 10/26/20 9:52 AM, Darren Govoni wrote:
>
> Hi
>    Is it possible to run Nifi from inside IntelliJ with debugging such that I can hit the app from my browser and trigger breakpoints?
>
> If anyone has done this can you please share any info?
>
> Thanks in advance!
> Darren
>
> Sent from my Verizon, Samsung Galaxy smartphone
> Get Outlook for Android
>
>
>
>

Re: Run Nifi in IntelliJ to debug?

Posted by Mike Thomsen <mi...@gmail.com>.
Are you using a binary derived from the source code in your IDE? Like
a 1.12.1 binary and the source code from the release?

On Mon, Oct 26, 2020 at 7:47 PM Russell Bateman <ru...@windofkeltia.com> wrote:
>
> Hmmm... It's rare that I debug NiFi code. And it's also rare that I debug my own in that context since the NiFi test runner allows me to fend off most surprises via my JUnit tests.
>
> I think back in 2016, I was debugging a start-up problem involving NiFi start-up and incompatibility with the Java Flight Recorder. As I recall, I downloaded the relevant NiFi code sources matching the version of NiFi I was debugging remotely. I remember ultimately making a slight (and only temporary) change to NiFi start-up that fixed the problem. At that point I must have been building my own copy to have seen it fixed.. It had to do with the order in which NiFi was getting command-line arguments making it so the JFR wasn't running. I'd have to dig back to figure out what I was doing, but it's probably not too relevant to what you need to do.
>
> What do you need to see in this?
>
> Russ
>
> On 10/26/20 5:38 PM, Darren Govoni wrote:
>
> Correct. Primarily the nifi-web-api module and AccessResource class. For starters.
>
> Sent from my Verizon, Samsung Galaxy smartphone
> Get Outlook for Android
>
> ________________________________
> From: Russell Bateman <ru...@windofkeltia.com>
> Sent: Monday, October 26, 2020 7:37:13 PM
> To: Darren Govoni <da...@ontrenet.com>; users@nifi.apache.org <us...@nifi.apache.org>
> Subject: Re: Run Nifi in IntelliJ to debug?
>
> Darren,
>
> This is just Apache NiFi code out of NARs you want to step through or is it yours? You haven't stripped debug information or anything, right?
>
> Russ
>
> On 10/26/20 5:30 PM, Darren Govoni wrote:
>
> Kevin/Russel
>
> Thanks for the info. I did set things up this way.
>
> IntelliJ does connect to the nifi jvm and nifi runs and works but intellij isnt breaking on code it should.
>
> I did set the module where the code/classes are located (in the remote connection dialog) and i see the exception im tracking print on the console output but intellij never breaks.
>
> Is there an extra step needed? Generate sources?
>
> For future it would be nice if there was a maven goal for debug.
>
> Much appreciated!
> Darren
>
> Sent from my Verizon, Samsung Galaxy smartphone
> Get Outlook for Android
> ________________________________
> From: Russell Bateman <ru...@windofkeltia.com>
> Sent: Monday, October 26, 2020 4:09:50 PM
> To: users@nifi.apache.org <us...@nifi.apache.org>; Darren Govoni <da...@ontrenet.com>
> Subject: Re: Run Nifi in IntelliJ to debug?
>
> Darren,
>
> I was out this morning and didn't see your plea until I got in just now. Here's a step by step I wrote up for both IntelliJ IDEA and Eclipse (I'm more an IntelliJ guy). It also covers using an IP tunnel.
>
> https://www.javahotchocolate.com/notes/nifi.html#20160323
>
> On 10/26/20 9:52 AM, Darren Govoni wrote:
>
> Hi
>    Is it possible to run Nifi from inside IntelliJ with debugging such that I can hit the app from my browser and trigger breakpoints?
>
> If anyone has done this can you please share any info?
>
> Thanks in advance!
> Darren
>
> Sent from my Verizon, Samsung Galaxy smartphone
> Get Outlook for Android
>
>
>
>

Re: Run Nifi in IntelliJ to debug?

Posted by Russell Bateman <ru...@windofkeltia.com>.
Hmmm... It's rare that I debug NiFi code. And it's also rare that I 
debug my own in that context since the NiFi test runner allows me to 
fend off most surprises via my JUnit tests.

I think back in 2016, I was debugging a start-up problem involving NiFi 
start-up and incompatibility with the Java Flight Recorder. As I recall, 
I downloaded the relevant NiFi code sources matching the version of NiFi 
I was debugging remotely. I remember ultimately making a slight (and 
only temporary) change to NiFi start-up that fixed the problem. At that 
point I must have been building my own copy to have seen it fixed.. It 
had to do with the order in which NiFi was getting command-line 
arguments making it so the JFR wasn't running. I'd have to dig back to 
figure out what I was doing, but it's probably not too relevant to what 
you need to do.

What do you need to see in this?

Russ

On 10/26/20 5:38 PM, Darren Govoni wrote:
> Correct. Primarily the nifi-web-api module and AccessResource class. 
> For starters.
>
> Sent from my Verizon, Samsung Galaxy smartphone
> Get Outlook for Android <https://aka.ms/ghei36>
>
> ------------------------------------------------------------------------
> *From:* Russell Bateman <ru...@windofkeltia.com>
> *Sent:* Monday, October 26, 2020 7:37:13 PM
> *To:* Darren Govoni <da...@ontrenet.com>; users@nifi.apache.org 
> <us...@nifi.apache.org>
> *Subject:* Re: Run Nifi in IntelliJ to debug?
> Darren,
>
> This is just Apache NiFi code out of NARs you want to step through or 
> is it yours? You haven't stripped debug information or anything, right?
>
> Russ
>
> On 10/26/20 5:30 PM, Darren Govoni wrote:
>> Kevin/Russel
>>
>> Thanks for the info. I did set things up this way.
>>
>> IntelliJ does connect to the nifi jvm and nifi runs and works but 
>> intellij isnt breaking on code it should.
>>
>> I did set the module where the code/classes are located (in the 
>> remote connection dialog) and i see the exception im tracking print 
>> on the console output but intellij never breaks.
>>
>> Is there an extra step needed? Generate sources?
>>
>> For future it would be nice if there was a maven goal for debug.
>>
>> Much appreciated!
>> Darren
>>
>> Sent from my Verizon, Samsung Galaxy smartphone
>> Get Outlook for Android <https://aka.ms/ghei36>
>> ------------------------------------------------------------------------
>> *From:* Russell Bateman <ru...@windofkeltia.com> 
>> <ma...@windofkeltia.com>
>> *Sent:* Monday, October 26, 2020 4:09:50 PM
>> *To:* users@nifi.apache.org <ma...@nifi.apache.org> 
>> <us...@nifi.apache.org> <ma...@nifi.apache.org>; Darren Govoni 
>> <da...@ontrenet.com> <ma...@ontrenet.com>
>> *Subject:* Re: Run Nifi in IntelliJ to debug?
>> Darren,
>>
>> I was out this morning and didn't see your plea until I got in just 
>> now. Here's a step by step I wrote up for both IntelliJ IDEA and 
>> Eclipse (I'm more an IntelliJ guy). It also covers using an IP tunnel.
>>
>> https://www.javahotchocolate.com/notes/nifi.html#20160323
>>
>> On 10/26/20 9:52 AM, Darren Govoni wrote:
>>> Hi
>>>    Is it possible to run Nifi from inside IntelliJ with debugging 
>>> such that I can hit the app from my browser and trigger breakpoints?
>>>
>>> If anyone has done this can you please share any info?
>>>
>>> Thanks in advance!
>>> Darren
>>>
>>> Sent from my Verizon, Samsung Galaxy smartphone
>>> Get Outlook for Android <https://aka.ms/ghei36>
>>
>


Re: Run Nifi in IntelliJ to debug?

Posted by Darren Govoni <da...@ontrenet.com>.
Correct. Primarily the nifi-web-api module and AccessResource class. For starters.

Sent from my Verizon, Samsung Galaxy smartphone
Get Outlook for Android<https://aka.ms/ghei36>

________________________________
From: Russell Bateman <ru...@windofkeltia.com>
Sent: Monday, October 26, 2020 7:37:13 PM
To: Darren Govoni <da...@ontrenet.com>; users@nifi.apache.org <us...@nifi.apache.org>
Subject: Re: Run Nifi in IntelliJ to debug?

Darren,

This is just Apache NiFi code out of NARs you want to step through or is it yours? You haven't stripped debug information or anything, right?

Russ

On 10/26/20 5:30 PM, Darren Govoni wrote:
Kevin/Russel

Thanks for the info. I did set things up this way.

IntelliJ does connect to the nifi jvm and nifi runs and works but intellij isnt breaking on code it should.

I did set the module where the code/classes are located (in the remote connection dialog) and i see the exception im tracking print on the console output but intellij never breaks.

Is there an extra step needed? Generate sources?

For future it would be nice if there was a maven goal for debug.

Much appreciated!
Darren

Sent from my Verizon, Samsung Galaxy smartphone
Get Outlook for Android<https://aka.ms/ghei36>
________________________________
From: Russell Bateman <ru...@windofkeltia.com>
Sent: Monday, October 26, 2020 4:09:50 PM
To: users@nifi.apache.org<ma...@nifi.apache.org> <us...@nifi.apache.org>; Darren Govoni <da...@ontrenet.com>
Subject: Re: Run Nifi in IntelliJ to debug?

Darren,

I was out this morning and didn't see your plea until I got in just now. Here's a step by step I wrote up for both IntelliJ IDEA and Eclipse (I'm more an IntelliJ guy). It also covers using an IP tunnel.

https://www.javahotchocolate.com/notes/nifi.html#20160323

On 10/26/20 9:52 AM, Darren Govoni wrote:
Hi
   Is it possible to run Nifi from inside IntelliJ with debugging such that I can hit the app from my browser and trigger breakpoints?

If anyone has done this can you please share any info?

Thanks in advance!
Darren

Sent from my Verizon, Samsung Galaxy smartphone
Get Outlook for Android<https://aka.ms/ghei36>



Re: Run Nifi in IntelliJ to debug?

Posted by Russell Bateman <ru...@windofkeltia.com>.
Darren,

This is just Apache NiFi code out of NARs you want to step through or is 
it yours? You haven't stripped debug information or anything, right?

Russ

On 10/26/20 5:30 PM, Darren Govoni wrote:
> Kevin/Russel
>
> Thanks for the info. I did set things up this way.
>
> IntelliJ does connect to the nifi jvm and nifi runs and works but 
> intellij isnt breaking on code it should.
>
> I did set the module where the code/classes are located (in the remote 
> connection dialog) and i see the exception im tracking print on the 
> console output but intellij never breaks.
>
> Is there an extra step needed? Generate sources?
>
> For future it would be nice if there was a maven goal for debug.
>
> Much appreciated!
> Darren
>
> Sent from my Verizon, Samsung Galaxy smartphone
> Get Outlook for Android <https://aka.ms/ghei36>
> ------------------------------------------------------------------------
> *From:* Russell Bateman <ru...@windofkeltia.com>
> *Sent:* Monday, October 26, 2020 4:09:50 PM
> *To:* users@nifi.apache.org <us...@nifi.apache.org>; Darren Govoni 
> <da...@ontrenet.com>
> *Subject:* Re: Run Nifi in IntelliJ to debug?
> Darren,
>
> I was out this morning and didn't see your plea until I got in just 
> now. Here's a step by step I wrote up for both IntelliJ IDEA and 
> Eclipse (I'm more an IntelliJ guy). It also covers using an IP tunnel.
>
> https://www.javahotchocolate.com/notes/nifi.html#20160323
>
> On 10/26/20 9:52 AM, Darren Govoni wrote:
>> Hi
>>    Is it possible to run Nifi from inside IntelliJ with debugging 
>> such that I can hit the app from my browser and trigger breakpoints?
>>
>> If anyone has done this can you please share any info?
>>
>> Thanks in advance!
>> Darren
>>
>> Sent from my Verizon, Samsung Galaxy smartphone
>> Get Outlook for Android <https://aka.ms/ghei36>
>


Re: Run Nifi in IntelliJ to debug?

Posted by Darren Govoni <da...@ontrenet.com>.
Kevin/Russel

Thanks for the info. I did set things up this way.

IntelliJ does connect to the nifi jvm and nifi runs and works but intellij isnt breaking on code it should.

I did set the module where the code/classes are located (in the remote connection dialog) and i see the exception im tracking print on the console output but intellij never breaks.

Is there an extra step needed? Generate sources?

For future it would be nice if there was a maven goal for debug.

Much appreciated!
Darren

Sent from my Verizon, Samsung Galaxy smartphone
Get Outlook for Android<https://aka.ms/ghei36>
________________________________
From: Russell Bateman <ru...@windofkeltia.com>
Sent: Monday, October 26, 2020 4:09:50 PM
To: users@nifi.apache.org <us...@nifi.apache.org>; Darren Govoni <da...@ontrenet.com>
Subject: Re: Run Nifi in IntelliJ to debug?

Darren,

I was out this morning and didn't see your plea until I got in just now. Here's a step by step I wrote up for both IntelliJ IDEA and Eclipse (I'm more an IntelliJ guy). It also covers using an IP tunnel.

https://www.javahotchocolate.com/notes/nifi.html#20160323

On 10/26/20 9:52 AM, Darren Govoni wrote:
Hi
   Is it possible to run Nifi from inside IntelliJ with debugging such that I can hit the app from my browser and trigger breakpoints?

If anyone has done this can you please share any info?

Thanks in advance!
Darren

Sent from my Verizon, Samsung Galaxy smartphone
Get Outlook for Android<https://aka.ms/ghei36>


Re: Run Nifi in IntelliJ to debug?

Posted by Mike Thomsen <mi...@gmail.com>.
If you want to use the Docker image, add "-e NIFI_JVM_DEBUGGER=1" and
map port 8000 to something on your machine.

On Mon, Oct 26, 2020 at 4:10 PM Russell Bateman <ru...@windofkeltia.com> wrote:
>
> Darren,
>
> I was out this morning and didn't see your plea until I got in just now. Here's a step by step I wrote up for both IntelliJ IDEA and Eclipse (I'm more an IntelliJ guy). It also covers using an IP tunnel.
>
> https://www.javahotchocolate.com/notes/nifi.html#20160323
>
> On 10/26/20 9:52 AM, Darren Govoni wrote:
>
> Hi
>    Is it possible to run Nifi from inside IntelliJ with debugging such that I can hit the app from my browser and trigger breakpoints?
>
> If anyone has done this can you please share any info?
>
> Thanks in advance!
> Darren
>
> Sent from my Verizon, Samsung Galaxy smartphone
> Get Outlook for Android
>
>

Re: Run Nifi in IntelliJ to debug?

Posted by Russell Bateman <ru...@windofkeltia.com>.
Darren,

I was out this morning and didn't see your plea until I got in just now. 
Here's a step by step I wrote up for both IntelliJ IDEA and Eclipse (I'm 
more an IntelliJ guy). It also covers using an IP tunnel.

https://www.javahotchocolate.com/notes/nifi.html#20160323

On 10/26/20 9:52 AM, Darren Govoni wrote:
> Hi
>    Is it possible to run Nifi from inside IntelliJ with debugging such 
> that I can hit the app from my browser and trigger breakpoints?
>
> If anyone has done this can you please share any info?
>
> Thanks in advance!
> Darren
>
> Sent from my Verizon, Samsung Galaxy smartphone
> Get Outlook for Android <https://aka.ms/ghei36>


Re: Run Nifi in IntelliJ to debug?

Posted by Javi Roman <jr...@gmail.com>.
Hi!

Here instructions for running MiNiFi (debugging) within IntelliJ IDEA,
practically the same steps for NiFi.

shorturl.at/bkloI

--
Javi Roman

Twitter: @javiromanrh
GitHub: github.com/javiroman
Linkedin: es.linkedin.com/in/javiroman
Big Data Blog: dataintensive.info


On Mon, Oct 26, 2020 at 6:08 PM Kevin Doran <kd...@apache.org> wrote:

> Hi, Darren -
>
> I am not aware of a method of running a full NiFi instance directly in
> IntelliJ, but I use the method Matt mentioned: attaching IntelliJ as a
> remote debugger to a running NiFi instance.
>
> I put together a guide a few years back for folks unfamiliar with this
> process or new to IntelliJ:
>
> https://community.cloudera.com/t5/Community-Articles/NiFi-Debugging-Tutorial/ta-p/246082
>
> The screenshots are for an older IntelliJ, but the same basic steps should
> still work.
>
> Hope this helps!
> Kevin
>
> On Oct 26, 2020, at 12:12, Darren Govoni <da...@ontrenet.com> wrote:
>
> Thanks Matt. I think if i can attach remotely and step through the code
> that will satisfy my needs. Let me give it a try.
>
> I also found how to run mvnDebug and attach to that from intellij. Just
> need to find a maven goal that runs nifi but i havent seen one yet.
>
> Sent from my Verizon, Samsung Galaxy smartphone
> Get Outlook for Android <https://aka.ms/ghei36>
>
> ------------------------------
> *From:* Matt Burgess <ma...@apache.org>
> *Sent:* Monday, October 26, 2020 12:05:03 PM
> *To:* users@nifi.apache.org <us...@nifi.apache.org>
> *Subject:* Re: Run Nifi in IntelliJ to debug?
>
> Sorry I misread the part where you wanted to run NiFi inside IntelliJ,
> I was talking about running it externally (from the command-line,
> e.g.) and connecting the IntelliJ debugger. I haven't run NiFi itself
> using IntelliJ, maybe someone else can chime in for that.
>
> On Mon, Oct 26, 2020 at 12:03 PM Matt Burgess <ma...@apache.org>
> wrote:
> >
> > Yes, that's a pretty common operation amongst NiFi developers. In
> > conf/bootstrap.conf there's a section called Enable Remote Debugging
> > and a commented-out line something like:
> >
> >
> java.arg.debug=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005
> >
> > You can remove the comment from that line and set things like the
> > address to the desired port, whether to suspend the JVM until a
> > debugger connects, etc. Then in IntelliJ you can create a new
> > configuration of type Remote, point it at the port you set in the
> > above line, and connect the debugger. It will then stop at breakpoints
> > and you can do all the debugging stuff like add Watches, execute
> > expressions (to change values at runtime), etc.
> >
> > Regards,
> > Matt
> >
> > On Mon, Oct 26, 2020 at 11:52 AM Darren Govoni <da...@ontrenet.com>
> wrote:
> > >
> > > Hi
> > >    Is it possible to run Nifi from inside IntelliJ with debugging such
> that I can hit the app from my browser and trigger breakpoints?
> > >
> > > If anyone has done this can you please share any info?
> > >
> > > Thanks in advance!
> > > Darren
> > >
> > > Sent from my Verizon, Samsung Galaxy smartphone
> > > Get Outlook for Android
>
>
>

Re: Run Nifi in IntelliJ to debug?

Posted by Kevin Doran <kd...@apache.org>.
Hi, Darren -

I am not aware of a method of running a full NiFi instance directly in IntelliJ, but I use the method Matt mentioned: attaching IntelliJ as a remote debugger to a running NiFi instance.

I put together a guide a few years back for folks unfamiliar with this process or new to IntelliJ:
https://community.cloudera.com/t5/Community-Articles/NiFi-Debugging-Tutorial/ta-p/246082 <https://community.cloudera.com/t5/Community-Articles/NiFi-Debugging-Tutorial/ta-p/246082>

The screenshots are for an older IntelliJ, but the same basic steps should still work. 

Hope this helps!
Kevin

> On Oct 26, 2020, at 12:12, Darren Govoni <da...@ontrenet.com> wrote:
> 
> Thanks Matt. I think if i can attach remotely and step through the code that will satisfy my needs. Let me give it a try.
> 
> I also found how to run mvnDebug and attach to that from intellij. Just need to find a maven goal that runs nifi but i havent seen one yet.
> 
> Sent from my Verizon, Samsung Galaxy smartphone
> Get Outlook for Android <https://aka.ms/ghei36>
> From: Matt Burgess <ma...@apache.org>
> Sent: Monday, October 26, 2020 12:05:03 PM
> To: users@nifi.apache.org <us...@nifi.apache.org>
> Subject: Re: Run Nifi in IntelliJ to debug?
>  
> Sorry I misread the part where you wanted to run NiFi inside IntelliJ,
> I was talking about running it externally (from the command-line,
> e.g.) and connecting the IntelliJ debugger. I haven't run NiFi itself
> using IntelliJ, maybe someone else can chime in for that.
> 
> On Mon, Oct 26, 2020 at 12:03 PM Matt Burgess <ma...@apache.org> wrote:
> >
> > Yes, that's a pretty common operation amongst NiFi developers. In
> > conf/bootstrap.conf there's a section called Enable Remote Debugging
> > and a commented-out line something like:
> >
> > java.arg.debug=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005
> >
> > You can remove the comment from that line and set things like the
> > address to the desired port, whether to suspend the JVM until a
> > debugger connects, etc. Then in IntelliJ you can create a new
> > configuration of type Remote, point it at the port you set in the
> > above line, and connect the debugger. It will then stop at breakpoints
> > and you can do all the debugging stuff like add Watches, execute
> > expressions (to change values at runtime), etc.
> >
> > Regards,
> > Matt
> >
> > On Mon, Oct 26, 2020 at 11:52 AM Darren Govoni <da...@ontrenet.com> wrote:
> > >
> > > Hi
> > >    Is it possible to run Nifi from inside IntelliJ with debugging such that I can hit the app from my browser and trigger breakpoints?
> > >
> > > If anyone has done this can you please share any info?
> > >
> > > Thanks in advance!
> > > Darren
> > >
> > > Sent from my Verizon, Samsung Galaxy smartphone
> > > Get Outlook for Android


Re: Run Nifi in IntelliJ to debug?

Posted by Darren Govoni <da...@ontrenet.com>.
Thanks Matt. I think if i can attach remotely and step through the code that will satisfy my needs. Let me give it a try.

I also found how to run mvnDebug and attach to that from intellij. Just need to find a maven goal that runs nifi but i havent seen one yet.

Sent from my Verizon, Samsung Galaxy smartphone
Get Outlook for Android<https://aka.ms/ghei36>

________________________________
From: Matt Burgess <ma...@apache.org>
Sent: Monday, October 26, 2020 12:05:03 PM
To: users@nifi.apache.org <us...@nifi.apache.org>
Subject: Re: Run Nifi in IntelliJ to debug?

Sorry I misread the part where you wanted to run NiFi inside IntelliJ,
I was talking about running it externally (from the command-line,
e.g.) and connecting the IntelliJ debugger. I haven't run NiFi itself
using IntelliJ, maybe someone else can chime in for that.

On Mon, Oct 26, 2020 at 12:03 PM Matt Burgess <ma...@apache.org> wrote:
>
> Yes, that's a pretty common operation amongst NiFi developers. In
> conf/bootstrap.conf there's a section called Enable Remote Debugging
> and a commented-out line something like:
>
> java.arg.debug=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005
>
> You can remove the comment from that line and set things like the
> address to the desired port, whether to suspend the JVM until a
> debugger connects, etc. Then in IntelliJ you can create a new
> configuration of type Remote, point it at the port you set in the
> above line, and connect the debugger. It will then stop at breakpoints
> and you can do all the debugging stuff like add Watches, execute
> expressions (to change values at runtime), etc.
>
> Regards,
> Matt
>
> On Mon, Oct 26, 2020 at 11:52 AM Darren Govoni <da...@ontrenet.com> wrote:
> >
> > Hi
> >    Is it possible to run Nifi from inside IntelliJ with debugging such that I can hit the app from my browser and trigger breakpoints?
> >
> > If anyone has done this can you please share any info?
> >
> > Thanks in advance!
> > Darren
> >
> > Sent from my Verizon, Samsung Galaxy smartphone
> > Get Outlook for Android

Re: Run Nifi in IntelliJ to debug?

Posted by Matt Burgess <ma...@apache.org>.
Sorry I misread the part where you wanted to run NiFi inside IntelliJ,
I was talking about running it externally (from the command-line,
e.g.) and connecting the IntelliJ debugger. I haven't run NiFi itself
using IntelliJ, maybe someone else can chime in for that.

On Mon, Oct 26, 2020 at 12:03 PM Matt Burgess <ma...@apache.org> wrote:
>
> Yes, that's a pretty common operation amongst NiFi developers. In
> conf/bootstrap.conf there's a section called Enable Remote Debugging
> and a commented-out line something like:
>
> java.arg.debug=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005
>
> You can remove the comment from that line and set things like the
> address to the desired port, whether to suspend the JVM until a
> debugger connects, etc. Then in IntelliJ you can create a new
> configuration of type Remote, point it at the port you set in the
> above line, and connect the debugger. It will then stop at breakpoints
> and you can do all the debugging stuff like add Watches, execute
> expressions (to change values at runtime), etc.
>
> Regards,
> Matt
>
> On Mon, Oct 26, 2020 at 11:52 AM Darren Govoni <da...@ontrenet.com> wrote:
> >
> > Hi
> >    Is it possible to run Nifi from inside IntelliJ with debugging such that I can hit the app from my browser and trigger breakpoints?
> >
> > If anyone has done this can you please share any info?
> >
> > Thanks in advance!
> > Darren
> >
> > Sent from my Verizon, Samsung Galaxy smartphone
> > Get Outlook for Android

Re: Run Nifi in IntelliJ to debug?

Posted by Matt Burgess <ma...@apache.org>.
Yes, that's a pretty common operation amongst NiFi developers. In
conf/bootstrap.conf there's a section called Enable Remote Debugging
and a commented-out line something like:

java.arg.debug=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005

You can remove the comment from that line and set things like the
address to the desired port, whether to suspend the JVM until a
debugger connects, etc. Then in IntelliJ you can create a new
configuration of type Remote, point it at the port you set in the
above line, and connect the debugger. It will then stop at breakpoints
and you can do all the debugging stuff like add Watches, execute
expressions (to change values at runtime), etc.

Regards,
Matt

On Mon, Oct 26, 2020 at 11:52 AM Darren Govoni <da...@ontrenet.com> wrote:
>
> Hi
>    Is it possible to run Nifi from inside IntelliJ with debugging such that I can hit the app from my browser and trigger breakpoints?
>
> If anyone has done this can you please share any info?
>
> Thanks in advance!
> Darren
>
> Sent from my Verizon, Samsung Galaxy smartphone
> Get Outlook for Android