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

  • Home
  • SEARCH
  • 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 7902595
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T09:32:28+00:00 2026-06-03T09:32:28+00:00

If Tomcat runs as a Windows service (created using the Windows Tomcat installer) you

  • 0

If Tomcat runs as a Windows service (created using the Windows Tomcat installer) you can’t simply enable JMX using -Dcom.sun.management.jmxremote. You also need to set -Dcom.sun.management.jmxremote.port=<port>. This is, among other places, explained here: Unable to use JConsole with Tomcat running as windows service

However, I haven’t found an explanation anywhere WHY this is the way it is.

  • 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-06-03T09:32:30+00:00Added an answer on June 3, 2026 at 9:32 am

    I was a bit lost and confused when I wrote the question. Here’s what I’ve learned in the meantime. Usually the Tomcat Windows service runs under the local system account. That’s the main reason for all the fuss.

    If you simply set -Dcom.sun.management.jmxremote in the service config’s JVM settings JMX will be enabled indeed. If you have a JMX client that runs in the same JVM instance (e.g. because it’s baked into the application itself) you can get a hold of the MBeanServer like so: MBeanServerFactory.findMBeanServer(<specific-agent-ID-or-null>). However, JConsole won’t list this Tomcat process. It’s all explained here: https://blogs.oracle.com/nbprofiler/entry/monitoring_java_processes_running_as.

    As explained elsewhere, if this is not good enough you also need to set -Dcom.sun.management.jmxremote.port=<port>. Then you can connect to JMX with JConsole using localhost:<port>. From Java code this can be achieved using:

    JMXServiceURL target = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:<port>/jmxrmi");
    JMXConnector connector = JMXConnectorFactory.connect(target);
    connector.getMBeanServerConnection();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I installed Tomcat using the Windows installer ages ago and it runs fine as
I've just created a custom taglib which runs fine with Jetty. When using TomCat
My application runs SQL Server 2008 on Windows Server 2008 using Tomcat. I am
I have a Java web-service which currently runs on a local tomcat server. I
I have developed a simple server using Tomcat which runs a servlet. The servlet
We have an Apache tomcat server that runs a current web service. We were
I have installed Apache Tomcat 6 as a Service in a Windows XP computer
My application runs under tomcat. It is using GSS API (JNDI) to connect to
I have a web app that runs under Tomcat on Windows XP that needs
I'm running a Tomcat 5.5 instance (port 8089) on Windows 7. The server runs

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.