Reputation: 1
I've been trying out jHipster for the past few days and somehow I can't get a good application up-and-running in a dev environment. Individual components work but making it all work together is a nightmare.
The repositories I've created can be found here.
I'm lost and I don't know how to proceed. What I want is to create an API Gateway project + several microservices apps as separate projects in GitLab. Then I would like to run the app(s) locally to see if it works (I'm still learning) and if I can indeed access the API.
Nowhere in the API is documented how I can generate a valid JWT token to run tests against the API with curl or a REST client.
Some help is greatly appreciated here!
jhipster import-jdl blueImpactEngineApp.jh
to generate the projects.jhipster docker-compose
.mvn -Pdev com.google.cloud.tools:jib-maven-plugin:dockerBuild -Djib-maven-plugin.architecture=arm64
. I had to deliberately add the -Pdev
flag to ensure it uses the dev profile.docker-compose-dev.yml
file. I modified it to use h2Disk as the database and use a fixed database from that I stored in the project. I also added a mount point to mount the available database into the docker container.docker-compose -f docker-compose/docker-compose-dev.yml up
. This starts all the services correctly but the API Gateway is lacking a UI.http://localhost:8800/services/project/api/projects
. This returns a 401 so that seems to work. But I have no clue on how to get a valid JWT token to test the API.mvnw
but that fails to start since it wants to have the postgresql driver, even though it started the dev profile (I've selected Postgres as prod db and h2Disk as dev db).I would expect jHipster to provide me with a working system, after following documentation and online training resources but I haven't gotten anything that works.
mvnw
gives errors expecting the production db driver in the dev profilemvnw -Pdev clean verify install
builds and installs a jar file and not a war file. This results in the webapp not loading.localhost:8800
:{
"type" : "https://www.jhipster.tech/problem/problem-with-message",
"title" : "Not Found",
"status" : 404,
"detail" : "404 NOT_FOUND \"No static resource index.html.\"",
"instance" : "/index.html",
"message" : "error.http.404",
"path" : "http://localhost:8800/index.html"
}
docker-compose.yml
services:
blueimpactengine:
image: blueimpactengine
environment:
- _JAVA_OPTIONS=-Xmx512m -Xms256m
- SPRING_PROFILES_ACTIVE=dev,api-docs
- MANAGEMENT_PROMETHEUS_METRICS_EXPORT_ENABLED=true
- SPRING_CLOUD_CONSUL_HOST=consul
- SPRING_CLOUD_CONSUL_PORT=8500
ports:
- 8800:8800
volumes:
- ./h2db/dev/blueimpactengine:/target/h2db
healthcheck:
test:
- CMD
- curl
- -f
- http://localhost:8800/management/health
interval: 5s
timeout: 5s
retries: 40
project:
image: project
environment:
- _JAVA_OPTIONS=-Xmx512m -Xms256m
- SPRING_PROFILES_ACTIVE=dev,api-docs
- MANAGEMENT_PROMETHEUS_METRICS_EXPORT_ENABLED=true
- SPRING_CLOUD_CONSUL_HOST=consul
- SPRING_CLOUD_CONSUL_PORT=8500
volumes:
- ./h2db/dev/project:/target/h2db
healthcheck:
test:
- CMD
- curl
- -f
- http://localhost:8801/management/health
interval: 5s
timeout: 5s
retries: 40
consul:
image: docker.io/bitnami/consul:1.20.2
ports:
- 8300:8300
- 8500:8500
- 8600:8600
command: consul agent -dev -ui -client 0.0.0.0 -log-level=INFO
consul-config-loader:
image: jhipster/consul-config-loader:v0.4.1
volumes:
- ./central-server-config:/config
environment:
- INIT_SLEEP_SECONDS=5
- CONSUL_URL=consul
- CONSUL_PORT=8500
Upvotes: 0
Views: 13