You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by GitBox <gi...@apache.org> on 2019/07/25 02:44:48 UTC
[GitHub] [camel-k] tadayosi opened a new issue #873: Lambda processor
doesn't work with JS routes
tadayosi opened a new issue #873: Lambda processor doesn't work with JS routes
URL: https://github.com/apache/camel-k/issues/873
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
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services