Actuator not working when management.port and management.context-path is provided
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
I have added a different port and context-path for spring boot actuator in my application properties but i am getting the following response when i access
localhost:9091/app/actuator/health
{
"payload": {
"timestamp": "2019-01-04T13:10:42Z",
"status": 500,
"error": "Internal Server Error",
"exception": "org.springframework.beans.factory.BeanCreationException",
"message": "Error creating bean with name 'scopedTarget.oauth2ClientContext': Scope 'session' is not active for the current thread; consider defining a scoped proxy for this bean if you intend to refer to it from a singleton; nested exception is java.lang.IllegalStateException: No thread-bound request found: Are you referring to request attributes outside of an actual web request, or processing a request outside of the originally receiving thread? If you are actually operating within a web request and still receive this message, your code is probably running outside of DispatcherServlet/DispatcherPortlet: In this case, use RequestContextListener or RequestContextFilter to expose the current request.",
"path": "/app/actuator/health"
}
}
here's my configuration
server:
port: 9090
contextPath: /app
...
management:
port: 9091
ssl.enabled: false
security:
roles: ACTUATOR_GET
context-path: /app/actuator
endpoints:
hypermedia:
enabled: true
...
What am i doing wrong ?
i am using spring-boot 1.5
spring-boot spring-boot-actuator
add a comment |
I have added a different port and context-path for spring boot actuator in my application properties but i am getting the following response when i access
localhost:9091/app/actuator/health
{
"payload": {
"timestamp": "2019-01-04T13:10:42Z",
"status": 500,
"error": "Internal Server Error",
"exception": "org.springframework.beans.factory.BeanCreationException",
"message": "Error creating bean with name 'scopedTarget.oauth2ClientContext': Scope 'session' is not active for the current thread; consider defining a scoped proxy for this bean if you intend to refer to it from a singleton; nested exception is java.lang.IllegalStateException: No thread-bound request found: Are you referring to request attributes outside of an actual web request, or processing a request outside of the originally receiving thread? If you are actually operating within a web request and still receive this message, your code is probably running outside of DispatcherServlet/DispatcherPortlet: In this case, use RequestContextListener or RequestContextFilter to expose the current request.",
"path": "/app/actuator/health"
}
}
here's my configuration
server:
port: 9090
contextPath: /app
...
management:
port: 9091
ssl.enabled: false
security:
roles: ACTUATOR_GET
context-path: /app/actuator
endpoints:
hypermedia:
enabled: true
...
What am i doing wrong ?
i am using spring-boot 1.5
spring-boot spring-boot-actuator
did you customize /health result within your code? if so can you post any relevant snippet related to it?
– stacker
Jan 4 at 14:22
may be these answers help you, having the same error msg: stackoverflow.com/questions/35875098/… in short: Add a RequestContextListener to your config.
– Dominik
Jan 4 at 14:25
I think it's a kind of security problem , check the console of your service, perhaps it a kind of autorization of the actuator endpoints with oauth2 !? do you implement Oauth ? because your config is correct and the url access will behttp://host:9091/app/actuator/health
– TinyOS
Jan 4 at 14:39
Issue solved. The exception was being originated from a customOncePerRequestFilter
that implementedRememberMeServices
. In that filter I was clearing OAuthContext by doingrestTemplate.getOAuth2ClientContext().setAccessToken(null);
- which was causingBeanCreationException
. I have put this statement in a try-catch block and the actuator is working fine now.
– Mansoor
Jan 7 at 7:02
add a comment |
I have added a different port and context-path for spring boot actuator in my application properties but i am getting the following response when i access
localhost:9091/app/actuator/health
{
"payload": {
"timestamp": "2019-01-04T13:10:42Z",
"status": 500,
"error": "Internal Server Error",
"exception": "org.springframework.beans.factory.BeanCreationException",
"message": "Error creating bean with name 'scopedTarget.oauth2ClientContext': Scope 'session' is not active for the current thread; consider defining a scoped proxy for this bean if you intend to refer to it from a singleton; nested exception is java.lang.IllegalStateException: No thread-bound request found: Are you referring to request attributes outside of an actual web request, or processing a request outside of the originally receiving thread? If you are actually operating within a web request and still receive this message, your code is probably running outside of DispatcherServlet/DispatcherPortlet: In this case, use RequestContextListener or RequestContextFilter to expose the current request.",
"path": "/app/actuator/health"
}
}
here's my configuration
server:
port: 9090
contextPath: /app
...
management:
port: 9091
ssl.enabled: false
security:
roles: ACTUATOR_GET
context-path: /app/actuator
endpoints:
hypermedia:
enabled: true
...
What am i doing wrong ?
i am using spring-boot 1.5
spring-boot spring-boot-actuator
I have added a different port and context-path for spring boot actuator in my application properties but i am getting the following response when i access
localhost:9091/app/actuator/health
{
"payload": {
"timestamp": "2019-01-04T13:10:42Z",
"status": 500,
"error": "Internal Server Error",
"exception": "org.springframework.beans.factory.BeanCreationException",
"message": "Error creating bean with name 'scopedTarget.oauth2ClientContext': Scope 'session' is not active for the current thread; consider defining a scoped proxy for this bean if you intend to refer to it from a singleton; nested exception is java.lang.IllegalStateException: No thread-bound request found: Are you referring to request attributes outside of an actual web request, or processing a request outside of the originally receiving thread? If you are actually operating within a web request and still receive this message, your code is probably running outside of DispatcherServlet/DispatcherPortlet: In this case, use RequestContextListener or RequestContextFilter to expose the current request.",
"path": "/app/actuator/health"
}
}
here's my configuration
server:
port: 9090
contextPath: /app
...
management:
port: 9091
ssl.enabled: false
security:
roles: ACTUATOR_GET
context-path: /app/actuator
endpoints:
hypermedia:
enabled: true
...
What am i doing wrong ?
i am using spring-boot 1.5
spring-boot spring-boot-actuator
spring-boot spring-boot-actuator
edited Jan 4 at 15:31
Thiru
1,2681025
1,2681025
asked Jan 4 at 13:26
MansoorMansoor
55
55
did you customize /health result within your code? if so can you post any relevant snippet related to it?
– stacker
Jan 4 at 14:22
may be these answers help you, having the same error msg: stackoverflow.com/questions/35875098/… in short: Add a RequestContextListener to your config.
– Dominik
Jan 4 at 14:25
I think it's a kind of security problem , check the console of your service, perhaps it a kind of autorization of the actuator endpoints with oauth2 !? do you implement Oauth ? because your config is correct and the url access will behttp://host:9091/app/actuator/health
– TinyOS
Jan 4 at 14:39
Issue solved. The exception was being originated from a customOncePerRequestFilter
that implementedRememberMeServices
. In that filter I was clearing OAuthContext by doingrestTemplate.getOAuth2ClientContext().setAccessToken(null);
- which was causingBeanCreationException
. I have put this statement in a try-catch block and the actuator is working fine now.
– Mansoor
Jan 7 at 7:02
add a comment |
did you customize /health result within your code? if so can you post any relevant snippet related to it?
– stacker
Jan 4 at 14:22
may be these answers help you, having the same error msg: stackoverflow.com/questions/35875098/… in short: Add a RequestContextListener to your config.
– Dominik
Jan 4 at 14:25
I think it's a kind of security problem , check the console of your service, perhaps it a kind of autorization of the actuator endpoints with oauth2 !? do you implement Oauth ? because your config is correct and the url access will behttp://host:9091/app/actuator/health
– TinyOS
Jan 4 at 14:39
Issue solved. The exception was being originated from a customOncePerRequestFilter
that implementedRememberMeServices
. In that filter I was clearing OAuthContext by doingrestTemplate.getOAuth2ClientContext().setAccessToken(null);
- which was causingBeanCreationException
. I have put this statement in a try-catch block and the actuator is working fine now.
– Mansoor
Jan 7 at 7:02
did you customize /health result within your code? if so can you post any relevant snippet related to it?
– stacker
Jan 4 at 14:22
did you customize /health result within your code? if so can you post any relevant snippet related to it?
– stacker
Jan 4 at 14:22
may be these answers help you, having the same error msg: stackoverflow.com/questions/35875098/… in short: Add a RequestContextListener to your config.
– Dominik
Jan 4 at 14:25
may be these answers help you, having the same error msg: stackoverflow.com/questions/35875098/… in short: Add a RequestContextListener to your config.
– Dominik
Jan 4 at 14:25
I think it's a kind of security problem , check the console of your service, perhaps it a kind of autorization of the actuator endpoints with oauth2 !? do you implement Oauth ? because your config is correct and the url access will be
http://host:9091/app/actuator/health
– TinyOS
Jan 4 at 14:39
I think it's a kind of security problem , check the console of your service, perhaps it a kind of autorization of the actuator endpoints with oauth2 !? do you implement Oauth ? because your config is correct and the url access will be
http://host:9091/app/actuator/health
– TinyOS
Jan 4 at 14:39
Issue solved. The exception was being originated from a custom
OncePerRequestFilter
that implemented RememberMeServices
. In that filter I was clearing OAuthContext by doing restTemplate.getOAuth2ClientContext().setAccessToken(null);
- which was causing BeanCreationException
. I have put this statement in a try-catch block and the actuator is working fine now.– Mansoor
Jan 7 at 7:02
Issue solved. The exception was being originated from a custom
OncePerRequestFilter
that implemented RememberMeServices
. In that filter I was clearing OAuthContext by doing restTemplate.getOAuth2ClientContext().setAccessToken(null);
- which was causing BeanCreationException
. I have put this statement in a try-catch block and the actuator is working fine now.– Mansoor
Jan 7 at 7:02
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54039841%2factuator-not-working-when-management-port-and-management-context-path-is-provide%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54039841%2factuator-not-working-when-management-port-and-management-context-path-is-provide%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
did you customize /health result within your code? if so can you post any relevant snippet related to it?
– stacker
Jan 4 at 14:22
may be these answers help you, having the same error msg: stackoverflow.com/questions/35875098/… in short: Add a RequestContextListener to your config.
– Dominik
Jan 4 at 14:25
I think it's a kind of security problem , check the console of your service, perhaps it a kind of autorization of the actuator endpoints with oauth2 !? do you implement Oauth ? because your config is correct and the url access will be
http://host:9091/app/actuator/health
– TinyOS
Jan 4 at 14:39
Issue solved. The exception was being originated from a custom
OncePerRequestFilter
that implementedRememberMeServices
. In that filter I was clearing OAuthContext by doingrestTemplate.getOAuth2ClientContext().setAccessToken(null);
- which was causingBeanCreationException
. I have put this statement in a try-catch block and the actuator is working fine now.– Mansoor
Jan 7 at 7:02