Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

NiFi: Cannot use '@GrabConfig(systemClassLoader=true)' in groovy script (ExecuteScript processor)

avatar
New Member

Hi!

I would like to use 'mysql:mysql-connector-java:5.1.39' in a groovy script.
The annotation '@GrabConfig(systemClassLoader=true)' is normally required when using this library, but it seems that it is not supported from within scripts that are run via the ExecuteScript processor (error message is 'no suitable classloader found for grab').
I've also tried including the JAR by manually downloading it and setting the 'Module Directory' property of the flowfile, with no success.
Is there a workaround that would allow me to use this mysql connector from within a script?

Thank you,
Nicholas

1 ACCEPTED SOLUTION

avatar
Master Guru

What version of NiFi are you using? You should definitely be able to use it when it is specified in the Module Directory property. Alternatively, if you just need a Connection from the driver, you could create a DBCPConnectionPool that uses that JAR, then access that controller service to get a Connection. See my blog post and the documentation for ExecuteGroovyScript (which makes this a lot easier than the plain ExecuteScript).

View solution in original post

2 REPLIES 2

avatar
Master Guru

What version of NiFi are you using? You should definitely be able to use it when it is specified in the Module Directory property. Alternatively, if you just need a Connection from the driver, you could create a DBCPConnectionPool that uses that JAR, then access that controller service to get a Connection. See my blog post and the documentation for ExecuteGroovyScript (which makes this a lot easier than the plain ExecuteScript).

avatar
New Member

Wow, that was fast! 🙂

I'm currently playing around with an older version of NIFI (1.2.0). I'll upgrade to the latest available and get back at you with results. Thank you very much!

Nicholas