1

I create a eureka project in IDEA and it works well. But when I pack it into war and throw into webapp directory of tomcat 8.5. After restart tomcat,I can not access it by the url localhost:8761

EurekaApplication.java

@SpringBootApplication
@EnableEurekaServer
public class EurekaApplication {
    public static void main( String[] args ) {
        SpringApplication.run(EurekaApplication.class,args);
    }
}

application.yml

server:
  port: 8761

eureka:
  instance:
    hostname: localhost
  client:
    registerWithEureka: false
    fetchRegistry: false
    serverUrl:
      defaultZone: http://localhost:${server.port}/eureka/

spring.cloud.config.discovery.enabled: true
LMC
  • 8,575
  • 2
  • 25
  • 45
fangwen
  • 11
  • 1

1 Answers1

0

Please check tomcat port number in server.xml Use that port number to load eureka server. example http://localhost:8080/eureka_warfile_name

  • This does not provide an answer to the question. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](https://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/late-answers/30546749) – MD. RAKIB HASAN Dec 15 '21 at 10:51