我有一个简单的JHipster单片应用程序,我想连接到现有的Eureka发现服务,看看正在运行的服务。
但是,如果我将eureka添加到pom.xml中,我会在AbstractRememberMeServices中获得NullPointerException。
java.lang.NullPointerException: null
at org.springframework.security.web.authentication.rememberme.AbstractRememberMeServices.autoLogin(AbstractRememberMeServices.java:118)
调试,看起来这个服务没有配置,因为大多数属性都是null。
日志中会出现以下警告,我猜是问题所在:
WARN 45015 --- [ restartedMain] o.s.c.a.ConfigurationClassPostProcessor :
Cannot enhance @Configuration bean definition 'refreshScope' since its
singleton instance has been created too early. The typical cause is a
non-static @Bean method with a BeanDefinitionRegistryPostProcessor
return type: Consider declaring such methods as 'static'.
我已将eureka包括在内(如JHipster微服务应用程序中所使用的那样):
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Camden.SR6</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-eureka</artifactId>
</dependency>
我正在使用JHipster 4.1.1和Spring Boot 1.5.2.RELEASE
有人知道修复或解决方法吗?