I solved the problem by jaring the interfaces on the ejb side and adding
them to the client's classpath. So I think it either one of two things:
1. The classes on the ejb side had changed but the interface classes on the
client side had not been updated.  
2. The interface files on the client side having a different package
statement than the ejb side classes caused class cast errors.
   


>Replace this:
>       UpdateHome updateHome = (UpdateHome)ref;
>With this:
>       UpdateHome updateHome = 
>(UpdateHome)javax.rmi.PortableRemoteObject.narrow(ref, UpdateHome.class);
>
>Not sure if this is your problem, but you should do it to be more correct.
>
>Also, *IF* you're going to hardcode those JNDI properties, the proper 
>way to do it is to pass a Hashtable containing the props into the 
>constructor of your InitialContext, not doing a System.setProperty(x,x). 
>  Of course, a better way is to set them as -D params to your client 
>java command line.


--

>Nordahl, David C wrote:

>> I have two client classes using the same classpath, but one gets an error
>> trying to get the home interface.  Here is the code:
>> 
>> System.setProperty("java.naming.factory.initial",
>>      "org.jnp.interfaces.NamingContextFactory");
>> System.setProperty("java.naming.provider.url",
>>      "localhost:1099");
>> InitialContext jndiContext = new InitialContext();
>> Object ref  = jndiContext.lookup("session_beans/UpdateBean");
>> UpdateHome updateHome = (UpdateHome)ref; 
>> update = updateHome.create();
>> 
>> 
>> I get the error:
>> 
>> java.lang.ClassCastException: $Proxy0        
>> 
>> at the line that starts with UpdateHome....
>> 
>> Why is the lookup returning a $Proxy0 object instead of the home
interface?
>> 
>> 
>> 
>> 
>> _______________________________________________
>> JBoss-user mailing list
>> [EMAIL PROTECTED]
>> http://lists.sourceforge.net/lists/listinfo/jboss-user
>> 





_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to