robertofabrizi commented on issue #4200:
URL: https://github.com/apache/camel-k/issues/4200#issuecomment-1500211119
@squakez While figuring out the issue on the environment above, I've
deployed a new environment on GKE, and there I managed to build the
hello.groovy example as native just fine, but then failed to build this
Integration. Sadly the log appears to tell me nothing about the issue. This is
the yaml:
`
# camel-k: dependency=mvn:org.apache.camel.quarkus:camel-quarkus-jacksonxml
# camel-k: dependency=mvn:org.apache.camel.quarkus:camel-quarkus-jackson
# camel-k: resource=file:/home/r_fabrizi83/karavan/tests/json2xml-3.xsl
# camel-k: trait=quarkus.package-type=native
- rest:
post:
- consumes: application/json
produces: application/xml
to: direct:post
path: /customer
param:
- name: queryparam1
type: query
dataType: string
get:
- produces: application/json
to: direct:get
path: /customers/{name}
- route:
from:
uri: direct:get
steps:
- setBody:
expression:
simple:
expression: '{"name": "${header.name}"}'
- setHeader:
name: Content-Type
expression:
constant:
expression: application/json
- to:
uri: log:yaml
parameters:
showBodyType: false
showExchangePattern: false
- route:
from:
uri: direct:post
steps:
- setHeader:
name: Content-Type
expression:
constant:
expression: application/xml
- to:
uri: log:yaml
parameters:
showBodyType: false
showExchangePattern: false
- setHeader:
name: javaInfo
expression:
simple:
expression: "java.vendor: {{java.vendor}}, java.version:
{{java.version}}, os.arch: {{os.arch}}, os.name: {{os.name}}, os.version:
{{os.version}}"
trim: false
#- convertBodyTo:
# type: com.fasterxml.jackson.databind.JsonNode
- marshal:
jacksonXml:
useList: true
- to:
uri: log:yaml
parameters:
showBodyType: false
showExchangePattern: false
- to:
uri: xslt:file:/etc/camel/resources/json2xml-3.xsl
- to:
uri: log:yaml
parameters:
showBodyType: false
showExchangePattern: false
`
This is the referenced xsl:
`<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:fn="http://www.w3.org/2005/xpath-functions">
<xsl:output method="xml" omit-xml-declaration="no"
indent="yes" />
<xsl:param name="queryparam1" />
<xsl:param name="javaInfo" />
<xsl:template match="/ObjectNode">
<xsl:element name="xml">
<xsl:element name="header">
<xsl:element name="queryparam1">
<xsl:value-of select='$queryparam1'
/>
</xsl:element>
<xsl:element name="jvm">
<xsl:value-of select='$javaInfo' />
</xsl:element>
</xsl:element>
<xsl:element name="body">
<xsl:copy-of select="./*[1]"/>
</xsl:element>
</xsl:element>
</xsl:template>
<xsl:template match="/fn:map">
<xsl:element name="xml">
<xsl:element name="pippo">
<xsl:value-of
select='./fn:string[@key="pippo"]' />
</xsl:element>
<xsl:element name="queryparam1">
<xsl:value-of select='$queryparam1' />
</xsl:element>
<xsl:element name="jvm">
<xsl:value-of select='$javaInfo' />
</xsl:element>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
`
This is the command to start it up:
`kamel run json2xml-3-native.yaml --dev
This is the only error that I see in the operator log:
`{
"level": "error",
"ts": 1680865949.0255744,
"msg": "Reconciler error",
"controller": "integration-controller",
"controllerGroup": "camel.apache.org",
"controllerKind": "Integration",
"Integration": {
"name": "json2xml-3-native",
"namespace": "default"
},
"namespace": "default",
"name": "json2xml-3-native",
"reconcileID": "80353b0b-274f-434e-b340-008dc15d16db",
"error": "error during trait customization: unable tofind integration
container: json2xml-3-native",
"errorVerbose": "unable to find integration container:
json2xml-3-native\nerror during trait
customization\ngithub.com/apache/camel-k/pkg/trait.Apply\n\tgithub.com/apache/camel-k/pkg/trait/trait.go:59\ngithub.com/apache/camel-k/pkg/controller/integration.(*monitorAction).Handle\n\tgithub.com/apache/camel-k/pkg/controller/integration/monitor.go:114\ngithub.com/apache/camel-k/pkg/controller/integration.(*reconcileIntegration).Reconcile\n\tgithub.com/apache/camel-k/pkg/controller/integration/integration_controller.go:361\ngithub.com/apache/camel-k/pkg/util/monitoring.(*instrumentedReconciler).Reconcile\n\tgithub.com/apache/camel-k/pkg/util/monitoring/controller.go:70\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile\n\tsigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:121\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\tsigs.k8s.io/[email protected]/pkg/internal/controller/cont
roller.go:320\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\tsigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:273\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2\n\tsigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:234\nruntime.goexit\n\truntime/asm_amd64.s:1571",
"stacktrace":
"sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\tsigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:326\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\tsigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:273\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2\n\tsigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:234"
}`
If I remove this trait from the yaml: # camel-k:
trait=quarkus.package-type=native it works just fine.
I checked that the two dependencies listed are labeled as supporting native
builds.
Thank you very much everyone!
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]