Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3677766
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T03:15:41+00:00 2026-05-19T03:15:41+00:00

Failing to connect to Tomcat JMX instance Ok i am stuck now – Im

  • 0

Failing to connect to Tomcat JMX instance

Ok i am stuck now – Im trying to configure JMX with Tomcat as follows

$CATALINA_BASE/setenv.sh:

CATALINA_OPTS="-Dcom.sun.management.jmxremote.port=18070 -Dcom.sun.management.jmxremote.password.file=$CATALINA_BASE/conf/jmxremote.password -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxremote.access.file=$CATALINA_BASE/conf/jmxremote.access"
export CATALINA_OPTS

$CATALINA_BASE/conf/jmxremote.password

    monitorRole monitorpass
    controlRole controlpass

$CATALINA_BASE/conf/jmxremote.access

    monitorRole readonly
    controlRole readwrite

The client tool i am using to access the Tomcat JMX server is running on the same machine as the Tomcat instance. when i start tomcat i can see that there is something listening at port 18070 but when i try to connect i get the following error

    Exception in thread "main" java.lang.SecurityException: Authentication failed! Credentials required
            at com.sun.jmx.remote.security.JMXPluggableAuthenticator.authenticationFailure(JMXPluggableAuthenticator.java:193)
            at com.sun.jmx.remote.security.JMXPluggableAuthenticator.authenticate(JMXPluggableAuthenticator.java:145)
            at sun.management.jmxremote.ConnectorBootstrap$AccessFileCheckerAuthenticator.authenticate(ConnectorBootstrap.java:185)
            at javax.management.remote.rmi.RMIServerImpl.doNewClient(RMIServerImpl.java:213)

I connect using the following bit of code

            try {
                url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:18070/jmxrmi");
                jmxc = JMXConnectorFactory.connect(url,null); 
                mbsc = jmxc.getMBeanServerConnection();             
            } catch (MalformedURLException e) {
                throw new Exception(methodName + ":" + e);
            } catch (IOException e) {
                throw new Exception(methodName + ":" + "Failed to connect to the Tomcat Server " + e);
            }

It works fine if i set com.sun.management.jmxremote.authenticate=true to false. Other than that it just fails. The client tool is running on the same machine as the tomcat instance so there should not be any issues with the firewall. Any clues

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T03:15:41+00:00Added an answer on May 19, 2026 at 3:15 am

    This

    JMXServiceURL url = ...;
    Map env = ...;
    String[] creds = {"monitorRole", "mrpasswd"};
    env.put(JMXConnector.CREDENTIALS, creds);
    JMXConnector cc = JMXConnectorFactory.connect(url, env);
    MBeanServerConnection mbsc = cc.getMBeanServerConnection();
    

    from http://blogs.oracle.com/lmalventosa/entry/jmx_authentication_authorization

    should help

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying (and failing) to write a simple template file: <#@ template language=C# hostspecific=True
I've installed CCNet and now I'm trying to set up a link to our
I am trying to connect to node.js websocket using unitt ios client. But it
connect is failing with WSAETIMEDOUT . That's fine but is there anyway to make
I'm trying and failing to cancel a call to WNetAddConnection2 with CancelSynchronousIo . The
I'm trying the following sample code, and failing (the uid and password I'm using
I'm trying to connect a datagrid to an HTTPService via a simple external XML
I have set up a basic installation of ZF and I'm trying to connect
I'm failing to understand why the function to connect to the database is not
I am trying to connect with a SOAP Service which requires Mutual SSL Authentication.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.