-
카테고리
-
세부 분야
백엔드
-
해결 여부
미해결
127.0.0.1:8000/order-service/fcec75e5-6858-4112-8659-34000efd1988/orders
23.01.30 21:51 작성 조회수 75
0
본 챕터 강의에 있는 모든 코드를 정상적으로 입력하였는데, 포스트맨으로 테스트시 에러가 발생합니다.
--- 포스트맨 입력 값 ---
POST 127.0.0.1:8000/order-service/fcec75e5-6858-4112-8659-34000efd1988/orders
{ "productId": "CATALOG-001", "qty": 10, "unitPrice": 1500 }
--- 포스트맨 반환 값 ---
{
"timestamp": "2023-01-30T12:44:33.233+00:00",
"status": 404,
"error": "Not Found",
"message": "No message available",
"path": "/order-service/fcec75e5-6858-4112-8659-34000efd1988/orders"
}
답변을 작성해보세요.
1
Dowon Lee
23.01.31 08:36
안녕하세요, 이도원입니다.
먼저, 해당 POST에 대한 요청을 order-service를 apigateway-service를 거치지 않고, 직접 요청했을 때에 대한 결과를 확인해 보시기 바랍니다. order-service에 대한 문제인지, apigateway-service에 order-service에 대한 router 설정이 잘못 된 것이진 문제를 확인해 봐야 할 것 같습니다. 오류 메시지에서 404 오류라는 코드를 봤을 때는 apigateway-service의 설정을 확인해 보시면 좋을 것 같습니다. 등록하신 application.yml 파일을 공유해 주시면, 원인을 같이 찾아보도록 하겠습니다.
감사합니다.

쾌활한 참새
23.02.13 17:48
확인 감사합니다 ㅠㅠ
apigateway-service를 거치지 않고, 직접 요청해도 동일한 에러가 발생합니다...
아래 코드는 order-service 의 application.yml 파일의 코드입니다.
server:
port: 0
spring:
application:
name: order-service
h2:
console:
enabled: true
settings:
web-allow-others: true
path: /h2-console
jpa:
hibernate:
ddl-auto: update
datasource:
driver-class-name: org.h2.Driver
url: jdbc:h2:mem:testdb
eureka:
instance:
instance-id: ${spring.application.name}:${spring.application.instance_id:${random.value}}
client:
register-with-eureka: true
fetch-registry: true
service-url:
defaultZone: http://127.0.0.1:8761/eureka
logging:
level:
com.example.orderservice: DEBUG
답변 1