Hi,
Don't put jars in $SMX_HOME/lib, install them as bundles and use
correct OSGi metadata header.
In Servicemix 4.4.1, we ship groovy-all 1.8.5, so if you install camel-
groovy/camel-script/camel-script-groovy feature, this bundle is
already available for you, why you need install it yourself?
Freeman
On 2012-5-6, at 下午3:35, Eugen wrote:
Instead of manually specifying the imports myself I added the
groovy-1.8.5.jar to $SMX_HOME/lib/ext directory. Now the previous
error is
gone but I get another stack trace:
Caused by: org.apache.camel.FailedToCreateRouteException: Failed to
create
route Route_2_1_read_localOrders at: >>>
SetHeader[TransportationOrderID,
groovy{request.body.shipmentRequestID}] <<< in route:
Route[[From[jms:localInventoryOrders?maxConcurrentConsumers=...
because of
startup failed:
Could not instantiate global transform class
groovy.grape.GrabAnnotationTransformation specified at
jar:file:/E:/_Projects/_libs/apache-servicemix-4.4.1/lib/ext/
groovy-1.8.5.jar!/META-INF/services/
org.codehaus.groovy.transform.ASTTransformation
because of exception java.lang.ClassNotFoundException:
groovy.grape.GrabAnnotationTransformation
Could not instantiate global transform class
org.codehaus.groovy.ast.builder.AstBuilderTransformation specified at
jar:file:/E:/_Projects/_libs/apache-servicemix-4.4.1/lib/ext/
groovy-1.8.5.jar!/META-INF/services/
org.codehaus.groovy.transform.ASTTransformation
because of exception java.lang.ClassNotFoundException:
org.codehaus.groovy.ast.builder.AstBuilderTransformation
2 errors
at
org
.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:
820)
at
org
.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:
165)
at
org
.apache
.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:
697)
at
org
.apache
.camel
.impl
.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:
1681)
at
org
.apache
.camel
.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1468)
at
org
.apache
.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1365)
at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:67)
at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:54)
at
org
.apache
.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1333)
at
org
.apache
.camel
.blueprint
.BlueprintCamelContext.maybeStart(BlueprintCamelContext.java:88)
at
org
.apache
.camel
.blueprint.BlueprintCamelContext.init(BlueprintCamelContext.java:80)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:
1.6.0_31]
at
sun
.reflect
.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)[:
1.6.0_31]
at
sun
.reflect
.DelegatingMethodAccessorImpl
.invoke(DelegatingMethodAccessorImpl.java:25)[:1.6.0_31]
at java.lang.reflect.Method.invoke(Method.java:597)[:1.6.0_31]
at
org
.apache
.aries.blueprint.utils.ReflectionUtils.invoke(ReflectionUtils.java:
226)[10:org.apache.aries.blueprint:0.3.1]
at
org
.apache.aries.blueprint.container.BeanRecipe.invoke(BeanRecipe.java:
824)[10:org.apache.aries.blueprint:0.3.1]
at
org
.apache
.aries
.blueprint.container.BeanRecipe.runBeanProcInit(BeanRecipe.java:636)
[10:org.apache.aries.blueprint:0.3.1]
... 24 more
Caused by:
org.codehaus.groovy.control.MultipleCompilationErrorsException:
startup failed:
Could not instantiate global transform class
groovy.grape.GrabAnnotationTransformation specified at
jar:file:/E:/_Projects/_libs/apache-servicemix-4.4.1/lib/ext/
groovy-1.8.5.jar!/META-INF/services/
org.codehaus.groovy.transform.ASTTransformation
because of exception java.lang.ClassNotFoundException:
groovy.grape.GrabAnnotationTransformation
Could not instantiate global transform class
org.codehaus.groovy.ast.builder.AstBuilderTransformation specified at
jar:file:/E:/_Projects/_libs/apache-servicemix-4.4.1/lib/ext/
groovy-1.8.5.jar!/META-INF/services/
org.codehaus.groovy.transform.ASTTransformation
because of exception java.lang.ClassNotFoundException:
org.codehaus.groovy.ast.builder.AstBuilderTransformation
2 errors
at
org
.codehaus
.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:302)
[:1.8.5]
at
org
.codehaus
.groovy.control.ProcessingUnit.completePhase(ProcessingUnit.java:143)
[:1.8.5]
at
org
.codehaus
.groovy.control.ProcessingUnit.gotoPhase(ProcessingUnit.java:162)[:
1.8.5]
at
org
.codehaus
.groovy.control.CompilationUnit.compile(CompilationUnit.java:491)[:
1.8.5]
at
groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:
306)[:1.8.5]
at
groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:287)
[:1.8.5]
at
groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:267)
[:1.8.5]
at
groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:214)
[:1.8.5]
at
groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:224)
[:1.8.5]
at
org
.apache
.camel
.language.groovy.GroovyLanguage.parseExpression(GroovyLanguage.java:
44)
at
org
.apache
.camel
.language.groovy.GroovyLanguage.createExpression(GroovyLanguage.java:
38)
at
org
.apache
.camel
.language.groovy.GroovyLanguage.createExpression(GroovyLanguage.java:
27)
at
org
.apache
.camel
.model
.language
.ExpressionDefinition.createExpression(ExpressionDefinition.java:171)
at
org
.apache
.camel
.model
.language
.ExpressionDefinition.createExpression(ExpressionDefinition.java:161)
at
org
.apache
.camel
.model.SetHeaderDefinition.createProcessor(SetHeaderDefinition.java:
78)
at
org
.apache
.camel
.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:440)
at
org
.apache
.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:
183)
at
org
.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:
817)
... 41 more
--
View this message in context:
http://servicemix.396122.n5.nabble.com/How-to-enable-Camel-Groovy-in-ServiceMix-tp5688546p5688859.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
---------------------------------------------
Freeman Fang
FuseSource
Email:ff...@fusesource.com
Web: fusesource.com
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: http://weibo.com/u/1473905042