Skip to content

Lighty Spring Boot Integration Problem  #1737

@ychechel

Description

@ychechel

Following your Spring integration instructions lighty-io-brings-opendaylight-to-spring-io-developers trying to make lighty RESTCONF and Spring-Web to co exist ON THE SAME PORT

RESTCONF working just fine!!!
http://127.0.0.1:8080/restconf/data/ietf-network-state:networks

The problem is with Spring MVC:
http://127.0.0.1:8080/cw/hello

The thing is that both RESTCONF Lighty Module and Spring-Web are both trying to boot up their own web server.

  • RESTCONF Lighty Module - Jetty
  • SpringWeb-Tomcat (configurable, can use also Jetty)

And obviously they collide on the same port .
I need to tell "RESTCONF Lighty Module " to use Spring-Web server, and i can not find a way to do that .

I can make them start on different ports:

package com.cisco.hco.isim.cnc;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(path = "/cw")
public class REST_API_Controller {
    
    @GetMapping(path = "/hello")
    public String serviceStatus() {
        return "Hi There";
    }
}

<html>

<head>
    <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1" />
    <title>Error 404 Not Found</title>
</head>

<body>
    <h2>HTTP ERROR 404 Not Found</h2>
    <table>
        <tr>
            <th>URI:</th>
            <td>/cw/hello</td>
        </tr>
        <tr>
            <th>STATUS:</th>
            <td>404</td>
        </tr>
        <tr>
            <th>MESSAGE:</th>
            <td>Not Found</td>
        </tr>
        <tr>
            <th>SERVLET:</th>
            <td>-</td>
        </tr>
    </table>
    <hr /><a href="https://eclipse.org/jetty">Powered by Jetty:// 9.4.52.v20230823</a>
    <hr />

</body>

</html>

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions