Groovy script cannot find depenedencies

1
0
-1

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
2 answers

1
+2
-1

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

1
0
-1

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

Comments

Submitted by prayyapp on Fri, 04/25/2014 - 15:42

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?

Submitted by prayyapp on Fri, 04/25/2014 - 15:47

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.

Submitted by simon.vandersluis on Wed, 12/03/2014 - 03:55

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.

Submitted by Sean McP on Wed, 03/04/2015 - 08:06

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

Notifications