Hi guys
Any ideas on why this might be - the code below quite happily runs in the script runner panel, but as soon as I put it in a behaviours object, it throws an error about a missing class, however the JAR is in /lib (where you'd expect)
Does behaviours need it somewhere else?
log.debug "Debuggering Start..." import groovy.sql.Sql sql = Sql.newInstance( 'jdbc:mysql://10.54.1.82:3306/jira_customers', 'jirauser', 'jirapass', 'com.mysql.jdbc.Driver' ) sql.eachRow( 'select distinct system_id, customer_id, site_name from site limit 1' ) { log.debug "$it.system_id -- ${it.customer_id} -- ${it.site_name}--" } log.debug "Debuggering End..."
Error:
2012-10-15 04:17:15,386 http-80-2 ERROR user 257x461x1 19nbclh 58.28.208.153 /rest/com.onresolve.jira.plugin.Behaviours/1.0/behaviours/runvalidator.json [onresolve.jira.groovy.BehaviourManagerImpl] Something went wrong with method run in class
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:772)
at org.apache.felix.framework.ModuleImpl.access$200(ModuleImpl.java:73)
at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1690)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java.lang.Class.forName0(Native Method)
Currently running behaviours 0.50, groovy runner 2.0.7
Many thanks
Scott
Unfortunately the sources don't seem to be available - but I was able to achieve what I wanted with a Scripted Field executing basically the same SQL
You will have to rebuild the behaviours plugin from source and add a dependency of MySQL driver jar in the pom .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have no idea however i have done this when i wanted to use oracle with behaviours groovy script .
You can refer this answer
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, thank you Mizan. Is there any update planned to add this function in Behaviours ? It could be very interesting.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Scott,
My Jira version is 5.0.7 and my Behaviours plugin version is 0.5.0.
I didn't solve my problem :( , so i've used the database custom field plugin to do what i want.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi all - anyone else had this or is it just Bastien and I?
Bastien - what version Jira and Behaviours plugins are you using?
Cheers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have the same problem with my groovy script ...
I will be back as soon as i find this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have the same problem with my groovy script ...
I will be back as soon as i find this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.