You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Rick <to...@vidyah.com> on 2005/06/10 06:09:31 UTC

5.0.28 w/ MX4J 3.0.1, possible?

Hello,
  I have been trying to migrate to the latest version of MX4J (3.0.1) from
the old 1.1.1 version.  
And for the life of me, I don't seem to be able to get it to work.  I use
JMX to communicate to various servers in our webapp to show session info on
different nodes, and I would also like to implement some other features..

Old 1.1.1 implementation
-- jk2.properties --------------------
mx.enabled=true
mx.jrmpPort=1099
mx.jrmpHost=localhost

-- Code ------------------------------
Hashtable environment = new Hashtable();
  environment.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.rmi.registry.RegistryContextFactory");
  environment.put(Context.PROVIDER_URL,"rmi://localhost:1099");

JRMPConnector connector = new JMRPConnector();
connector.connect("jrmp", environment);

RemoteMBeanServer server = connector.getRemoteMBeanServer();
----------------------------------------

Ok.. So I replaced jmx.jar with the latest version of mx4j.jar (renamed to
jmx.jar) under tomcat_home/bin
And replaced or added
Mx4j-jmx.jar
Mx4j-tools.jar
Mx4j-remote.jar 
To /tomcat_home/common/lib

Now, when I start tomcat I get the error..
"MX4j RMI adapter not loaded: java.lang.ClassNotFoundException:
mx4j.adaptor.rmi.jrmp.JRMPAdaptor "

Which is correct, since that's not a valid class now, but how do I configure
tomcat to properly use the new mx4j.

If I enable mx.httpPort=9000/mx.httpHost=localhost then JMX does enable and
I get a pretty little message like...
"HttpAdapter version 3.0.1 started on port 9000" , but I have no idea at
this point how to properly use the HTTP connector.

Any info or suggestions to getting the RMI adapter working, or how to use
the http adapter, or just the best way to go about 
Using MX4J, not sure if either is possible with out updating to tomcat
5.5.x.

Thanks,
 
Rick




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


RE: Re: 5.0.28 w/ MX4J 3.0.1, possible?

Posted by Rick <to...@vidyah.com>.
Repost, hadn't heard anything...
 Anyone have a code example of talking to the JMX Http interface
pragmatically?  With latest MX4J or JMXRI?


Thanks Bill,
  So if I can only use the http method, then I assume I should be able to
make the code work using the newer MX4J HTTPConnector? Or am I missing
something.
Anyone have a code snippet using the HTTPConnector to connect to Tomcat's
Mbean server?  I seem to be having trouble getting the url syntax to work
with..

-------------------------------------------
JMXServiceURL address = new JMXServiceURL("http", "localhost", 9000);
-------------------------------------------

I get the error..
-------------------------------------------
java.net.MalformedURLException: Could not find provider for protocol http
-------------------------------------------

So I'm a bit stumped, if I'm using http, why is it saying it has no provider
for it, is there some other I need to use in its place?

Thanks again
-Rick
 

-----Original Message-----
From: news [mailto:news@sea.gmane.org] On Behalf Of Bill Barker Posted At:
Thursday, June 09, 2005 9:55 PM Posted To: Tomcat Dev
Conversation: Re: 5.0.28 w/ MX4J 3.0.1, possible?
Subject: Re: 5.0.28 w/ MX4J 3.0.1, possible?



