SpringCloud-Finchley.SR2 Эврика регистр-центр статус страницы 404 - PullRequest
0 голосов
/ 17 апреля 2019

Я импортировал демонстрационную версию Springcloud, версию Finchley.SR2, после запуска приложения я не смог посетить страницу центра регистрации Eureka, статус 404. У меня еще нет контроллера, но только @SpringBootApplication. Та же проблема на затмении иИдея

Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.

Wed Apr 17 10:46:08 CST 2019
There was an unexpected error (type=Not Found, status=404).
No message available

Если я использую версию Finchley.SR1 с jersey-bundle зависимости 1.19, все нормально.Вот pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.1.4.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>groupId</groupId>
    <artifactId>register-center</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>register-center</name>
    <properties>
        <java.version>1.8</java.version>
        <spring-cloud.version>Finchley.SR2</spring-cloud.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <!-- 
        <dependency>
            <groupId>com.sun.jersey</groupId>
            <artifactId>jersey-bundle</artifactId>
            <version>1.19</version>
        </dependency>
         -->
    </dependencies>
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>${spring-cloud.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
</project>

вот стартовый журнал, который выводит консоль:


2019-04-17 10:45:55.070  INFO 6608 --- [           main] c.g.c.h.HubRegisterCenterApplication     : No active profile set, falling back to default profiles: default
2019-04-17 10:45:55.930  WARN 6608 --- [           main] o.s.boot.actuate.endpoint.EndpointId     : Endpoint ID 'service-registry' contains invalid characters, please migrate to a valid format.
2019-04-17 10:45:56.189  INFO 6608 --- [           main] o.s.cloud.context.scope.GenericScope     : BeanFactory id=b735a91d-6156-3751-9e56-6f2bcdd0ff57
2019-04-17 10:45:56.294  INFO 6608 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$e5276a08] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-04-17 10:45:56.982  INFO 6608 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8761 (http)
2019-04-17 10:45:57.007  INFO 6608 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2019-04-17 10:45:57.007  INFO 6608 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.17]
2019-04-17 10:45:57.277  INFO 6608 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2019-04-17 10:45:57.277  INFO 6608 --- [           main] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 2190 ms
2019-04-17 10:45:57.390  WARN 6608 --- [           main] c.n.c.sources.URLConfigurationSource     : No URLs will be polled as dynamic configuration sources.
2019-04-17 10:45:57.390  INFO 6608 --- [           main] c.n.c.sources.URLConfigurationSource     : To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.
2019-04-17 10:45:57.408  INFO 6608 --- [           main] c.netflix.config.DynamicPropertyFactory  : DynamicPropertyFactory is initialized with configuration sources: com.netflix.config.ConcurrentCompositeConfiguration@4af70944
2019-04-17 10:45:58.631  WARN 6608 --- [           main] o.s.c.n.a.ArchaiusAutoConfiguration      : No spring.application.name found, defaulting to 'application'
2019-04-17 10:45:58.632  WARN 6608 --- [           main] c.n.c.sources.URLConfigurationSource     : No URLs will be polled as dynamic configuration sources.
2019-04-17 10:45:58.632  INFO 6608 --- [           main] c.n.c.sources.URLConfigurationSource     : To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.
2019-04-17 10:45:58.854  INFO 6608 --- [           main] o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService 'applicationTaskExecutor'
2019-04-17 10:45:59.276  WARN 6608 --- [           main] o.s.b.a.f.FreeMarkerAutoConfiguration    : Cannot find template location(s): [classpath:/templates/] (please add some templates, check your FreeMarker configuration, or set spring.freemarker.checkTemplateLocation=false)
2019-04-17 10:45:59.470  INFO 6608 --- [           main] o.s.b.a.e.web.EndpointLinksResolver      : Exposing 2 endpoint(s) beneath base path '/actuator'
2019-04-17 10:45:59.716  INFO 6608 --- [           main] o.s.c.n.eureka.InstanceInfoFactory       : Setting initial instance status as: STARTING
2019-04-17 10:45:59.756  INFO 6608 --- [           main] com.netflix.discovery.DiscoveryClient    : Initializing Eureka in region us-east-1
2019-04-17 10:45:59.758  INFO 6608 --- [           main] com.netflix.discovery.DiscoveryClient    : Client configured to neither register nor query for data.
2019-04-17 10:45:59.775  INFO 6608 --- [           main] com.netflix.discovery.DiscoveryClient    : Discovery Client initialized at timestamp 1555469159773 with initial instances count: 0
2019-04-17 10:45:59.781  INFO 6608 --- [           main] o.s.c.n.e.s.EurekaServiceRegistry        : Registering application UNKNOWN with eureka with status UP
2019-04-17 10:45:59.840  INFO 6608 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8761 (http) with context path ''
2019-04-17 10:45:59.844  INFO 6608 --- [           main] c.g.c.h.HubRegisterCenterApplication     : Started HubRegisterCenterApplication in 6.441 seconds (JVM running for 7.261)
2019-04-17 10:46:08.612  INFO 6608 --- [nio-8761-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring DispatcherServlet 'dispatcherServlet'
2019-04-17 10:46:08.612  INFO 6608 --- [nio-8761-exec-1] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
2019-04-17 10:46:08.618  INFO 6608 --- [nio-8761-exec-1] o.s.web.servlet.DispatcherServlet        : Completed initialization in 6 ms

Вот мой application.yml:

server:
  port: 8761
eureka:
  client:
    register-with-eureka: false
    fetch-registry: false

Здесьмой класс приложения:

@SpringBootApplication
@EnableEurekaServer
public class HubRegisterCenterApplication {

    public static void main(String[] args) {
        SpringApplication.run(HubRegisterCenterApplication.class, args);
    }

}

1 Ответ

0 голосов
/ 17 апреля 2019

Проблема решена.используйте команду mvn install, и я обнаружил, что в jav-файле зависимостей maven есть некоторые проблемы.удалите их и загрузите заново, проблема решена

...