Do you have set the Context.INITIAL_CONTEXT_FACTORY and the Context.PROVIDER_URL properties for get an InitialContex?
Hashtable c = new Hashtable( );
c.put( Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory" );
c.put( Context.PROVIDER_URL,"jnp://localhost:1099" );
Context ctx = new InitialContext( c );
Object ref = ctx.lookup( "SomeXXX" );
What would induce you to look around a little bit to find that the answer to this question has been posted maybe 100 times? What would induce you to use an informative subject line?