Reputation: 689
After generationg successfully a new Jshipster 3 application, I'm having trouble to serve the application using gulp serve
.
I'm using Ubuntu 16.04 and npm 3.9
and when I try to run gulp serve
, I get this error:
And when I access http://localhost:9000/
I get the following message on the browser:
Error: connect ECONNREFUSED 127.0.0.1:8080
at Object.exports._errnoException (util.js:870:11)
at exports._exceptionWithHostPort (util.js:893:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1063:14)
Any advices? :(
Upvotes: 3
Views: 1601
Reputation: 411
add @ComponentScan annotation and base package name
@ComponentScan(basePackages={"com.example"})
see below code.
package com.example.SampleProject;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
@SpringBootApplication
@ComponentScan(basePackages={"com.example"})
public class SampleProjectApplication {
public static void main(String[] args) {
SpringApplication.run(SampleProjectApplication.class, args);
}
}
Upvotes: 0
Reputation: 527
The error says that gulp cannot connect to the backend on the 127.0.0.1:8080
address, which most likely mean that you haven't started the backend.
You should start the Spring application using the mvn spring-boot:run
or mvn
command, which starts the application on the http://localhost:8080
address.
Read more here: https://jhipster.github.io/development/
Upvotes: 5