具有外部WAR文件的Spring Boot 2.2.0

时间:2019-10-30 07:36:38

标签: spring-boot spring-security

我有一个简洁的Spring Boot 2.2.0.RELEASE Web项目,打算运行2个上下文路径,即/pulse/fooApache Geode Pulse WAR将为/pulse服务,而我的课程将为另一条道路服务。 2个路径中的类不共享。我没有为班级写任何东西,但是我已经设置/pulse来运行。很快,我意识到,如果我通过-Dspring.profiles.active向Spring Boot提供任何活动配置文件,则该应用程序将失败,因为它无法解析身份验证管理器,如下面的部分异常所示,

Cannot resolve reference to bean 'org.springframework.security.config.authentication.AuthenticationManagerFactoryBean#0' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: 
Error creating bean with name 'org.springframework.security.config.authentication.AuthenticationManagerFactoryBean#0': 
FactoryBean threw exception on object creation; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'org.springframework.security.authenticationManager' available: 
Did you forget to add a global <authentication-manager> element to your configuration (with child <authentication-provider> elements)? 
Alternatively you can use the authentication-manager-ref attribute on your <http> and <global-method-security> elements.

如果我忽略了活动配置文件,则该应用程序将运行,并且/pulse已准备好采取行动。关于如何使我的有效资料与外部WAR一起使用的任何建议。谢谢

0 个答案:

没有答案