Pessoal
Estou com um problema para acessar meu EJB
as classes do EJB são
Adder (interface Remota), AdderHome (interface Home) e AdderBean (classe)
meu cliente é assim:
/*
* BeanClient.java
*
* Created on 24 de Novembro de 2004, 16:23
*/
import javax.naming.*;
import javax.rmi.PortableRemoteObject;
import java.util.Properties;
import com.testeejb.*;
/**
*
* @author JVictor
*/
public class BeanClient {
public static void main(String[] args)
{
Properties prop = new Properties();
prop.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
prop.put(Context.PROVIDER_URL, "localhost:8080");
try
{
InitialContext jndiContext = new InitialContext(prop);
System.out.println("got context");
Object ref = jndiContext.lookup("Adder");
System.out.println("referencia");
AdderHome home = (AdderHome) PortableRemoteObject.narrow(ref, AdderHome.class);
Adder adder = home.create();
System.out.println("2 + 5 = " + adder.add(2, 5));
}
catch (Exception ex)
{
ex.printStackTrace();
System.out.println("Deu pau");
}
}
}
Q tá pegando???
Valeu