jhipster/jhipster-core

Underscores in UAA base name are allowed causing problems when running

Closed this issue · 0 comments

Overview of the issue

I'm able to generate a project from a .jh file with a baseName like xxx_uaa for the UAA microservice (or any other microservice). However, the microservices will run with an invalid hostname causing IllegalStateException: Request URI does not contain a valid hostname when contacting it.

Motivation for or Use Case

Well, it hurts to replace all microservices' names after generation. Also, if underscores can't be used for the reason mentioned above, maybe there should exist another way to prefix basenames? Hyphens would be a good candidate (not sure why they were suppressed in the past though).

Reproduce the error
  1. Create a microservice with an underscore in the name
  2. Create another microservice that uses @FeignClient("")
  3. Make a call to the FeignClient
Related issues

jhipster/generator-jhipster#3984

Suggest a Fix
  • Add error message when user tries to generate microservice with an underscore or illegal character according to URI spec in the service name.
  • Or... replace underscore with hyphen for hostnames
  • Or... 1st option + allow hyphens instead
JHipster Version(s)

JHipster v6.5.1

JHipster configuration

openjdk version "11.0.5" 2019-10-15
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.5+10)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.5+10, mixed mode)

git version 2.20.1

node: v12.13.1

npm: 6.13.4

yeoman: 3.1.1

Docker version 19.03.3, build a872fc2f86

docker-compose version 1.24.1, build 4667896b

  • Checking this box is mandatory (this is just to show you read everything)