[ mx4j-Bugs-1034685 ] cannot start HTTP Adopter within tomcat

"SourceForge.net" <[email protected]>
Newsgroups gmane.comp.java.mx4j.devel
Message-ID <[email protected]>
Bugs item #1034685, was opened at 2004-09-25 11:15
Message generated for change (Comment added) made by creechy
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=450647&aid=1034685&group_id=47745

Category: HTTP Adaptor
Group: Release 2.0.1
Status: Open
Resolution: None
Priority: 5
Submitted By: rzo (rzorzorzo)
Assigned to: Nobody/Anonymous (nobody)
Summary: cannot start HTTP Adopter within tomcat

Initial Comment:
Hi,

I am trying to start the HTTP adaptor within tomcat 5.0.28.
I am registring it within the init method of a servlet.
However I am always getting a ClassNotFound Exception.
I tried putting the mx4* jars in all possible lib
directories of tomcat with no success. Could anyone help.

Thanks

- Ron.

----------------------------------------------------------------------

Comment By: Joe Mocker (creechy)
Date: 2005-01-07 09:38

Message:
Logged In: YES 
user_id=358158

Tomcat 5.0 is a little tricky, because the Tomcat developers
themselves have instrumented Tomcat with JMX. Very Cool.
However, this means that they have supplied a version of JMX
(I'm not sure which) with Tomcat. 

What may be happening is that there is a ClassLoader
problem, where some classes are being loaded from the main
Tomcat ClassLoader, and others from the WebApp ClassLoader.

I looked at this a while ago, so its a little foggy, but
here's how I remember getting it to work.

All the changes I made to get it to work were in the
TOMCAT_HOME/bin
directory.

If you go there, you will see a jmx.jar. What I did as move
this out of the way by renaming jmx.jar to jmx.jar-orig.

Then I copied mx4j-jmx.jar and mx4j-impl.jar into this
directory.

Now, unfortunately, in the bootstrap.jar file, there is a
reference to 
jmx.jar Class-Path property of the MANIFEST.MF file. This
needs to
be changed so that the Class-Path includes the MX4J jars
instead.
This can be accomplished by unjar'ing boostrap.jar, modifying 
MANIFEST.MF then jar'ing it back up again.  My Class-Path line
looked like this when it was alll done:

Class-Path: mx4j-jmx.jar mx4j-tools.jar commons-daemon.jar
commons-logging-api.jar

Last, take the MX4J jars out of your Webapp. Since Tomcat has 
already loaded them in the base ClassLoader.

Again, this is a little fuzzy since it's been a while, but
hopefully this is  
a helpful start. 

Now that I think about it, it may be easy enough to just
copy mx4j.jar
(which includes mx4j-jmx.jar and mx4j-impl.jar) over the
jmx.jar that
comes with the dist, and no other mods are probably necessary.

However, If you need things like the tools in
mx4j-tools.jar, I presume 
this will need to be loaded with the rest of them.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=450647&aid=1034685&group_id=47745


-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.