Well, just to test i've written a simple client which does
try {
System.setSecurityManager(new
java.rmi.RMISecurityManager());
}
catch (java.rmi.RMISecurityException exc) {
System.err.println("Security violation " + exc.toString());
}
Context ctx = getInitialContext(); //standard stuff
Object refEJB=ctx.lookup("FirstBean");
I need this client to be ignorant about FirstBeanHome. It works just as it
is on the host with JBoss ( first JBoss ).
It doesn't work on another host: java.lang.ClassNotFoundException:
FirstBeanPackage.FirstBeanHome.
On this other host I need to have JBoss installed ( second JBoss ). Probably
from within a service of this other
JBoss instance I will eventually do the loookup ( an alternative would be to
do it from an mobile agent (IBM aglet)
which arrives at this second host, so still a remote client ). But not yet.
I've read about the bug in JBoss (reported as item #424287) some time ago
and I thought that it might be the cause.
But I was troubled by the fact that it didn't work even when I've set
java.rmi.server.codebase to the path
of the jar with the bean on the first JBoss. A file:// path which is in the
local network so it is reachable from the second JBoss.
If you're not bored yet, the bigger picture.
A client makes a request for a bean to a JBoss instance ( through a custom
JNDI ). This one sends a mobile agent to
a few JBoss fellows to ask them about this name. The agent returns with a
list of servers wich have the name and
server load information. The first JBoss chooses a server based on the load
information and does a lookup to
return the reference to the client ( through the custom JNDI ). I cannot
have one JBoss instance knowing about
all the home interfaces of all its JBoss fellows.
----- Original Message -----
From: "Alexander Kogan" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, May 16, 2001 12:53 AM
Subject: Re: [JBoss-user] Blind Lookup
>
>
>
> Lucian Bargaoanu wrote:
> >
> > Thanks, actually this is more than I need. I just need to return the
result
> > of lookup.
> > I've succeeded to do that locally, but from another host it doesn't
work.
> > I did set a security manager.
>
> If by "from another host" you meant "from another jboss instance", that
> is
> a bug. I experienced it a few month ago and recently it was discovered
> and
> filed as "the bug" at sourceforge.
>
> From other side, if you were talking about a "client" on another host, it
> should
> work. At least for me.
>
> Tell us, what are you exactly doing.
>
>
>
> >
> > //Lucian,
> > //
> > //it's not legal, according to spec, but it works in jboss:
> >
> > // try
> > // {
> > // Object home = context.lookup(componentName);
> > // Method createMethod = home.getClass().getMethod("create",
> > //null);
> >
> > // Object component = createMethod.invoke(home, null);
> > // }
> > // catch (NamingException ne) {}
> >
> > //and don't forget to set a SecurityManager.
> >
> > //good luck.
> >
> > //Lucian Bargaoanu wrote:
> > >
> > > I need to look up a bean without knowing about it's home interface.
> > > Can i do that? I tried and it tells me that it cannot find the home
> > > interface.
> > > Can't i download somehow that .class file from the server?
> > > Maybe with the RMI classloader.
> > >
> > > Sorry if this is a silly question.
> > >
> > > _______________________________________________
> > > JBoss-user mailing list
> > > [EMAIL PROTECTED]
> > > http://lists.sourceforge.net/lists/listinfo/jboss-user
> >
> > --
> > __________________________________________________
> > Alexander Kogan PTC www.ptc.com
> > [EMAIL PROTECTED] 140 Kendrick St. Needham MA 02494
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user