Hi,
** I have a client connecting to a Central Server(CS)
** CS communicates to a Remote Server(RS) based on an Ip address that the client gives us.
So we basically get the context in a Session Bean(SB) by using the ip given, and then do a lookup for another SB on the RS. And i use the PortableRemoteObject.narrow to see if the object i get from the lookup can be Casted to the class that i have on my CS(these interfaces are exposed by the RS, as i do a lookup on them).
Now here i am getting a class cast exception, so i happened to take a printout of the object.toString(), instead of classcasting it as below.
Object obj = context.lookup("ActiveRemoteServer");
System.out.println("The Object is " + obj.toString());
Now that println gives me the same name of the class that i am trying to cast.
What could be the problem ??
I did the following ...
(1) In the ejb-jar.xml the SB on CS that is calling the SB on the RS has an <ejb-ref> defined to as the SB on the RS.
(2) I have included the RS package, (i mean the .jar) along with my CS .ear, as i will not be able to deploy the .Ear on CS with out that.
I am using JBoss3.0.4
One more thing is, i am not quite sure if (2) is right ? Becuz of (2) the beans and all that are there on RS are now deployed on the CS too.
TIA
Meka Toka