camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Charles Moulliard (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (CAMEL-7925) groovy and osgi - Could not initialize class script1413536396719697720774
Date Thu, 04 Dec 2014 09:06:13 GMT

    [ https://issues.apache.org/jira/browse/CAMEL-7925?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14234041#comment-14234041
] 

Charles Moulliard edited comment on CAMEL-7925 at 12/4/14 9:06 AM:
-------------------------------------------------------------------

I have redeployed my project on Apache Karaf 3.0.2 using Apache Camel 2.14.0 with Groovy 2.3.6
and another classloading issue is reported even if the class "groovy.lang.Script" is well
packaged with the bundle "Groovy Runtime" 

Error 

{code}
Caused by: java.lang.ClassNotFoundException: groovy.lang.Script
	at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
	at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:655)
	at groovy.lang.GroovyClassLoader$InnerLoader.loadClass(GroovyClassLoader.java:408)
	at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:765)
	at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:753)
	... 31 more

1 error

	at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:309)[122:groovy-all:2.3.6]
	at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1067)[122:groovy-all:2.3.6]
	at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:583)[122:groovy-all:2.3.6]
	at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:561)[122:groovy-all:2.3.6]
	at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:538)[122:groovy-all:2.3.6]
	at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:286)[122:groovy-all:2.3.6]
	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:259)[122:groovy-all:2.3.6]
	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:245)[122:groovy-all:2.3.6]
	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:203)[122:groovy-all:2.3.6]
	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:213)[122:groovy-all:2.3.6]
	at org.apache.camel.language.groovy.GroovyExpression.instantiateScript(GroovyExpression.java:65)[123:org.apache.camel.camel-groovy:2.14.0]
	at org.apache.camel.language.groovy.GroovyExpression.evaluate(GroovyExpression.java:50)[123:org.apache.camel.camel-groovy:2.14.0]
	at org.apache.camel.builder.ProcessorBuilder$4.process(ProcessorBuilder.java:103)[92:org.apache.camel.camel-core:2.14.0]
	at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)[92:org.apache.camel.camel-core:2.14.0]
	at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)[92:org.apache.camel.camel-core:2.14.0]
	at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:398)[92:org.apache.camel.camel-core:2.14.0]
	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)[92:org.apache.camel.camel-core:2.14.0]
	at org.apache.camel.processor.Pipeline.process(Pipeline.java:118)[92:org.apache.camel.camel-core:2.14.0]
	at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)[92:org.apache.camel.camel-core:2.14.0]
	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)[92:org.apache.camel.camel-core:2.14.0]
	at org.apache.camel.component.timer.TimerConsumer.sendTimerExchange(TimerConsumer.java:157)[92:org.apache.camel.camel-core:2.14.0]
	at org.apache.camel.component.timer.TimerConsumer$1.run(TimerConsumer.java:68)[92:org.apache.camel.camel-core:2.14.0]
	at java.util.TimerThread.mainLoop(Timer.java:555)[:1.7.0_51]
	at java.util.TimerThread.run(Timer.java:505)[:1.7.0_51]
{code}

What is deployed on Karaf 

{code}
 92 | Active   |  50 | 2.14.0         | mvn:org.apache.camel/camel-core/2.14.0
 93 | Active   |  50 | 2.14.0         | mvn:org.apache.camel.karaf/camel-karaf-commands/2.14.0
108 | Active   |  50 | 1.1.1          | mvn:org.apache.geronimo.specs/geronimo-jta_1.1_spec/1.1.1
109 | Active   |  50 | 2.14.0         | mvn:org.apache.camel/camel-spring/2.14.0
110 | Active   |  50 | 2.14.0         | mvn:org.apache.camel/camel-blueprint/2.14.0
120 | Active   |  50 | 1.7.0.6        | mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.ant/1.7.0_6
121 | Active   |  50 | 2.2.0          | mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.scripting-api-1.0/2.2.0
122 | Active   |  50 | 2.3.6          | mvn:org.codehaus.groovy/groovy-all/2.3.6
123 | Active   |  50 | 2.14.0         | mvn:org.apache.camel/camel-groovy/2.14.0
{code}


was (Author: cmoulliard):
I have redeployed my project on Apache Karaf 3.0.2 using Apache Camel 2.14.0 with Groovy 2.3.6
and another classloading issue is reported even if the class "groovy.lang.SCript" is well
packaged with the bundle "Grrovy Runtime" 

Error 

{code}
Caused by: java.lang.ClassNotFoundException: groovy.lang.Script
	at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
	at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:655)
	at groovy.lang.GroovyClassLoader$InnerLoader.loadClass(GroovyClassLoader.java:408)
	at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:765)
	at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:753)
	... 31 more

