Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Context Object in Servlet not finding property values

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm having an odd problem I was hoping someone could shed a little light on.

I've created and deployed my EJB's and created a test client as a stand-alone java app and it connects fine and grabs the info.

But I'm trying to now convert the operation into a servlet so I can test in that manner.

I'm using JDeveloper as my IDE.

But when I try to set up my context in the servlet like this:

Properties props = new Properties();
props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
props.put(Context.PROVIDER_URL, "jnp://10.29.6.93:1099");
props.put(Context.URL_PKG_PREFIXES, "org.jboss.naming rg.jnp.interfaces" );

It tells me that "INITIAL_CONTEXT_FACTORY is not found in class javax.naming.Context".

And when I do a Context. that option is not listed.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic