tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jaber C. Mourad" <mja...@centralpay.net>
Subject RE: Tomcat - RMI client
Date Fri, 18 Apr 2003 08:53:12 GMT
Hi,
I have an other question, is it possible to define the
java.rmi.server.codebase ?
I wish to have an http server to provide .class files as I have already
done with some standalone rmi server/client.
I test it with defining JAVACMD into the tomcat4.conf file but it
doesn't work at all...
Somebody's got an idea ?
Thanks

Mourad

Le mer 16/04/2003 à 11:37, Bodycombe, Andrew a écrit :
> Image having an RMI server called myRmiServer, running on port 1099 of the
> local machine.
> It has a Remote interface called MyRmiServerRemote
> 
> Naming.lookup("//localhost:1099/myRmiServer);
> 
> Returns an instance of the RemoteInterface, MapDecorator. Cast this return
> value to its correct type (MyRmiServerRemote), and you can then use the
> methods of the Remote interface as if it were a local object.
> 
> If the RMI server is located on a different machine, e.g. 11.22.33.44, then
> the command is as follows:
> 
> Naming.lookup("//11.22.33.44:1099/myRmiServer);
> 
> This is the same as if the servlet was a standalone client. 
> 
> When building myRmiServer, I use ant to:
> 1) Compile all the classes
> 2) RMI Compile the required RMI implementation class
> 3) Build a myRmiServer_Client.jar containing all the classes used by the
> client
> 	This includes the Stub class of the RMI server,
> 	the Remote interface,
> 	and any data container objects used to pass data to the server
> 4) Build a myRmiServer_Server.jar containing all the remaining classes
> 5) The _Client.jar is built into the /WEB-INF/lib directory for the web
> application
> 6) Both the _Client.jar and _Server.jar are deployed to the myRmiServer
> deployment directory
> 
> Hope this helps
> 	Andy
> 
> -----Original Message-----
> From: Jaber C. Mourad [mailto:mjaber@centralpay.net] 
> Sent: 16 April 2003 09:54
> To: Tomcat Users List
> Subject: RE: Tomcat - RMI client
> 
> 
> Great ! do you change any config file, policy file or smthg else ?
> Because it doesn't work at all with servlet...
> Thanks
> 
> Mourad
> 
> Le mer 16/04/2003 à 10:31, Bodycombe, Andrew a écrit :
> > 4.1.12, 4.1.18, and 4.1.24 on Windows and Unix
> > 
> > -----Original Message-----
> > From: Jaber C. Mourad [mailto:mjaber@centralpay.net] 
> > Sent: 15 April 2003 17:51
> > To: Tomcat Users List
> > Subject: RE: Tomcat - RMI client
> > 
> > 
> > What is your tomcat version ?
> > I'm under linux with tomcat 4.1.24 and the lookup is not transparent at
> > all ....
> > 
> > Mourad
> > 
> > Le mar 15/04/2003 à 18:07, Bodycombe, Andrew a écrit :
> > > I use tomcat as an RMI client all the time.
> > > 
> > > The only issue I have is on Windows you must make sure tomcat is not
> > > installed in a directory containing spaces. I think this is a general
> RMI
> > > issue, not just tomcat.
> > > 
> > > I use the Naming.lookup() method to retrieve the Remote interface to my
> > > object,
> > > And then method calls work "transparently". I have no need to play
> around
> > > with codebases or classloaders. Perhaps my configuration very simple
> > > compared to yours...
> > > 
> > > Andy
> > > 
> > > -----Original Message-----
> > > From: Jaber C. Mourad [mailto:mjaber@centralpay.net] 
> > > Sent: 15 April 2003 17:00
> > > To: Tomcat Users List
> > > Subject: RE: Tomcat - RMI client
> > > 
> > > 
> > > Thanks a lot,
> > > So, if I understand, rmi will not be supported by futur tomcat server,
> > > isn't it ?
> > > 
> > > Le mar 15/04/2003 à 16:33, Oxley, David a écrit :
> > > > Servlets and RMI are not happy at coexisting! If I were you I would
> > switch
> > > > to using SOAP. But if you insist on using RMI, then you can't use
> > > > java.rmi.server.codebase. You need to add a codebase to the
> Classloader
> > > > (WebappClassLoader). Really, when you've loaded the classes you need,
> > the
> > > > code base should be removed from the Classloader, but I haven't found
> a
> > > way
> > > > to do this. Here is the code I use:
> > > > 	// This stuff is for Tomcat 4.1.10 and above. (RMI doesn't work with
> > > > TC4 before this version).
> > > > 	Method m = null;
> > > > 	try {
> > > > 		ClassLoader cl = StaffPlannerServer.class.getClassLoader();
> > > > 		Class clc = cl.getClass();
> > > > 		if
> > > > (clc.getName().equals("org.apache.catalina.loader.WebappClassLoader"))
> {
> > > > 			Class[] classes = new Class[1];
> > > > 			Object[] parms = new Object[1];
> > > > 			classes[0] = String.class;
> > > > 			parms[0] = codeAddr;
> > > > 
> > > > 			// Set debug
> > > > 			/*Class[] classes2 = new Class[1];
> > > > 			Object[] parms2 = new Object[1];
> > > > 			classes2[0] = Integer.TYPE;
> > > > 			parms2[0] = new Integer(4);
> > > > 
> > > > 			Method m2 = clc.getMethod("setDebug", classes2);
> > > > 			m2.invoke(cl, parms2);*/
> > > > 				
> > > > 			m = clc.getMethod("addRepository", classes);
> > > > 			m.invoke(cl, parms);
> > > > 		}
> > > > 	}
> > > > 	catch (Exception e) {}
> > > > 		
> > > > 	// And if we're running Tomcat 3.x or a different AppServer
> > > > completely. Do it the old way.
> > > > 	if (m == null) {
> > > > 		Properties p = System.getProperties();
> > > > 		p.remove("java.rmi.server.codebase");
> > > > 		p.put("java.rmi.server.codebase", codeAddr);
> > > > 		System.setProperties(p);
> > > > 	}
> > > > 
> > > > 	// Now load all classes needed to be accessible remotely.
> > > > 
> > > > Dave.
> > > > 
> > > > 
> > > > > -----Original Message-----
> > > > > From: Jaber C. Mourad [mailto:mjaber@centralpay.net]
> > > > > Sent: 15 April 2003 15:05
> > > > > To: Tomcat Users List
> > > > > Subject: Tomcat - RMI client
> > > > > 
> > > > > Hi,
> > > > > I was reading the mailling list archieve and I haven't found info
> > about
> > > > > that.
> > > > > I'm trying to use servlet as RMI client and I can't understand how
> the
> > > > > security manager works into tomcat ( 4.1.24 rpm version ).
> > > > > I'm very newbies into tomcat configuration.
> > > > > Where can I define environement variables as java.security.policy
or
> > > > > java.rmi.server.codebase ?
> > > > > My rmi server work with a standalone client...
> > > > > Thanks a lot fro your help
> > > > > 
> > > > > --
> > > > > Jaber C. Mourad <mjaber@centralpay.net>
> > > > > 
> > > > > 
> > > > >
> ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > > > > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> > > > > 
> > > > > 
> > > > >
> > ________________________________________________________________________
> > > > > This e-mail has been scanned for all viruses by Star Internet. The
> > > > > service is powered by MessageLabs. For more information on a
> proactive
> > > > > anti-virus service working around the clock, around the globe,
> visit:
> > > > > http://www.star.net.uk
> > > > >
> > ________________________________________________________________________
> > > > 
> > > > 
> > > >
> ________________________________________________________________________
> > > > This e-mail has been scanned for all viruses by Star Internet. The
> > > > service is powered by MessageLabs. For more information on a proactive
> > > > anti-virus service working around the clock, around the globe, visit:
> > > > http://www.star.net.uk
> > > >
> ________________________________________________________________________
-- 
Jaber C. Mourad <mjaber@centralpay.net>


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


Mime
View raw message