【发布时间】:2015-09-03 19:23:51
【问题描述】:
根据this post,通过在pom.xml 中拥有spring-boot-actuator 依赖项,我可以从actuator 端点中受益。但是,我观察到它破坏了我现有的 spring 应用程序(它不是 spring-boot 应用程序)。
我在 pom.xml 中的依赖项中添加了以下内容
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-actuator</artifactId>
<version>1.2.5.RELEASE</version>
</dependency>
就是这样。我还没有对应用程序进行任何更改。
我使用maven-t7-plugin 启动了容器。
现在我的应用程序端点http://localhost:8010/mycontext/foo 返回404。我在pom.xml 中注释掉了上面的dependency。
现在我的应用程序为上述请求返回200 OK。
请帮助我解决问题所在。我找不到任何明显的原因。
谢谢
【问题讨论】:
-
它不应该改变上下文,而是它可能以某种方式期望您的页面位于其他位置?也许它启用了spring boot web。给我们看一些代码。
-
我怀疑执行器不能很好地运行,因为它不是弹簧启动应用程序。
-
@ACV。我尝试了我们的生产代码。我不能在这里分享。但测试它很简单。同时我会在这里放一些简单的代码
-
@spencergibb: 是否有可能仅仅通过依赖就破坏现有的应用程序?
-
@brainstorm,foo 的实际值是多少?
标签: spring-boot spring-boot-actuator