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

Lambda processor doesn't work with JS routes #873

Closed
tadayosi opened this issue Jul 25, 2019 · 3 comments
Closed

Lambda processor doesn't work with JS routes #873

tadayosi opened this issue Jul 25, 2019 · 3 comments

Comments

@tadayosi
Copy link
Member

With Camel K Client 1.0.0-M1-SNAPSHOT, examples/routes.js doesn't work as follows:

$ kamel run --dev examples/routes.js
[...]
[1] 2019-07-25 02:36:45.686 WARN  [Camel (camel-k) thread #2 - timer://js] TimerConsumer - Error processing exchange. Exchange[ID-routes-5ccdc6b89-jl2c9-1564022203707-0-5]. Caused by: [java.lang.ClassCastException - java.lang.Object cannot be cast to com.oracle.truffle.polyglot.PolyglotLanguageContext]
[1] java.lang.ClassCastException: java.lang.Object cannot be cast to com.oracle.truffle.polyglot.PolyglotLanguageContext
[1] 	at com.oracle.truffle.polyglot.PolyglotLanguage$ContextProfile.profile(PolyglotLanguage.java:383) ~[org.graalvm.truffle.truffle-api-19.0.2.jar:?]
[1] 	at com.oracle.truffle.polyglot.HostToGuestRootNode.profileContext(HostToGuestRootNode.java:113) ~[org.graalvm.truffle.truffle-api-19.0.2.jar:?]
[1] 	at com.oracle.truffle.polyglot.HostToGuestRootNode.execute(HostToGuestRootNode.java:72) ~[org.graalvm.truffle.truffle-api-19.0.2.jar:?]
[1] 	at com.oracle.truffle.api.impl.DefaultCallTarget.call(DefaultCallTarget.java:102) ~[org.graalvm.truffle.truffle-api-19.0.2.jar:?]
[1] 	at com.oracle.truffle.polyglot.FunctionProxyHandler.invoke(HostInteropReflect.java:454) ~[org.graalvm.truffle.truffle-api-19.0.2.jar:?]
[1] 	at com.sun.proxy.$Proxy28.process(Unknown Source) ~[?:?]
[1] 	at org.apache.camel.support.processor.DelegateSyncProcessor.process(DelegateSyncProcessor.java:63) ~[org.apache.camel.camel-support-3.0.0-M4.jar:3.0.0-M4]
[1] 	at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$RedeliveryState.run(RedeliveryErrorHandler.java:480) ~[org.apache.camel.camel-base-3.0.0-M4.jar:3.0.0-M4]
[1] 	at org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:185) [org.apache.camel.camel-base-3.0.0-M4.jar:3.0.0-M4]
[1] 	at org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:59) [org.apache.camel.camel-base-3.0.0-M4.jar:3.0.0-M4]
[1] 	at org.apache.camel.processor.Pipeline.process(Pipeline.java:87) [org.apache.camel.camel-base-3.0.0-M4.jar:3.0.0-M4]
[1] 	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:222) [org.apache.camel.camel-base-3.0.0-M4.jar:3.0.0-M4]
[1] 	at org.apache.camel.component.timer.TimerConsumer.sendTimerExchange(TimerConsumer.java:193) [org.apache.camel.camel-timer-3.0.0-M4.jar:3.0.0-M4]
[1] 	at org.apache.camel.component.timer.TimerConsumer$1.run(TimerConsumer.java:75) [org.apache.camel.camel-timer-3.0.0-M4.jar:3.0.0-M4]
[1] 	at java.util.TimerThread.mainLoop(Timer.java:555) [?:1.8.0_191]
[1] 	at java.util.TimerThread.run(Timer.java:505) [?:1.8.0_191]
[1] Caused by: com.oracle.truffle.api.TruffleStackTrace$LazyStackTrace

The error comes from this part. Removing .process(proc) makes the route work.

function proc(e) {
    e.getIn().setHeader('RandomValue', Math.floor((Math.random() * 100) + 1))
}
[...]
    .process(proc)

See also: #589

@lburgazzoli
Copy link
Contributor

Looks like this bug oracle/graal#1247

@lburgazzoli
Copy link
Contributor

@tadayosi can you report runtime issues to https://github.com/apache/camel-k-runtime ?

@tadayosi
Copy link
Member Author

@lburgazzoli Oh, sure, will do from next time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants