hi Federico,
Thanks, that was the missing part!
Thanks to both of you for the support 🙏🏾
For reference:
The rest component can be re-configured to use the same context path as
previously the camel-servlet:
restConfiguration()
.contextPath(
"/my-api“)
With this i don’t need other changes to my routes.
Alphonse
> Am 19.02.2024 um 10:22 schrieb Federico Mariani
> <[email protected]>:
>
> Hello, I am getting 404 on the standalone example.
>
> Beware that OOB camel-servlet and camel-platform-http uses different
> endpoints, camel-servlet */came/** while camel-platform-http */**
>
> Il giorno dom 18 feb 2024 alle ore 15:09 Alphonse Bendt <
> [email protected]> ha scritto:
>
>> Hi folks,
>>
>> There is an issue when running tests for a SpringBoot application that
>> uses camel-rest.
>>
>> When there are multiple tests that use a different configuration (e.g.,
>> different properties), we run into this error:
>>
>> Caused by:
>> jakarta.servlet.ServletException: Duplicate
>> ServletName detected: CamelServlet. Existing:
>> CamelHttpTransportServlet[name=CamelServlet] This:
>> CamelHttpTransportServlet[name=CamelServlet]. Its advised to use unique
>> ServletName per Camel application.
>> at
>> app//org.apache.camel.component.servlet.CamelHttpTransportServlet.init(CamelHttpTransportServlet.java:68)
>>
>>
>> I have created a standalone example to demonstrate the issue:
>> https://github.com/abendt/camel-rest
>>
>> To reproduce:
>> ./gradlew -i test
>>
>> The project contains two tests with different configurations (one has an
>> additional active profile).
>> I would expect the build to pass; however, it fails with the mentioned
>> exception.
>>
>> As a workaround, it's possible to add @DirtiesContext. However, this hurts
>> test performance and should be avoided if possible.
>>
>> Am i missing something or is this a current limitation of camel-rest?
>>
>> thanks,
>> Alphonse