RE: adding mx4j's connector class to factory list

"Bordet, Simone" <[email protected]>
Newsgroups gmane.comp.java.mx4j.devel
Message-ID <[email protected]>
Hi Blaine,

> Here's my listing of $CATALINA_HOME/common/lib with my 
> installation of TC 5.0.16.  You can tell by the timestamps 
> that I messed with mail.jar, hsqldb.jar and 
> commons-logging.jar.  The rest all came with the distro.

Very strange, Tomcat 5.0.19 is:

Z:\Tomcat5\common\lib>dir
 Volume in drive Z has no label.
 Volume Serial Number is EC08-3EF4

 Directory of Z:\Tomcat5\common\lib

03/11/2004  21:55    <DIR>          .
03/11/2004  21:55    <DIR>          ..
02/14/2004  11:21           952,104 ant.jar
02/14/2004  11:21           165,119 commons-collections.jar
02/14/2004  11:21           100,776 commons-dbcp-1.1.jar
02/14/2004  11:21           112,341 commons-el.jar
02/14/2004  11:21            39,523 commons-pool-1.1.jar
02/14/2004  11:21           344,741 jasper-compiler.jar
02/14/2004  11:21           106,156 jasper-runtime.jar
02/14/2004  11:21           365,858 jmx.jar
02/14/2004  11:21            48,725 jsp-api.jar
02/14/2004  11:21            28,032 naming-common.jar
02/14/2004  11:21            14,862 naming-factory.jar
02/14/2004  11:21             2,068 naming-java.jar
02/14/2004  11:21            42,346 naming-resources.jar
02/14/2004  11:21            91,627 servlet-api.jar
              14 File(s)      2,414,278 bytes
               2 Dir(s)   3,511,607,296 bytes free

> Would you suggest that I try removing the RI remote libs?  

No: if you put MX4J's in WEB-INF/lib then MX4J's should have the precedence.

> > You have mx4j.jar and mx4j-remote.jar in WEB-INF/lib.
> 
> Yes.  I don't want to fill up everybody's mailboxes.  Do you 
> want me to email the war to your personal email addr?

Not for now.

> > You have the rmiregistry running.
> 
> No.  My confusion is because I have not coded my own remote 
> clients for over a year now (using in-JVM connectors and 
> adaptors since then), but when I was making production remote 
> JMX clients, I could swear that I never used any JNDI or 
> rmiregistry-- I didn't need to when I used :rmi:. 
> (Unfortunately, I no longer work there so I don't have access 
> to that code now).  Has something changed, or am I going 
> insane and you always need to run rmiregistry to use :rmi: 
> URLs?  No problem if it's the latter, I'll just re-learn it.

RMI requires the client to retrieve the RMI stub from somewhere.
JSR 160 allows you 2 ways for that: 1 is use of JNDI (which is the normal way for retrieving an RMI stub), 2 is via IOR-like string (again, see Javadocs for javax.management.remote.rmi package for further info): the stub is serialized and its bytes are base64 encoded into a string.

With 2 JVMs, using JNDI is simpler.

> > With this configuration, Tomcat's JMX classes should not be 
> > involved at all.
> 
> Comes down to a classloader issue.  My version of Tomcat does 
> use the RI libs, because it croaks if I remove them.  Since 
> they are in common/lib, they can only be loaded by a 
> high-level classloader.  When my war is loaded, the RI JMX 
> factories have already been loaded by that high-level 
> classloader.  Regardless of the fact that war-bundled classes 
> have higher priority with J2EE 1.3, they will still defer to 
> previously-loaded classes.

This sounds strange to me. It should not matter if the classes are already loaded by a parent classloader, since the mechanism is not the standard Java 'delegate-to-parent'.

I'll try myself on T5.

> I thought that this was why things worked when I ran a mx4j 
> server from my servlet.  I used mx4j by setting 
> javax.management.builder.initial and asking the R.I. factory 
> for a mx4j MBeanFactory (with MBeans using mx4j's 
> AbstractDynamicBean).  Maybe this isn't what is happening, 
> especially since it isn't working for the connector factory.

Yes: I am worried that you're really using MX4J's classes and that they don't work in T5.

Simon


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
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.