3

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:

enter image description here

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? :(

andreybleme
  • 689
  • 9
  • 23

2 Answers2

5

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/

sdoxsee
  • 4,451
  • 1
  • 25
  • 60
Andras Szell
  • 527
  • 2
  • 13
0

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);
  }

}
Purva
  • 383
  • 3
  • 10