Calling EasyB in an application

5 views
Skip to first unread message

ajo

unread,
Nov 2, 2009, 6:10:01 AM11/2/09
to Easyb Users
Hi,

I have the sad position that I'm not able to download the source code
from here, so a general question:

Is the following scenario possible and how:

I have an UI with a button. When the button is pressed, some stories
are run and the report is printed into a textfield.

This leads me to the following question:

Is there a way to call the BehaviorRunner directly (without
BehaviorRunner.main()) and getting the report as a string ? (or only
via "write to text file and read it back")

Thanks for any help
ajo

Andy

unread,
Nov 2, 2009, 4:36:15 PM11/2/09
to Easyb Users
Yes, you can create an instance of the BehaviorRunner class and call
the runBehaviors method -- the main method in the BehaviorRunner does
this. You'll need to provide a Configuration and a listener --- and a
report will be generated based upon the report(s) you specify in the
Configuration.

ajo

unread,
Nov 6, 2009, 2:34:58 AM11/6/09
to Easyb Users
yeah i thought so... thanks for the answer !

ajo

unread,
Nov 6, 2009, 10:11:40 AM11/6/09
to Easyb Users
sorry for spamming ;-)

classloader problem is solved... still having other issues but hope to
resolve them soon :)

ajo

unread,
Nov 6, 2009, 9:38:32 AM11/6/09
to Easyb Users
I have to continue on that.

Basically I want to run this in a server environment.

So I deploy easyb and my application to the server (own server system)
with the libs

The run fails with

java.lang.NoClassDefFoundError: groovy.lang.Script
at java.lang.ClassLoader.defineClassImpl(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:265)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:
69)
at groovy.lang.GroovyClassLoader.access$200(GroovyClassLoader.java:
54)
at groovy.lang.GroovyClassLoader$ClassCollector.createClass
(GroovyClassLoader.java:482)
at groovy.lang.GroovyClassLoader$ClassCollector.onClassNode
(GroovyClassLoader.java:499)
at groovy.lang.GroovyClassLoader$ClassCollector.call
(GroovyClassLoader.java:503)

this seams like it finds the groovy.jar but then fails to load the
correct class...

Is there a special way to manipulate the classloader ? I have no idea
about classloader so I actually have no idea how trivial or complex
this is...

Any possible hints ?
On 6 Nov., 08:34, ajo <andreas.joec...@googlemail.com> wrote:

Andy

unread,
Nov 6, 2009, 10:26:14 AM11/6/09
to Easyb Users
Wow, that's strange -- the script you are attempting to run -- does it
have dependencies to some other binaries? Maybe they aren't being
found? Have you tried to run a basic script that has no dependencies?
Make sure that your Groovy jar is 1.6.5 -- while you aren't using the
commandline, do you have the CLI jar in your classpath?
Reply all
Reply to author
Forward
0 new messages