Hi,

I have this route and the problem:

019-12-09 15:00:44.673  INFO 82720 --- [           main] 
o.a.c.c.mongodb3.MongoDbEndpoint         : Initialising MongoDb endpoint: 
mongodb3://mongo?collection=magento.order.in.rest&database=genisys&operation=insert
2019-12-09 15:00:44.702  INFO 82720 --- [           main] 
o.a.camel.spring.boot.RoutesCollector    : Starting CamelMainRunController to 
ensure the main thread keeps running
2019-12-09 15:00:44.720  INFO 82720 --- [           main] 
o.a.c.util.jsse.SSLContextParameters     : Available providers: SUN version 1.8.
2019-12-09 15:00:45.070  INFO 82720 --- [           main] 
o.a.c.util.jsse.SSLContextParameters     : Available providers: SUN version 1.8.
2019-12-09 15:00:45.281  INFO 82720 --- [           main] 
o.a.c.c.undertow.DefaultUndertowHost     : Starting Undertow server on 
https://localhost:8443
2019-12-09 15:00:45.303  INFO 82720 --- [           main] org.xnio              
                   : XNIO version 3.3.8.Final
2019-12-09 15:00:45.322  INFO 82720 --- [           main] org.xnio.nio          
                   : XNIO NIO Implementation Version 3.3.8.Final
2019-12-09 15:00:45.442  INFO 82720 --- [           main] 
o.a.camel.spring.SpringCamelContext      : Route: route1 started and consuming 
from: 
https://localhost:8443/v1/order?chunked=true&httpMethodRestrict=PUT%2COPTIONS&matchOnUriPrefix=false&optionsEnabled=true
2019-12-09 15:00:45.443  INFO 82720 --- [           main] 
o.a.c.c.undertow.DefaultUndertowHost     : Starting Undertow server on 
https://localhost:8443
2019-12-09 15:00:45.446  WARN 82720 --- [           main] 
o.a.c.c.undertow.DefaultUndertowHost     : Failed to start Undertow server on 
https://localhost:8443, reason: java.net.BindException: Address already in use

It starts twice.

RestControllerRouteBuilder:

// Setup
restConfiguration().apiContextRouteId("swagger")
    .component("undertow")
    .host("localhost")
    .port("{{http.port}}")
    .bindingMode(RestBindingMode.json)
    .scheme("https")
    .dataFormatProperty("prettyPrint", "true")
        .apiContextPath("/api-doc")
    .enableCORS(true)
    .corsHeaderProperty("Access-Control-Allow-Headers", "Origin, Accept, 
X-Requested-With, Content-Type, Access-Control-Request-Method, 
Access-Control-Request-Headers, Authorization")
    .apiContextPath("/v1/swagger")
        .apiProperty("api.title", "Order import API")
        .apiProperty("api.version", "1.0.0")
        .apiProperty("cors", "true")
    .endpointProperty("chunked", "true")
;

And this pom.xml

<dependencies>

  <!-- Spring-boot -->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
        <exclusions>
            <!-- Exclude the Tomcat dependency -->
            <exclusion>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-tomcat</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-undertow</artifactId>
    </dependency>

<!-- Camel -->
    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-swagger-java-starter</artifactId>
    </dependency>
    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-servlet-starter</artifactId>
    </dependency>
    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-spring-boot-starter</artifactId>
        <version>${camel.version}</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.apache.camel/camel-jackson -->
    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-jackson</artifactId>
        <version>${camel.version}</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-servlet</artifactId>
        <version>${camel.version}</version>
        <!-- use the same version as your Camel core version -->
    </dependency>
    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-spring</artifactId>
        <version>${camel.version}</version>
    </dependency>
    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-core</artifactId>
        <version>${camel.version}</version>
    </dependency>
    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-mongodb3</artifactId>
        <version>${camel.version}</version>
    </dependency>
    <dependency>
        <groupId>org.apache.activemq</groupId>
        <artifactId>activemq-camel</artifactId>
    </dependency>
    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-undertow</artifactId>
        <version>${camel.version}</version>
    </dependency>


    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-swagger-java</artifactId>
        <version>${camel.version}</version>
    </dependency>

    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-spring-security</artifactId>
        <version>${camel.version}</version>
    </dependency>


    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-servlet</artifactId>
        <version>${camel.version}</version>
    </dependency>





    <!-- Database Migration -->
    <dependency>
        <groupId>com.github.mongobee</groupId>
        <artifactId>mongobee</artifactId>
        <version>${mongobee.version}</version>
    </dependency>

    <!-- Endpoints for Monitoring -->
   <!--
   <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-actuator</artifactId>
    </dependency>    -->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-security</artifactId>
    </dependency>


    <!-- Dependencies for Tests -->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-test-spring</artifactId>
        <scope>test</scope>
    </dependency>

    <!-- Other imports-->
    <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpcore</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-web</artifactId>
    </dependency>
    <dependency>
        <groupId>commons-codec</groupId>
        <artifactId>commons-codec</artifactId>
    </dependency>

</dependencies>

Maybe anybody can help me to fix this issue

Thx and kind regards

Tobias

Reply via email to