• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Why ServerLifecycleListener is commented out in Tomcat 7's server.xml?

 
Ranch Hand
Posts: 50
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In Tomcat 6 <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" /> tag is present but not in Tomcat 7.
I have seen in Changelog of Tomcat 7 and found that; it has removed in Tomcat 7 but I want to know the reason why it has removed and how it's functionality is working after removing?


Use of ServerLifeCycleListener in Tomcat 6:

The Server Lifecycle Listener initializes the MBeanServer for the MBeans that may be used to manager Tomcat via JMX. Without this listener, none of the Tomcat MBeans will be available.

This listener must only be nested within Server elements.

No additional attributes are supported by the Server Lifecycle Listener.

How can Tomcat 7 support the above if they remove it...?
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Maybe Tomcat 7 doesn't have that functionality; do you have any indications to believe that it does?
 
Sharmistha Sarkar
Ranch Hand
Posts: 50
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think It does. I checked with jConsole. mBean is used via jConsole. I have checked an application with Tomcat 6 and Java 6 ;and it's performance with jConsole with the PID. Then the same application I checked with tomcat 7 and java 7 with new PID created and it also opening mBean in jConsole just like before. But confused, because jConsole is a behavior of JDK. It is inside jdk's bin folder. How can I prove Tomcat 7 supports mBean with jConsole? I don't know whether the jConsole experiment is correct or not..............
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Tomcat has supported JMX for a long time, and still does. It's possible that the internal implementation has changed; but why would you care if it has?
 
Sharmistha Sarkar
Ranch Hand
Posts: 50
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok , the reason is; I am migrating an application to Tomcat 7 with Java 7 which is running fine in Tomcat 6 with Java 6. Suspect this migration may cause any issue since ServerLifeCycleListener has removed, so is there all functionality work same in Tomcat 7 just like Tomcat 6 or later I may get exception or miss anything? So I am trying to prove that even after removing ServerLifeCycleListener in Tomcat 7 will not effect the application. Can you give me some idea how to prove this? There must have some reason to remove ServerLifeCycleListener in Tomcat 7 .
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:Tomcat has supported JMX for a long time, and still does.


Why don't you just hook up JConsole or VisualVM to Tomcat and check for yourself if all the MBeans you're expecting are still there?
 
Sharmistha Sarkar
Ranch Hand
Posts: 50
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't know how to see tomcat 6 mbean in jconsole. These days I was connecting jconsole with java PID.

Now the steps i did to connect jconsole,
1. run tomcat 6
2. in jconsole I choose "Remote Process" radio button and typed service:jmx:rmi:///jndi/rmi://localhost:7466
3 I left username and password textbox empty.

i am getting an exception and unable to connect jconsole. I doubt in the service:jmx uri.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hm, not sure what JConsole needs. I prefer VisualVM - it detects local JVM processes that are JMX enabled automatically :-)
 
permaculture is giving a gift to your future self. After reading this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic