Olá Pessoal.
Estou com problemas tentando acessar um ejb exemplo que fiz no sun app server 8. (Servidor teste que tenho).
O deploy foi do ejb 2.0 OK.
Mas rodo o client em minha máquina e da o erro. ( java.lang.ClassCastException )
// TRECHO DO CÓDIGO DO CLIENT.
Properties props = new Properties();
props.put(Context.INITIAL_CONTEXT_FACTORY, “com.sun.jndi.cosnaming.CNCtxFactory”);
props.put(Context.PROVIDER_URL, “iiop://192.168.0.2:3700”);
Context c = new InitialContext(props);
HelloHome home = (HelloHome) PortableRemoteObject.narrow(c.lookup(“Hello”),HelloHome.class);
Hello hello = home.create();
System.out.println(hello.sayHello());
hello.remove();
// FIM DO TRECHO.
// ERRO DO CLIENT
java.lang.ClassCastException
at com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(Unknown Source)
at javax.rmi.PortableRemoteObject.narrow(Unknown Source)
at com.examples.HelloClient.main(HelloClient.java:24)
Exception in thread “main”
//FIM DO ERRO
[]'s
Obrigado.