You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "lsergio (via GitHub)" <gi...@apache.org> on 2023/05/17 14:16:40 UTC
[GitHub] [camel-k] lsergio opened a new issue, #4385: No such property: header for class: Script1
lsergio opened a new issue, #4385:
URL: https://github.com/apache/camel-k/issues/4385
I'm trying to create a basic Integration with toD and dynamic properties, like this:
`apiVersion: camel.apache.org/v1
kind: Integration
metadata:
name: test
spec:
sources:
- name: main.groovy
content: |-
rest("/test")
.get()
.to("direct:start");
from("direct:start")
.toD("${header.foo}");
`
as described at https://camel.apache.org/components/3.20.x/eips/toD-eip.html
But the integration creation fails with:
`2023-05-17 14:08:30,037 ERROR [io.qua.run.Application] (main) Failed to start application (with profile [prod]): groovy.lang.MissingPropertyException: No such property: header for class: Script1
[1] at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:65)
[1] at org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:51)
[1] at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:341)
[1] at Script1.run(Script1.groovy:5)
`
I get a similar error with ${body[id]} and possibily other examples.
Using Camel K 1.12.0
Should this work?
--
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.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-k] lsergio commented on issue #4385: No such property: header for class: Script1
Posted by "lsergio (via GitHub)" <gi...@apache.org>.
lsergio commented on issue #4385:
URL: https://github.com/apache/camel-k/issues/4385#issuecomment-1551513419
Thanks, @lburgazzoli . It worked now!
--
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.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-k] lsergio closed issue #4385: No such property: header for class: Script1
Posted by "lsergio (via GitHub)" <gi...@apache.org>.
lsergio closed issue #4385: No such property: header for class: Script1
URL: https://github.com/apache/camel-k/issues/4385
--
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.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-k] lburgazzoli commented on issue #4385: No such property: header for class: Script1
Posted by "lburgazzoli (via GitHub)" <gi...@apache.org>.
lburgazzoli commented on issue #4385:
URL: https://github.com/apache/camel-k/issues/4385#issuecomment-1551503412
as this is groovy, if you are usong double quoted strings, they are interpreted as gstrings and interpolated by groovy.
in your case, you should use single quoted strings, like '${header.foo}'
--
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.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org