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

Unexpected attribute '{http://camel.apache.org/schema/spring}uri' when using Rest XML with Quarkus 2.8.0.Final #3732

Closed
CynanX opened this issue Apr 16, 2022 · 2 comments

Comments

@CynanX
Copy link

CynanX commented Apr 16, 2022

I'm quite new to Camel so perhaps I'm using it wrong, however when using Quarkus 2.7.5.Final everything is working fine. Once I upgrade to Quarkus 2.8.0.Final then I get this exception upon start up:

ERROR [org.apa.cam.qua.mai.CamelMainRuntime] (main) Failed to start application: org.apache.camel.RuntimeCamelException: org.apache.camel.xml.io.XmlPullParserException: Unexpected attribute '{http://camel.apache.org/schema/spring}uri'
	at org.apache.camel.RuntimeCamelException.wrapRuntimeException(RuntimeCamelException.java:66)
	at org.apache.camel.support.service.BaseService.doFail(BaseService.java:413)
	at org.apache.camel.support.service.BaseService.fail(BaseService.java:342)
	at org.apache.camel.support.service.BaseService.init(BaseService.java:88)
	at org.apache.camel.quarkus.main.CamelMain.startEngine(CamelMain.java:137)
	at org.apache.camel.quarkus.main.CamelMainRuntime.start(CamelMainRuntime.java:49)
	at org.apache.camel.quarkus.core.CamelBootstrapRecorder.start(CamelBootstrapRecorder.java:45)
	at io.quarkus.deployment.steps.CamelBootstrapProcessor$boot173480958.deploy_0(Unknown Source)
	at io.quarkus.deployment.steps.CamelBootstrapProcessor$boot173480958.deploy(Unknown Source)
	at io.quarkus.runner.ApplicationImpl.doStart(Unknown Source)
	at io.quarkus.runtime.Application.start(Application.java:101)
	at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:103)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:67)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:41)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:120)
	at io.quarkus.runner.GeneratedMain.main(Unknown Source)
Caused by: org.apache.camel.xml.io.XmlPullParserException: Unexpected attribute '{http://camel.apache.org/schema/spring}uri'
	at org.apache.camel.xml.in.BaseParser.handleUnexpectedAttribute(BaseParser.java:203)
	at org.apache.camel.xml.in.BaseParser.doParse(BaseParser.java:110)
	at org.apache.camel.xml.in.ModelParser.doParsePostDefinition(ModelParser.java:2991)
	at org.apache.camel.xml.in.ModelParser.lambda$doParseRestDefinition$79(ModelParser.java:1103)
	at org.apache.camel.xml.in.BaseParser.doParse(BaseParser.java:126)
	at org.apache.camel.xml.in.ModelParser.doParseRestDefinition(ModelParser.java:1083)
	at org.apache.camel.xml.in.ModelParser.lambda$doParseRestsDefinition$217(ModelParser.java:3099)
	at org.apache.camel.xml.in.BaseParser.doParse(BaseParser.java:126)
	at org.apache.camel.xml.in.ModelParser.doParseRestsDefinition(ModelParser.java:3096)
	at org.apache.camel.xml.in.ModelParser.parseRestsDefinition(ModelParser.java:3077)
	at org.apache.camel.dsl.xml.io.XmlRoutesBuilderLoader$1.configure(XmlRoutesBuilderLoader.java:56)
	at org.apache.camel.builder.RouteBuilder.checkInitialized(RouteBuilder.java:633)
	at org.apache.camel.builder.RouteBuilder.configureRoutes(RouteBuilder.java:579)
	at org.apache.camel.builder.RouteBuilder.addRoutesToCamelContext(RouteBuilder.java:515)
	at org.apache.camel.impl.engine.AbstractCamelContext.addRoutes(AbstractCamelContext.java:1175)
	at org.apache.camel.main.RoutesConfigurer.addDiscoveredRoutes(RoutesConfigurer.java:238)
	at org.apache.camel.main.RoutesConfigurer.configureRoutes(RoutesConfigurer.java:213)
	at org.apache.camel.quarkus.main.CamelMain.configureRoutes(CamelMain.java:70)
	at org.apache.camel.main.BaseMainSupport.postProcessCamelContext(BaseMainSupport.java:590)
	at org.apache.camel.quarkus.main.CamelMain.initCamelContext(CamelMain.java:116)
	at org.apache.camel.quarkus.main.CamelMain.doInit(CamelMain.java:86)
	at org.apache.camel.support.service.BaseService.init(BaseService.java:83)
	... 12 more

In my pom I have this snippet:

<dependency>
      <groupId>org.apache.camel.quarkus</groupId>
      <artifactId>camel-quarkus-core</artifactId>
    </dependency>

    <dependency>
      <groupId>org.apache.camel.quarkus</groupId>
      <artifactId>camel-quarkus-rest</artifactId>
    </dependency>

    <dependency>
      <groupId>org.apache.camel.quarkus</groupId>
      <artifactId>camel-quarkus-http</artifactId>
    </dependency>

    <dependency>
      <groupId>org.apache.camel.quarkus</groupId>
      <artifactId>camel-quarkus-xml-io-dsl</artifactId>
    </dependency>

And in my application.properites file I have:

camel.main.routes-include-pattern=file:config/my-rests.xml,file:config/my-routes.xml

my-rests.xml looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<rests xmlns="http://camel.apache.org/schema/spring">
    <rest path="/">
        <post uri="/path/{name}" consumes="application/xml" produces="application/xml">
            <to uri="direct:my-route"/>
        </post>
    </rest>
</rests>

and my-routes.xml looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns="http://camel.apache.org/schema/spring"
        xsi:schemaLocation="
            http://camel.apache.org/schema/spring
            https://camel.apache.org/schema/spring/camel-spring.xsd">

    <route>
        <from uri="direct:my-route"/>
        <toD uri="https://${header.name}.some.path?bridgeEndpoint=true"/>
    </route>
</routes>

Is this me using it wrong, or is there an issue?

Thank you for your help.

@davsclaus
Copy link
Contributor

See the Camel 3.16 upgrade guides
https://camel.apache.org/manual/camel-3x-upgrade-guide-3_16.html#_renamed_uri_to_path

@CynanX
Copy link
Author

CynanX commented Apr 16, 2022

Thank you!

@CynanX CynanX closed this as completed Apr 16, 2022
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