- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
ExecuteGroovyScript gives InstantiationException
- Labels:
-
Apache NiFi
Created on
‎12-19-2019
10:17 PM
- last edited on
‎12-19-2019
10:51 PM
by
ask_bill_brooks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Created ‎12-24-2019 03:31 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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'.
Created ‎12-24-2019 03:31 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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'.
Created ‎12-24-2019 03:43 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
