Hi Team. I am trying hands on in micro services with spring cloud. I have 1 acting microservices deployed in local host on port 8303. i have Eureka server deployed in 8302. Eureka server is acting as Zuul proxy as well. When I am trying to access business logic in eurka server all is good but when i try to access other micro service deployed on 8083 it gives me

Mon Jul 08 13:41:56 SGT 2019 There was an unexpected error (type=Not Found, status=404). No message available

From Eureka dashboard I can see service(8303) is registered. Direct access via rest endpoints are also working.

Eureka Server application yml:

server:
  port: 8302

eureka:
  server:
    peer-eureka-status-refresh-time-interval-ms: 10000
  client:
    registerWithEureka: false
    fetchRegistry: false
#    server:
  #    waitTimeInMsWhenSyncEmpty: 0
    serviceUrl:
      defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/
  instance:
    hostname: localhost

zuul:
 prefix: /api


Eureka Client application.yml:
server:
  port: 8303


eureka:
  client:
    registerWithEureka: true
    fetchRegistry: true
    serviceUrl:
      defaultZone: http://localhost:8302/eureka/
  instance:
    hostname: localhost

form service action from UI:

- this is correct as per registered in Eureka server.

Any help would be appreciated.

Thanks Anand

Comment From: ryanjbaxter

Please learn how to format code on GitHub.

I cannot tell why you are getting a 404 based on the description you provided. In general we recommend the Eureka server being a stand alone app and not also acting as a Zuul proxy.

Can you provide a complete, minimal, verifiable sample that reproduces the problem? It should be available as a GitHub (or similar) project or attached to this issue as a zip file.

Comment From: scorpionaps

Hi Ryan.

thanks for suggesting to differ the Eurka server and Zuul proxy. I did that. Removed all Zuul related configs and now my Eureka server is entry point. Still the issue is not solved. I am sharing my application.ymls and restcontrollers

application.yml --> Eureka server ```spring: application: name: Eureka-Server

server: port: 8302

eureka: server: peer-eureka-status-refresh-time-interval-ms: 10000 client: registerWithEureka: false fetchRegistry: false server: waitTimeInMsWhenSyncEmpty: 0 serviceUrl: defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/ instance: hostname: localhost

zuul:

prefix: /api```

appliction.yml --> Eureka Client ```spring: application: name: Eureka-Client

server: port: 8303

eureka: client: registerWithEureka: true fetchRegistry: true serviceUrl: defaultZone: http://localhost:8302/eureka/ instance: hostname: localhost```

Eureka client is properly registered in Eureka server.

Eureka Client's controller

```@RestController @RequestMapping("/rest/fileProcessing") public class ExcelController {

private static final String HOME = "home";

private static final String ERROR_MESSAGE = "errorMessage";

private static final Logger logger = LoggerFactory.getLogger(ExcelController.class);

@Autowired private FileStorageService fileStorageService;

@Autowired private FileProcessService fileprocessService;

@PostMapping(value="/uploadFile", 
consumes = {"multipart/form-data", "multipart/mixed"})
public String uploadFile(@RequestParam("file") MultipartFile file, ModelMap modelMap) {

    logger.info("Started Inside uploadFile:"+ExcelController.class);

    // Load file as Resource
    if (file == null || file.isEmpty() ) {
        logger.error("Choose Excel file is mandatory to process the file");
        modelMap.put(ERROR_MESSAGE, "Choose Excel file is mandatory to process the file");
        return HOME;
    }

}```

Form Action from Home.jsp <form action="/Eureka-Client/rest/fileProcessing/uploadFile" method="post" enctype="multipart/form-data">

Let me know if this helps to understand issue in better way.

thanks in advance.

Comment From: greg-petersen

@scorpionaps I encountered a similar issue, in our case we need to add the following configuration:

eureka.instance.metadata-map.public: true

This was defaulted true at some point, and now appears that it needs to be explicitly set.

We encountered this when upgrading from 1.4.5.RELEASE to 2.1.1.RELEASE

Comment From: spencergibb

Closing this due to inactivity. Please re-open if there's more to discuss.