Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MBeanServer doesn't start on Tomcat 5 1

Status
Not open for further replies.

tony17

Programmer
May 11, 2004
10
IT
Hi all,

I've installed TOmcat 5, but the MBeanServer doesn't start when the service
starts. Does anybody know why?
Here are some step when the service is starting:

Using CATALINA_BASE: C:\Programmi\jakarta-tomcat-5.0.24
Using CATALINA_HOME: C:\Programmi\jakarta-tomcat-5.0.24
Using CATALINA_TMPDIR: C:\Programmi\jakarta-tomcat-5.0.24\temp
Using JAVA_HOME: D:\Programmi\java\j2sdk1.4.2
10-mag-2004 21.50.55 org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
10-mag-2004 21.50.55 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 2254 ms
10-mag-2004 21.50.55 org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
10-mag-2004 21.50.55 org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.0.24
10-mag-2004 21.50.55 org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
10-mag-2004 21.50.55 org.apache.catalina.core.StandardHost getDeployer
INFO: Create Host deployer for direct deployment ( non-jmx )
10-mag-2004 21.50.55 org.apache.catalina.core.StandardHostDeployer install
INFO: Processing Context configuration file URL file:C:\Programmi\jakarta-
tomcat-5.0.24\conf\Catalina\localhost\admin.xml
10-mag-2004 21.50.57 org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.struts.util.LocalStrings',
returnNull=true
10-mag-2004 21.50.57 org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.struts.action.ActionResources',
returnNull=true
....
...
..
.
Thanks,
Tony
 
There is no point in posting half the startup sequence - please post the whole sequence, including any error messages, the OS you are using, and other relevant information.
 
I'm using Win2k. It seems that there are not error messages. Anyway, the complete boot sequence is:
Using CATALINA_BASE: C:\Programmi\jakarta-tomcat-5.0.24
Using CATALINA_HOME: C:\Programmi\jakarta-tomcat-5.0.24
Using CATALINA_TMPDIR: C:\Programmi\jakarta-tomcat-5.0.24\temp
Using JAVA_HOME: D:\Programmi\java\j2sdk1.4.2
10-mag-2004 21.50.55 org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
10-mag-2004 21.50.55 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 2254 ms
10-mag-2004 21.50.55 org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
10-mag-2004 21.50.55 org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.0.24
10-mag-2004 21.50.55 org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
10-mag-2004 21.50.55 org.apache.catalina.core.StandardHost getDeployer
INFO: Create Host deployer for direct deployment ( non-jmx )
10-mag-2004 21.50.55 org.apache.catalina.core.StandardHostDeployer install
INFO: Processing Context configuration file URL file:C:\Programmi\jakarta-tomcat
-5.0.24\conf\Catalina\localhost\admin.xml
10-mag-2004 21.50.57 org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.struts.util.LocalStrings', returnNull=tru
e
10-mag-2004 21.50.57 org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.struts.action.ActionResources', returnNul
l=true
10-mag-2004 21.50.58 org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.webapp.admin.ApplicationResources', retur
nNull=true
10-mag-2004 21.51.04 org.apache.catalina.core.StandardHostDeployer install
INFO: Processing Context configuration file URL file:C:\Programmi\jakarta-tomcat
-5.0.24\conf\Catalina\localhost\balancer.xml
10-mag-2004 21.51.05 org.apache.catalina.core.StandardHostDeployer install
INFO: Processing Context configuration file URL file:C:\Programmi\jakarta-tomcat
-5.0.24\conf\Catalina\localhost\manager.xml
10-mag-2004 21.51.05 org.apache.catalina.core.StandardHostDeployer install
INFO: Installing web application at context path /jsp-examples from URL file:C:programmi\jakarta-tomcat-5.0.24\webapps\jsp-examples
10-mag-2004 21.51.05 org.apache.catalina.core.StandardHostDeployer install
INFO: Installing web application at context path from URL file:C:\Programmi\jak
arta-tomcat-5.0.24\webapps\ROOT
10-mag-2004 21.51.05 org.apache.catalina.core.StandardHostDeployer install
INFO: Installing web application at context path /servlets-examples from URL fil
e:C:\Programmi\jakarta-tomcat-5.0.24\webapps\servlets-examples
10-mag-2004 21.51.06 org.apache.catalina.core.StandardHostDeployer install
INFO: Installing web application at context path /tomcat-docs from URL file:C:\P
rogrammi\jakarta-tomcat-5.0.24\webapps\tomcat-docs
10-mag-2004 21.51.06 org.apache.catalina.core.StandardHostDeployer install
INFO: Installing web application at context path /webdav from URL file:C:\Progra
mmi\jakarta-tomcat-5.0.24\webapps\webdav
10-mag-2004 21.51.06 org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
10-mag-2004 21.51.07 org.apache.jk.common.ChannelSocket init
INFO: JK2: ajp13 listening on /0.0.0.0:8009
10-mag-2004 21.51.07 org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/180 config=C:\Programmi\jakarta-tomcat-5.0.24\conf
\jk2.properties
10-mag-2004 21.51.07 org.apache.catalina.startup.Catalina start
INFO: Server startup in 12157 ms

TOmcat work at I really don't know what's wrong.
 
I'm confused - this looks like it starts up fine. What exactly are you having problems with ? Are you trying to use custom JMX components ?
 
Yes. I'm trying to manage a web service deployed on tomcat using JMX but Tomcat doesn't instantiate any MBeanServer when it starts. For instance, I aspect to see the following:

12-gen-2004 15.59.13 org.apache.commons.modeler.Registry loadRegistry
INFO: Loading registry information
12-gen-2004 15.59.13 org.apache.commons.modeler.Registry getRegistry
INFO: Creating new Registry instance
12-gen-2004 15.59.14 org.apache.commons.modeler.Registry getServer
INFO: Creating MBeanServer
12-gen-2004 15.59.15 org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on port 8080
..
..
 
Tomcat runs off JMX, so it must be started. You can obtain a reference to tomcat's mbeanserver like this :

Code:
    /**
     * Obtains a reference to the MBean server. If at least one
     * MBean server already exists, then a reference to that MBean
     * server is returned. Otherwise a new instance is created.
     */
    protected static MBeanServer getMBeanServer (MBeanServer _server) {
        if (_server == null) {
            ArrayList mbeanServers = MBeanServerFactory.findMBeanServer(null);

            _server = (mbeanServers.size() > 0) ? (MBeanServer)mbeanServers.get(0) : MBeanServerFactory.createMBeanServer();
        }
        return  _server;
    }

and you can create an interface to the mbean server using this - to prove it is running :

Code:
    /**
     * Creates the HTML adapter server and starts it running
     * on its own thread of execution.
     */
    protected static HtmlAdaptorServer createHTMLAdapter (HtmlAdaptorServer _html, MBeanServer _server, ArrayList _mbeans) {
        int portNumber = 8090;
        _html = new HtmlAdaptorServer(portNumber);
        ObjectName html_name = null;
        AuthInfo auth = new AuthInfo("admin", "admin");
        _html.addUserAuthenticationInfo(auth);
        try {
            html_name = new ObjectName("Adaptor:name=html,port=" + portNumber);
            _server.registerMBean(_html, html_name);
            _mbeans.add(html_name);
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
        _html.start();

        return _html;

    }
 
That's perfect! But, you said that TOmcat runs off JMX and that JMX must be started...but the question is how? HOw JMX can be started? If JMX does not start on Tomcat the code about finding an MBeanServer is useless because is impossible to find it.

 
Sorry, my wording was unclear. Tomcat5 cannot function without JMX - so if tomcat starts, then the JMX server must be running.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top