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]
Created 04-06-2018 03:12 PM
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
Created 04-06-2018 03:26 PM
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).
Created 04-06-2018 03:26 PM
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).
Created 04-06-2018 03:30 PM
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