Hi everybody,
I have deployed an IIOP enabled EJB on JBOSS.
My Corba client tries to get the InitialContext in the following manner :
Properties prope = new Properties();
prope.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.cosnaming.CNCtxFactory");
prope.put(Context.PROVIDER_URL,"corbaloc::localhost:3528/JBoss/Naming/root");
try {
context = new InitialContext(prope);
} catch (NamingException e) {
e.printStackTrace();
}
I start JBoss server using the following command line:
run -c all --host=localhost
I use the following VM parameters:
-Dorg.omg.CORBA.ORBClass=org.jacorb.orb.ORB -Dorg.omg.CORBA.ORBSingletonClass=org.jacorb.orb.ORBSingleton -Djava.security.manager=.\java.policy
When I try to get a reference to the home interface of my EJB
using the lines below
Object ref = context.lookup("jndiName");
XXXHome home =
(XXXHome) PortableRemoteObject.narrow(ref,XXXHome.class);
I get the following exception:
java.lang.ClassCastException at com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(unknownsource) at javax.rmi.PortableRemoteObject.narrow(unknownsource)
Can anybody help me i have stuuked for nearly 2 weeks
First add to your VM properties the following line:
-Djava.security.manager
Make sure your home interface extends directly the EJBHome.
Remove the server stub from your classpath.
Stan.