[jboss-user] [EJB/JBoss] - Re: EJB not bound :

Arvind_MV do-not-reply at jboss.com
Fri Jul 4 08:57:49 EDT 2008


Hi All,
        
        I know that many have posted the same query but i followed some steps based on this post. But still i am unable to resolve the issue.

My test program is as shown below:

 nitialContext iniCtx= null;
		Context ejbCtx = null;
		CryptoHome home=null;
		Properties props = null;
	    //MyBeanLocal local = null;
	    Object ref = null;
	    CryptoHome cryptoHome=null;
		try {
		
			/* iniCtx = new InitialContext();
			//ejbCtx = (Context) iniCtx.lookup("java:comp/env/ejb/Crypto");
			//home = (CryptoHome) iniCtx.lookup("Crypto"); //java:comp/env/
			home  = (CryptoHome) new InitialContext().lookup("java:comp/env/ejb/Crypto"); */
			    props = new Properties();
		        props.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
		        props.put(Context.URL_PKG_PREFIXES,  "org.jboss.naming:org.jnp.interface");
		        props.put(Context.PROVIDER_URL, "jnp://localhost:1099");
		        // I have tried "localhost:1099", 127.0.0.1, etc  as well

		       Context ctx= new InitialContext(props);
		       // *never makes it here, exception NameNotFoundException*
		      
		       //Object ref = ctx.lookup("MyBeanLocal");
		       cryptoHome = (CryptoHome)ctx.lookup("java:comp/env/Crypto");
		       //local = cryptoHome.create();
			} catch (NamingException e1) {
				// TODO Auto-generated catch block
				e1.printStackTrace();
			}
		  

At the crypto home it is throwing the nullpointer exception, is it right way of mentioning the JNDI name. In the Jboss console it shows javax.naming.NameNotFoundException: Crypto not bound 

Please let me know the solution.

Thanks,
Arvind

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4162550#4162550

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4162550



More information about the jboss-user mailing list