"Rick" <to...@vidyah.com> wrote in message
news:FLUXupIMDR7LB31Jelc00000001@flux.vidyah.com...
> Hello,
>  I have been trying to migrate to the latest version of MX4J (3.0.1) 
> from the old 1.1.1 version.
> And for the life of me, I don't seem to be able to get it to work.  I 
> use JMX to communicate to various servers in our webapp to show 
> session info on different nodes, and I would also like to implement 
> some other features..
>
> Old 1.1.1 implementation
> -- jk2.properties -------------------- mx.enabled=true
> mx.jrmpPort=1099
> mx.jrmpHost=localhost
>
> -- Code ------------------------------ Hashtable environment = new 
> Hashtable();  environment.put(Context.INITIAL_CONTEXT_FACTORY,
> "com.sun.jndi.rmi.registry.RegistryContextFactory");
>  environment.put(Context.PROVIDER_URL,"rmi://localhost:1099");
>
> JRMPConnector connector = new JMRPConnector(); 
> connector.connect("jrmp", environment);
>
> RemoteMBeanServer server = connector.getRemoteMBeanServer();
> ----------------------------------------
>
> Ok.. So I replaced jmx.jar with the latest version of mx4j.jar 
> (renamed to
> jmx.jar) under tomcat_home/bin
> And replaced or added
> Mx4j-jmx.jar
> Mx4j-tools.jar
> Mx4j-remote.jar
> To /tomcat_home/common/lib
>
> Now, when I start tomcat I get the error..
> "MX4j RMI adapter not loaded: java.lang.ClassNotFoundException:
> mx4j.adaptor.rmi.jrmp.JRMPAdaptor "
>
> Which is correct, since that's not a valid class now, but how do I 
> configure tomcat to properly use the new mx4j.
>

Yep. The jrmp adapter is gone.

> If I enable mx.httpPort=9000/mx.httpHost=localhost then JMX does 
> enable and I get a pretty little message like...
> "HttpAdapter version 3.0.1 started on port 9000" , but I have no idea 
> at this point how to properly use the HTTP connector.
>
> Any info or suggestions to getting the RMI adapter working, or how to 
> use the http adapter, or just the best way to go about Using MX4J, not 
> sure if either is possible with out updating to tomcat 5.5.x.
>

The RMI adapter is gone in mx4j 3.x.  There is nothing that Tomat can do
about it.  You can access the http adapter by simply typing
http://localhost:9000 in you favorite browser.  The only thing you gain by
upgrading to 5.5.x is the ability to use the http adapter in XML instead of
HTML.

> Thanks,
>
> Rick




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


RE: Re: 5.0.28 w/ MX4J 3.0.1, possible?

Posted by Rick <to...@vidyah.com>.
Thanks Bill,
  So if I can only use the http method, then I assume I should be able to
make the code work using the newer MX4J HTTPConnector? Or am I missing
something.
Anyone have a code snippet using the HTTPConnector to connect to Tomcat's
Mbean server?  I seem to be having trouble getting the url syntax to work
with..

-------------------------------------------
JMXServiceURL address = new JMXServiceURL("http", "localhost", 9000);
-------------------------------------------

I get the error..
-------------------------------------------
java.net.MalformedURLException: Could not find provider for protocol http
-------------------------------------------

So I'm a bit stumped, if I'm using http, why is it saying it has no provider
for it, is there some other I need to use in its place?

Thanks again
-Rick
 

-----Original Message-----
From: news [mailto:news@sea.gmane.org] On Behalf Of Bill Barker
Posted At: Thursday, June 09, 2005 9:55 PM
Posted To: Tomcat Dev
Conversation: Re: 5.0.28 w/ MX4J 3.0.1, possible?
Subject: Re: 5.0.28 w/ MX4J 3.0.1, possible?



"Rick" <to...@vidyah.com> wrote in message
news:FLUXupIMDR7LB31Jelc00000001@flux.vidyah.com...
> Hello,
>  I have been trying to migrate to the latest version of MX4J (3.0.1) 
> from the old 1.1.1 version.
> And for the life of me, I don't seem to be able to get it to work.  I 
> use JMX to communicate to various servers in our webapp to show 
> session info on different nodes, and I would also like to implement 
> some other features..
>
> Old 1.1.1 implementation
> -- jk2.properties -------------------- mx.enabled=true
> mx.jrmpPort=1099
> mx.jrmpHost=localhost
>
> -- Code ------------------------------ Hashtable environment = new 
> Hashtable();  environment.put(Context.INITIAL_CONTEXT_FACTORY,
> "com.sun.jndi.rmi.registry.RegistryContextFactory");
>  environment.put(Context.PROVIDER_URL,"rmi://localhost:1099");
>
> JRMPConnector connector = new JMRPConnector(); 
> connector.connect("jrmp", environment);
>
> RemoteMBeanServer server = connector.getRemoteMBeanServer();
> ----------------------------------------
>
> Ok.. So I replaced jmx.jar with the latest version of mx4j.jar 
> (renamed to
> jmx.jar) under tomcat_home/bin
> And replaced or added
> Mx4j-jmx.jar
> Mx4j-tools.jar
> Mx4j-remote.jar
> To /tomcat_home/common/lib
>
> Now, when I start tomcat I get the error..
> "MX4j RMI adapter not loaded: java.lang.ClassNotFoundException:
> mx4j.adaptor.rmi.jrmp.JRMPAdaptor "
>
> Which is correct, since that's not a valid class now, but how do I 
> configure tomcat to properly use the new mx4j.
>

