Groovy script cannot find depenedencies

Hi,

I am a newbee to Bonita BPM and am trying to create a groovy script connector. I dont get errors when i test the connector as i manually check dependencies but when i run the process it fails as it cannot find the jar files i think. How do i get my process to get dependencies at runtime?

This is the log file.
Script6.groovy: 5: unable to resolve class groovyx.net.http.ContentType
@ line 5, column 1.
import static groovyx.net.http.ContentType.*
^

Script6.groovy: 7: unable to resolve class groovyx.net.http.Method
@ line 7, column 1.
import static groovyx.net.http.Method.*
^

Script6.groovy: 5: unable to resolve class groovyx.net.http.ContentType
@ line 5, column 1.
import static groovyx.net.http.ContentType.*
^

Script6.groovy: 7: unable to resolve class groovyx.net.http.Method
@ line 7, column 1.
import static groovyx.net.http.Method.*
^

Script6.groovy: 11: unable to resolve class HTTPBuilder
@ line 11, column 12.
def http = new HTTPBuilder(‘http://alli-dev-01/arsys/servlet/RemedyIncidentWrapper’)
^

5 errors

at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:302)
at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:858)
at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:548)
at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:497)
at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:306)
at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:287)
at groovy.lang.GroovyShell.parseClass(GroovyShell.java:731)
at groovy.lang.GroovyShell.parse(GroovyShell.java:743)
at groovy.lang.GroovyShell.parse(GroovyShell.java:770)
at groovy.lang.GroovyShell.parse(GroovyShell.java:761)
at org.bonitasoft.engine.expression.impl.GroovyScriptExpressionExecutorCacheStrategy.getScriptFromCache(GroovyScriptExpressionExecutorCacheStrategy.java:67)
at org.bonitasoft.engine.expression.impl.GroovyScriptExpressionExecutorCacheStrategy.evaluate(GroovyScriptExpressionExecutorCacheStrategy.java:94)
... 19 more

Hi,

To integrate your jar libs into your process, you should add them to the workspace with ‘Development>Manage jars…’

More info in the documentation http://documentation.bonitasoft.com/managing-dependencies

Best regards,
Olivier

I also need an answer to this problem. I found this connector that solved my case though https://github.com/bonitasoft/bonita-connector-rest http://community.bonitasoft.com/project/rest-connector

Sorry i forgot to mention, i have already done that. I have also tried Development> refresh connector repository number of times. May be I am just missing a jar?

When i test the connector, i check all the jars and it doesnt complain so i dont think i am missing jars but when i run the process it doesnt find them.

I have the same problem.
The jars are definitely added using Development → Manage Jars…

But when my groovy script in my connector runs it fails with startup failed:
Script2.groovy: 7: unable to resolve class groovyx.net.http.HTTPBuilder
@ line 7, column 2.
import groovyx.net.http.HTTPBuilder

Did you manage to resolve this?

Restarting the workflow designer doesn’t help.
I cannot find any more documentation about adding dependencies.

Have you also added the jars to the tomcat lib folder?

In Studio this will be under \workspace\tomcat\lib (windows)

Adding them under Development → Manage Jars does not copy them to the folder…

regards