Hi!

I have got the infamous ClassCastException problem when casting a home
interface got from a context lookup. 

I have seen many mails about this problem on this list, with good advice and
hints. But no one saying that it works.

My code is the orion-primer example (http://www.jollem.com/orion-primer/)
that works inside one machine but fails between two machines. The
orion-primer is a ear with a web application that uses a simple EJB.

The code fails in the narrow method below:

...
Context context = new InitialContext();
Object boundObject = context.lookup("Hello");
HelloHome helloHome = (HelloHome) 
      PortableRemoteObject.narrow(boundObject, HelloHome.class);
...

The EJB works - I can call it using reflection. This proves that I have not
made any other mistake. I think this may be a classloader problem in the
class produced by the orion RMIInitialContextFactory.

The code above works fine inside a java application.

Regards,
Dag Rende


Reply via email to