내 microservices 코어 프로젝트의 다음 컨트롤러가 :봄 부팅 RestController이 작동하지 않습니다
package com.XYZ.microservices.core.api.version;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/version")
public class VersionController {
@Autowired
private VersionService versionService;
@RequestMapping(method = RequestMethod.GET, produces = {MediaType.APPLICATION_JSON_VALUE})
public Version getVersion() {
return versionService.getVersion();
}
}
I 제품 서비스라는 또 다른 프로젝트가 있습니다. 나는이 같은 제품 서비스에 microservices 코어를 수입하고이 같은
dependencies {
compile("com.XYZ:microservices-core:1.0.0-RELEASE")
...
}
을 지금, 나는이 초기화하고 제품 서비스 응용 프로그램 : microservices 코어에
@SpringBootApplication
public class ProductServiceApplication {
public static void main(String[] args) {
SpringApplication.run(ProductServiceApplication.class, args);
}
}
클래스는 제품 -에서 사용할 수 있습니다 서비스. 하지만 product-service를 실행할 때 localhost : 8080/version을 얻을 수 없습니다. 누군가 도울 수 있습니까?
오류가 무엇을 얻고있는거야? 404? – developer
예 whitelabel 오류 페이지 – riship89
응용 프로그램을 시작할 때 출력에 표시되는 스프링 추적을 추가 할 수 있습니까? – Nico