Reproducing issue
spring-cloud/spring-cloud-config#1599
-
Build
config-service
project with maven. Use JDK 11, which is LTS.mvn clean install
-
Run config-service
docker-compose up
. -
Use POSTMAN, curl or another HTTP client. Note, Postman can sent default headers, including Accept. Please, make sure, you overwrite it then.
HTTP GET http://localhost:8888/service1/dev
Accept:application/vnd.spring-cloud.config-server.v2+json
HTTP GET http://localhost:8888/service1/dev
HTTP GET http://localhost:8888/service2/dev
Accept:application/vnd.spring-cloud.config-server.v2+json
HTTP GET http://localhost:8888/service2/dev
Response
{
"timestamp": "2020-04-26T17:27:11.755+0000",
"status": 500,
"error": "Internal Server Error",
"message": "Could not construct context for config=service2 profile=dev label=null includeOrigin=true; nested exception is java.lang.NullPointerException",
"path": "/service2/dev"
}
- "JAVA_OPTIONS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005"
ports:
- 5005:5005
config-service:
build:
context: "./config-service"
dockerfile: Dockerfile
container_name: config-service
volumes:
- "./configuration:/configuration:ro"
environment:
- "SPRING_PROFILE=native"
- "SPRING_CLOUD_CONFIG_PROFILE=dev"
- "GIT_REPOSITORY_URI=https://github.com/yan-khonski-it/spring-cloud-config-demo"
# Debug the service
- "JAVA_OPTIONS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005"
# Label
- "GIT_BRANCH=dev"
networks:
- scc-demo-network
ports:
- 8888:8888
# Open debug port
- 5005:5005