avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Richard Wallace <rwall...@a--i--m.com>
Subject Altrmi problems
Date Mon, 06 May 2002 23:37:47 GMT
Hello,

I'm trying to use Altrmi in a project I've got coming up.  From what
I've seen I like it much more than regular old RMI.  But I'm having
problems getting it to work with even the simplest examples.  I have the
server generating the proxies dynamically (as opposed to using the ant
task).  I followed the docs on the Avalon site but finally figured out I
needed to set the genSrcDir and the genClassDir.  After figuring that
out I finally go the server up and running.  So, I moved on to the
client.  Again, I followed the docs on the site, but had no luck.  I
keep getting a the following exception:

org.apache.excalibur.altrmi.common.AltrmiConnectionException: Generated
class not found during lookup : AltrmiGenerated2Server_Main

I've tried everything I could think of with the client and the server,
but in the end have had no luck.  Below is some code on how I'm
publishing the object the client is trying to get and how the client is
trying to get the object from the server.

Server publishing object:
File genjava = new File ("genjava");
DynamicGeneratorClassRetriever dgcr = new
        DynamicGeneratorClassRetriever(genjava.getClass ().getResource
                ("excalibur-altrmi-generator.jar"));
dgcr.setSrcGenDir (genjava.getAbsolutePath ());
dgcr.setClassGenDir (genjava.getAbsolutePath ());
PublicationDescription pd = new PublicationDescription(Server.class);
dgcr.generate("Server", pd, genjava.getClass().getClassLoader());

InvocationHandlerAdapter iha = new InvocationHandlerAdapter ();
iha.setClassRetriever (dgcr);
AbstractServer as = new CompleteSocketCustomStreamServer (iha, 1235);
ServerImpl si = new ServerImpl();
as.publish (si, "Server", Server.class);
as.start();


Client retrieving object:
AltrmiFactory af = new ClientClassAltrmiFactory (false);
af.setHostContext (new SocketCustomStreamHostContext ("127.0.0.1",
1235));
Server server = (Server) af.lookup("Server");

I just added the InvocationHandler to the server.  I'm not sure if it's
needed or not.  Any glaring errors?  Any help will be appreciated.

Thanks.

-- 
Richard Wallace
AIM, Inc. (www.a--i--m.com)
Information Systems Consultants

"Providing New Technology,
     the Old-Fashioned Way"


--
To unsubscribe, e-mail:   <mailto:avalon-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-dev-help@jakarta.apache.org>


Mime
View raw message