Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to run Knative integration #1169

Closed
kameshsampath opened this issue Dec 20, 2019 · 3 comments
Closed

Unable to run Knative integration #1169

kameshsampath opened this issue Dec 20, 2019 · 3 comments
Labels
status/waiting-for-feedback Needs some feedback

Comments

@kameshsampath
Copy link
Contributor

Platform : kamel Camel K Client 1.0.0-M4 on minikube 1.6.x using Knative serving/eventing v0.11.0 and CamelSource v0.10.3

When I try to deploy this JS integration

from('knative:channel/camel-test-channel')
    .convertBodyTo(String.class)
    .to('log:info');

I get the following error when integrtion is started.

Dev Mode -- [1] Exception in thread "main" org.graalvm.polyglot.PolyglotException
Dev Mode -- [2] Exception in thread "main" org.graalvm.polyglot.PolyglotException
Dev Mode -- [2] 	at org.apache.camel.model.ConvertBodyDefinition.<init>(ConvertBodyDefinition.java:50)
[2] 	at org.apache.camel.model.ProcessorDefinition.convertBodyTo(ProcessorDefinition.java:2905)
[2] 	at <js> :program(Unnamed:1-2:15-89)
Dev Mode -- [2] 	at org.graalvm.polyglot.Context.eval(Context.java:370)
[2] 	at org.apache.camel.k.loader.js.JavaScriptRoutesLoader$1.configure(JavaScriptRoutesLoader.java:59)
[2] 	at org.apache.camel.builder.RouteBuilder.checkInitialized(RouteBuilder.java:471)
[2] 	at org.apache.camel.builder.RouteBuilder.configureRoutes(RouteBuilder.java:438)
[2] 	at org.apache.camel.builder.RouteBuilder.addRoutesToCamelContext(RouteBuilder.java:418)
Dev Mode -- [2] 	at org.apache.camel.impl.engine.AbstractCamelContext.lambda$addRoutes$0(AbstractCamelContext.java:1114)
Dev Mode -- [1] 	at org.apache.camel.model.ConvertBodyDefinition.<init>(ConvertBodyDefinition.java:50)
[1] 	at org.apache.camel.model.ProcessorDefinition.convertBodyTo(ProcessorDefinition.java:2905)
Dev Mode -- [1] 	at <js> :program(Unnamed:1-2:15-89)
[1] 	at org.graalvm.polyglot.Context.eval(Context.java:370)
Dev Mode -- [1] 	at org.apache.camel.k.loader.js.JavaScriptRoutesLoader$1.configure(JavaScriptRoutesLoader.java:59)
[1] 	at org.apache.camel.builder.RouteBuilder.checkInitialized(RouteBuilder.java:471)
Dev Mode -- [2] 	at org.apache.camel.impl.engine.AbstractCamelContext.doWithDefinedClassLoader(AbstractCamelContext.java:2455)
Dev Mode -- [1] 	at org.apache.camel.builder.RouteBuilder.configureRoutes(RouteBuilder.java:438)
Dev Mode -- [1] 	at org.apache.camel.builder.RouteBuilder.addRoutesToCamelContext(RouteBuilder.java:418)
[1] 	at org.apache.camel.impl.engine.AbstractCamelContext.lambda$addRoutes$0(AbstractCamelContext.java:1114)
[1] 	at org.apache.camel.impl.engine.AbstractCamelContext.doWithDefinedClassLoader(AbstractCamelContext.java:2455)
Dev Mode -- [2] 	at org.apache.camel.impl.engine.AbstractCamelContext.addRoutes(AbstractCamelContext.java:1114)
[2] 	at org.apache.camel.main.RoutesConfigurer.configureRoutes(RoutesConfigurer.java:84)
[2] 	at org.apache.camel.main.BaseMainSupport.postProcessCamelContext(BaseMainSupport.java:549)
[2] 	at org.apache.camel.main.BaseMainSupport.initCamelContext(BaseMainSupport.java:402)
Dev Mode -- [2] 	at org.apache.camel.k.main.ApplicationRuntime$MainAdapter.doInit(ApplicationRuntime.java:168)
Dev Mode -- [2] 	at org.apache.camel.support.service.ServiceSupport.init(ServiceSupport.java:62)
[2] 	at org.apache.camel.support.service.ServiceSupport.start(ServiceSupport.java:90)
[2] 	at org.apache.camel.main.MainSupport.run(MainSupport.java:77)
Dev Mode -- [1] 	at org.apache.camel.impl.engine.AbstractCamelContext.addRoutes(AbstractCamelContext.java:1114)
[1] 	at org.apache.camel.main.RoutesConfigurer.configureRoutes(RoutesConfigurer.java:84)
Dev Mode -- [1] 	at org.apache.camel.main.BaseMainSupport.postProcessCamelContext(BaseMainSupport.java:549)
Dev Mode -- [1] 	at org.apache.camel.main.BaseMainSupport.initCamelContext(BaseMainSupport.java:402)
[1] 	at org.apache.camel.k.main.ApplicationRuntime$MainAdapter.doInit(ApplicationRuntime.java:168)
[1] 	at org.apache.camel.support.service.ServiceSupport.init(ServiceSupport.java:62)
Dev Mode -- [1] 	at org.apache.camel.support.service.ServiceSupport.start(ServiceSupport.java:90)
[1] 	at org.apache.camel.main.MainSupport.run(MainSupport.java:77)
[1] 	at org.apache.camel.k.main.ApplicationRuntime.run(ApplicationRuntime.java:70)
[1] 	at org.apache.camel.k.main.Application.main(Application.java:42)
Dev Mode -- [1] Caused by host exception: java.lang.NullPointerException
Dev Mode -- [2] 	at org.apache.camel.k.main.ApplicationRuntime.run(ApplicationRuntime.java:70)
Dev Mode -- [2] 	at org.apache.camel.k.main.Application.main(Application.java:42)
Dev Mode -- [2] Caused by host exception: java.lang.NullPointerException
Dev Mode -- [2] 2019-12-20 13:35:30.295 �[32mINFO �[m [Camel Thread #0 - CamelHangupInterceptor] MainSupport$HangupInterceptor - Received hang up - stopping the main instance.
Dev Mode -- [1] 2019-12-20 13:35:30.295 �[32mINFO �[m [Camel Thread #0 - CamelHangupInterceptor] MainSupport$HangupInterceptor - Received hang up - stopping the main instance.
@lburgazzoli
Copy link
Contributor

lburgazzoli commented Jan 1, 2020

As you are using JavaScript, you can't use convertBodyTo(String.class) as you would do in Java but you need to follow the graaljs interoperability guides, see https://github.com/graalvm/graaljs/blob/master/docs/user/JavaInterop.md#class-access

@lburgazzoli
Copy link
Contributor

@kameshsampath is this still an issue ?

@lburgazzoli lburgazzoli added the status/waiting-for-feedback Needs some feedback label Jun 5, 2020
@kameshsampath
Copy link
Contributor Author

kameshsampath commented Jun 5, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/waiting-for-feedback Needs some feedback
Projects
None yet
Development

No branches or pull requests

2 participants