Yep. The jrmp adapter is gone.

> If I enable mx.httpPort=9000/mx.httpHost=localhost then JMX does 
> enable and I get a pretty little message like...
> "HttpAdapter version 3.0.1 started on port 9000" , but I have no idea 
> at this point how to properly use the HTTP connector.
>
> Any info or suggestions to getting the RMI adapter working, or how to 
> use the http adapter, or just the best way to go about Using MX4J, not 
> sure if either is possible with out updating to tomcat 5.5.x.
>

The RMI adapter is gone in mx4j 3.x.  There is nothing that Tomat can do
about it.  You can access the http adapter by simply typing
http://localhost:9000 in you favorite browser.  The only thing you gain by
upgrading to 5.5.x is the ability to use the http adapter in XML instead of
HTML.

> Thanks,
>
> Rick




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: 5.0.28 w/ MX4J 3.0.1, possible?

Posted by Bill Barker <wb...@wilshire.com>.
"Rick" <to...@vidyah.com> wrote in message 
news:FLUXupIMDR7LB31Jelc00000001@flux.vidyah.com...
> Hello,
>  I have been trying to migrate to the latest version of MX4J (3.0.1) from
> the old 1.1.1 version.
> And for the life of me, I don't seem to be able to get it to work.  I use
> JMX to communicate to various servers in our webapp to show session info 
> on
> different nodes, and I would also like to implement some other features..
>
> Old 1.1.1 implementation
> -- jk2.properties --------------------
> mx.enabled=true
> mx.jrmpPort=1099
> mx.jrmpHost=localhost
>
> -- Code ------------------------------
> Hashtable environment = new Hashtable();
>  environment.put(Context.INITIAL_CONTEXT_FACTORY,
> "com.sun.jndi.rmi.registry.RegistryContextFactory");
>  environment.put(Context.PROVIDER_URL,"rmi://localhost:1099");
>
> JRMPConnector connector = new JMRPConnector();
> connector.connect("jrmp", environment);
>
> RemoteMBeanServer server = connector.getRemoteMBeanServer();
> ----------------------------------------
>
> Ok.. So I replaced jmx.jar with the latest version of mx4j.jar (renamed to
> jmx.jar) under tomcat_home/bin
> And replaced or added
> Mx4j-jmx.jar
> Mx4j-tools.jar
> Mx4j-remote.jar
> To /tomcat_home/common/lib
>
> Now, when I start tomcat I get the error..
> "MX4j RMI adapter not loaded: java.lang.ClassNotFoundException:
> mx4j.adaptor.rmi.jrmp.JRMPAdaptor "
>
> Which is correct, since that's not a valid class now, but how do I 
> configure
> tomcat to properly use the new mx4j.
>

Yep. The jrmp adapter is gone.

> If I enable mx.httpPort=9000/mx.httpHost=localhost then JMX does enable 
> and
> I get a pretty little message like...
> "HttpAdapter version 3.0.1 started on port 9000" , but I have no idea at
> this point how to properly use the HTTP connector.
>
> Any info or suggestions to getting the RMI adapter working, or how to use
> the http adapter, or just the best way to go about
> Using MX4J, not sure if either is possible with out updating to tomcat
> 5.5.x.
>

The RMI adapter is gone in mx4j 3.x.  There is nothing that Tomat can do 
about it.  You can access the http adapter by simply typing 
http://localhost:9000 in you favorite browser.  The only thing you gain by 
upgrading to 5.5.x is the ability to use the http adapter in XML instead of 
HTML.

> Thanks,
>
> Rick 




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org