简体   繁体   中英

Can't start jHipster microservice gateway out of box

So I've built a jHipster microservices gateway out of the box. I have jHipster 4.5.2. I have done nothing to it beyond answering the setup questions (you can see my answers below). I assigned it to run on localhost:8082. I also have installed Tomcat 8.5.15, which works; when I turn it on I see the server page at localhost:8080.

I have tried to run the gateway by doing the following:

/Users/jimstewart/apache-maven-3.3.9/bin/mvn -Pprod package
java -jar target/data-gateway-0.0.1-SNAPSHOT.war

When it tries to start up I get the following warning early on:

Could not locate PropertySource: I/O error on GET request for "http://localhost:8761/config/DataGateway/dev/master": Connection refused; nested exception is java.net.ConnectExc

But the Tomcat server is running: when I go to localhost:8080 the page is there.

There is a ton of boilerplate, hundreds of lines, so I won't copy them all. But in the following errors keep repeating

2017-06-03 22:48:58.671 ERROR 1271 --- [           main] c.n.d.s.t.d.RedirectingEurekaHttpClient  : Request execution error

2017-06-03 22:48:58.674  WARN 1271 --- [           main] 
c.n.d.s.t.d.RetryableEurekaHttpClient    : Request execution failed with 
message: java.net.ConnectException: Connection refused

2017-06-03 22:48:58.675 ERROR 1271 --- [           main] 
com.netflix.discovery.DiscoveryClient    : 
DiscoveryClient_DATAGATEWAY/DataGateway:5ee0c99cb98fec0674d7db2672260892 - was 
unable to refresh its cache! status = Cannot execute request on any known server

2017-06-03 22:49:17.689  WARN 1271 --- [nfoReplicator-0] 
c.n.d.s.t.d.RetryableEurekaHttpClient    : Request execution failed with message: java.net.ConnectException: Connection refused

Eventually it just shuts down without starting.

I've also tried to start it by running it from NetBeans. When I have Tomcat turned on, it quits because "Failed to start Tomcat: port 8080 is already in use." So, fine, start it with Tomcat turned off so it can turn it on itself. Then it won't start because "connection refused."

How can I get my app to start?

I answered the setup questions the following way:

What kind of application? Gateway application
What is the base name? DataGateway
Would you like to install other generators? No
Which port do you want to run it on? 8082
What is your default package name? com.kidslearntocode.datagateway
Do you want to use the jHipster registry? Yes
What kind of authentication? JWT
What type of database? SQL
What production database? mySQL
What development database? mySQL
Maven or Gradle? Maven
Which other technologies? None
Which framework? [beta] Angular 4
LibSass? Yes
Internationalization? No
Other languages? None

The error is indicated here:

Could not locate PropertySource: I/O error on GET request for "http://localhost:8761/config/DataGateway/dev/master": Connection refused; nested exception is java.net.ConnectExc

It means you didn't start the JHipster Registry. For that, you have 2 solutions:

1) with Docker, simply launch: docker-compose -f src/main/docker/jhipster-registry.yml up -d

2) clone the project https://github.com/jhipster/jhipster-registry , then yarn install and start the registry: ./mvwn

Then, try to log into the JHipster Registry at http://localhost:8761

More information at https://jhipster.github.io/api-gateway/

PS: I don't understand very well how you use Tomcat here, as your Gateway already uses embedded Undertow, so you don't need another server.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM