smooks and groovy: exception when evaling

View: New views
1 Messages — Rating Filter:   Alert me  

smooks and groovy: exception when evaling

by Michael Petritsch-2 :: Rate this Message:

| View Threaded | Show Only this Message

Hi,

I have a problem that groovy's eval suddenly doesn't work when I am running my app in osgi-context.

The same script works well in Unit tests, but when I do it in osgi I get the following exception:

Caused by: groovy.lang.MissingPropertyException: No such property: Eval for class: org.milyn.smooks.scripting.groovy.SmooksVisitor_628816383_1

The script code that fails is the following:

def f = new File('massiveAmountOfData'); //just a huge plain text groovy object/array
def data = Eval.me(f.getText());

Do you have an idea what the problem is or do you know any other way to get a huge groovy object into a script without triggering the maximum method length error?

Btw this how I initialize smooks in both cases:

if (bundleContext == null) {
    smooks = new Smooks(new ByteArrayInputStream(config.getBytes()));
} else {
    smooks = new SmooksOSGIFactory(bundleContext.getBundle()).createInstance(new ByteArrayInputStream(config.getBytes()));
}

best regards,
Michael