Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

ExecuteGroovyScript gives InstantiationException

avatar

Hello

 

I am trying to add an ExecuteGroovyScript processor. A simple example test works fine, but when I try to add my script it does not initiate. Exception (on hoover over) is really brief: InstantiationException thrown by groovy invokehelper. 

Script uses some external jars. As far as I can see I added those to the classpath. 

 

I am probably doing something stupid but I was wondering how to debug this issue? The log files do not seem to contain anything wrt this error which makes troubleshooting very difficult

 

All tips warmly welcomed!

 

Tx

 

Peter

1 ACCEPTED SOLUTION

avatar

This is quite a broad question and hard to troubleshoot all at once.

 

A general approach: 

 

1. Analyze your custom code and identify all bits of complexity/all dependencies

2. Run the standard example

3. Introduce in a very minimal fashion one complexity/dependency from your custom code into the standard

4. If it works, repeat step 3

 

This should allow you to narrow down exactly what is causing the problem (and hopefully guide the resolution).


- Dennis Jaheruddin

If this answer helped, please mark it as 'solved' and/or if it is valuable for future readers please apply 'kudos'.

View solution in original post

2 REPLIES 2

avatar

This is quite a broad question and hard to troubleshoot all at once.

 

A general approach: 

 

1. Analyze your custom code and identify all bits of complexity/all dependencies

2. Run the standard example

3. Introduce in a very minimal fashion one complexity/dependency from your custom code into the standard

4. If it works, repeat step 3

 

This should allow you to narrow down exactly what is causing the problem (and hopefully guide the resolution).


- Dennis Jaheruddin

If this answer helped, please mark it as 'solved' and/or if it is valuable for future readers please apply 'kudos'.

avatar

Hello,

Tx for your reaction Dennis. I was able to continue. 

The reason I was having issues seemed to be related to the fact that the Groovy script was a standard class with a static main method. It makes sense that Nifi does not accept that I guess, but the process of diagnosing such issue might be made easier imo. It was a trial and error task, and as you suggested, by starting from an example.

Anyway, I am good now 🙂

Regards

Peter