I’m trying to monitor Tomcat in Java program but I don’t how I should pass the username and password to JMXProxyServlet. Does any one have any idea how to do this?
I’m trying to monitor Tomcat in Java program but I don’t how I should
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
So your monitoring software will be written in Java. You can configure your manager webapp to use HTTP BASIC authentication and a MemoryRealmDatabase (which is how it’s set up by default). Then,
tomcat-users.xmlwith themanager-jmxrole.JMXProxyServlet. The value of that header should bebase64(username + ":" + password).Various HTTP helper libraries (like Apache httpclient) have specialized methods to help you do this, or you can use
HttpURLConnectiondirectly.