[jboss-user] [Beginners Corner] - Re: Cannot Get InitialContext Lookup to Work

coejboss do-not-reply at jboss.com
Tue Aug 7 08:44:57 EDT 2007


Can you deploy your EJB separately as a JAR inside JBoss? And then deploy your application as war.

Just try to get InitialContext somewhat like this:

Properties properties = new Properties();
properties.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
properties.put("java.naming.provider.url", "localhost:1099");
properties.put("java.naming.factory.url.pkgs", "org.jboss.naming");
InitialContext initialcontext = new InitialContext();
Object obj1 = initialcontext.lookup("ConnectionFactory");

The lookup you need to provide in EJB-JAR.xml which you'll deploy as a JAR.
Keep your code commented in Web.xml. No need to change anything else I suppose. 

Just give it a try. Let's see if it works.


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

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



More information about the jboss-user mailing list