我有一个遗留的非启动springmvc(5.2.1.release)应用程序,我想在其中添加执行器特性来监视。我在应用程序中添加了以下依赖项:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
<version>2.2.4.RELEASE</version>
</dependency>
还向我的应用程序app.properties添加了以下属性:
management.endpoints.web.exposure.include=*
management.security.enabled=false
下面还添加了spring-security.xml
<intercept-url pattern="/actuator*" access="permitAll"/>
<intercept-url pattern="/actuator/**" access="permitAll"/>
由于mvc已经在我的应用程序中启用了,我刚刚重新启动了服务器,并希望通过点击http://localhost:8081/cust web/ACTURATOR.this和http://localhost:8081/cust web/actuator/health失败,出现404错误。有人能告诉我如何在我的非引导应用程序中配置执行器吗?我引用了几个boot2.0的例子,但它似乎不起作用
日志如下:
[[2021-02-08 14:37:26,838] [http-nio-8081-exec-8] DEBUG o.s.s.w.a.i.FilterSecurityInterceptor - Secure object: FilterInvocation: URL: /actuator/health; Attributes: [permitAll]
[2021-02-08 14:37:26,838] [http-nio-8081-exec-8] DEBUG o.s.s.w.a.i.FilterSecurityInterceptor - Authorization successful
[[2021-02-08 14:37:26,839] [http-nio-8081-exec-8] DEBUG o.s.s.w.FilterChainProxy - /actuator/health reached end of additional filter chain; proceeding with original chain
[[2021-02-08 14:37:26,839] [http-nio-8081-exec-8] DEBUG o.s.w.s.DispatcherServlet - GET "/cust-web/actuator/health", parameters={}
[[2021-02-08 14:37:26,862] [http-nio-8081-exec-8] DEBUG o.s.w.s.h.SimpleUrlHandlerMapping - Mapped to org.springframework.web.servlet.resource.DefaultServletHttpRequestHandler@72845230
[[2021-02-08 14:37:26,873] [http-nio-8081-exec-8] DEBUG o.s.s.w.h.w.HstsHeaderWriter - Not injecting HSTS header since it did not match the requestMatcher org.springframework.security.web.header.writers.HstsHeaderWriter$SecureRequestMatcher@37c91176
[[2021-02-08 14:37:26,873] [http-nio-8081-exec-8] DEBUG o.s.w.s.DispatcherServlet - Completed 404 NOT_FOUND
暂无答案!
目前还没有任何答案,快来回答吧!