1 Reply Latest reply on Jan 12, 2006 2:48 PM by epbernard

    EJB 3.0 Simple stand alone client?

    fabriciobraga


      Hello,

      I'm trying to create a simples stand alone EJB 3.0 client but it jut don't work.

      The client woks fine when running on Servet class, but when running a class with public static void main it does not work.

      I'm doing something like this:

      
      public class SimpleClient {
       public static void main(String...args) throws Exception {
      
       Hashtable t = new Hashtable();
       t.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
       t.put(Context.PROVIDER_URL, "localhost");
      
      
       Context ic = new InitialContext(t);
       ProjectService projetService = (ProjectService) ic.lookup( SaqueHome.class.getName());
      
       }
      }
      


      And I got a ClassCastException: Proxy0

      What am I doing wrong? Can anyone help me to wirte a simple EJB 3.0 client?

      Thanks,
      Fabricio Braga