0 Replies Latest reply on Jun 25, 2005 8:20 AM by Leos Urban

    Entity EJB3 Example with Hibernate as persistance Layer

    Leos Urban Newbie

      Change your client:

      import de.anwend.ejb.XText;
      import javax.naming.InitialContext;
      
      public class Client
      {
       public static void main(String[] args) throws Exception
       {
       java.util.Hashtable<String,String> ht = new ava.util.Hashtable<String,String>();
       ht.put("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory");
       ht.put("java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.interfaces");
       ht.put("java.naming.provider.url","localhost");
       InitialContext ctx = new InitialContext(ht);
       System.out.println("hello");
       XText cart = (XText) ctx.lookup(XText.class.getName());
       System.out.println("Hello World");
      
       }
      }
      


      Alternative is using jndi.properties file, see tutorial for example.

      Leonell