Groovy JsonBuilder throws NoClassDefFoundError when using camel-groovy component
Issue
Getting NoClassDefFoundError While working with JsonBuilder.toString() in Groovy code inside a Camel route, which runs inside Jboss Fuse 7 running on top of EAP 7.
The code looks like so:
def builder = new JsonBuilder()
builder {
'myField': myFieldVal
}
return builder.toString()
The builder.toString() method invocation produces the following error:
Caused by: java.lang.NoClassDefFoundError: Could not initialize class
groovy.json.internal.FastStringUtils
Environment
- RedHat JBoss Fuse
- 6.x
- RedHat JBoss EAP
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.