1 error

	at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:309)[122:groovy-all:2.3.6]
	at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1067)[122:groovy-all:2.3.6]
	at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:583)[122:groovy-all:2.3.6]
	at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:561)[122:groovy-all:2.3.6]
	at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:538)[122:groovy-all:2.3.6]
	at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:286)[122:groovy-all:2.3.6]
	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:259)[122:groovy-all:2.3.6]
	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:245)[122:groovy-all:2.3.6]
	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:203)[122:groovy-all:2.3.6]
	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:213)[122:groovy-all:2.3.6]
	at org.apache.camel.language.groovy.GroovyExpression.instantiateScript(GroovyExpression.java:65)[123:org.apache.camel.camel-groovy:2.14.0]
	at org.apache.camel.language.groovy.GroovyExpression.evaluate(GroovyExpression.java:50)[123:org.apache.camel.camel-groovy:2.14.0]
	at org.apache.camel.builder.ProcessorBuilder$4.process(ProcessorBuilder.java:103)[92:org.apache.camel.camel-core:2.14.0]
	at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)[92:org.apache.camel.camel-core:2.14.0]
	at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)[92:org.apache.camel.camel-core:2.14.0]
	at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:398)[92:org.apache.camel.camel-core:2.14.0]
	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)[92:org.apache.camel.camel-core:2.14.0]
	at org.apache.camel.processor.Pipeline.process(Pipeline.java:118)[92:org.apache.camel.camel-core:2.14.0]
	at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)[92:org.apache.camel.camel-core:2.14.0]
	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)[92:org.apache.camel.camel-core:2.14.0]
	at org.apache.camel.component.timer.TimerConsumer.sendTimerExchange(TimerConsumer.java:157)[92:org.apache.camel.camel-core:2.14.0]
	at org.apache.camel.component.timer.TimerConsumer$1.run(TimerConsumer.java:68)[92:org.apache.camel.camel-core:2.14.0]
	at java.util.TimerThread.mainLoop(Timer.java:555)[:1.7.0_51]
	at java.util.TimerThread.run(Timer.java:505)[:1.7.0_51]
{code}

What is deployed on Karaf 

{code}
 92 | Active   |  50 | 2.14.0         | mvn:org.apache.camel/camel-core/2.14.0
 93 | Active   |  50 | 2.14.0         | mvn:org.apache.camel.karaf/camel-karaf-commands/2.14.0
108 | Active   |  50 | 1.1.1          | mvn:org.apache.geronimo.specs/geronimo-jta_1.1_spec/1.1.1
109 | Active   |  50 | 2.14.0         | mvn:org.apache.camel/camel-spring/2.14.0
110 | Active   |  50 | 2.14.0         | mvn:org.apache.camel/camel-blueprint/2.14.0
120 | Active   |  50 | 1.7.0.6        | mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.ant/1.7.0_6
121 | Active   |  50 | 2.2.0          | mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.scripting-api-1.0/2.2.0
122 | Active   |  50 | 2.3.6          | mvn:org.codehaus.groovy/groovy-all/2.3.6
123 | Active   |  50 | 2.14.0         | mvn:org.apache.camel/camel-groovy/2.14.0
{code}

> groovy and osgi - Could not initialize class script1413536396719697720774
> -------------------------------------------------------------------------
>
>                 Key: CAMEL-7925
>                 URL: https://issues.apache.org/jira/browse/CAMEL-7925
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-groovy
>         Environment: Apache Karaf 2.2.x
>            Reporter: Charles Moulliard
>            Priority: Minor
>
> When a camel route is deployed on apache Karaf using a groovy expression to be evaluated
we get this error 
> https://gist.github.com/cmoulliard/7294122c47e9c18df399
> Route
> {code}
> 		from("direct:launch").routeId("request-token")
> 		
> 		.onException(HttpOperationFailedException.class)
> 		    .handled(true)
> 			.log("An error occurred")
> 		    .to("direct:interface-status")
> 		    .end()
> 		
> 		.setHeader(Exchange.HTTP_URI, constant(wayneUriGetSession))
> 		.setHeader(Exchange.HTTP_QUERY, constant("User=" + UserName + "&" + "Pass=" + Password))
> 		.setHeader(Exchange.HTTP_METHOD, constant("GET"))
> 		
> 		.to("https4://token-service")
> 		.convertBodyTo(String.class)
> 		.setHeader("token").groovy("body.replaceAll('\"','')")
> {code}
> {code}
> Caused by: java.lang.NoClassDefFoundError: Could not initialize class script1413536396719697720774
> 	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)[:1.7.0_51]
> 	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)[:1.7.0_51]
> 	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)[:1.7.0_51]
> 	at java.lang.reflect.Constructor.newInstance(Constructor.java:526)[:1.7.0_51]
> 	at java.lang.Class.newInstance(Class.java:374)[:1.7.0_51]
> 	at org.apache.camel.language.groovy.GroovyExpression.instantiateScript(GroovyExpression.java:71)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message