• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

naming.InvalidNameException

 
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello GUys,

I am trying to run a message bean client, I get the following exception.

http://127.0.0.1:4848/
Could not create JNDI context: javax.naming.InvalidNameException: unknown protocol: http

Here is the code

--------------------------------------------------------------------------------------
final String contextRoot = "http://127.0.0.1:4848/";
Hashtable env = new Hashtable(5);
try {
//env.put(Context.INITIAL_CONTEXT_FACTORY,
// "com.sun.jndi.fscontext.RefFSContextFactory");
// env.put(Context.PROVIDER_URL, contextRoot);

env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.fscontext.RefFSContextFactory");
System.out.println(contextRoot);
env.put(Context.PROVIDER_URL,contextRoot);
// DirContext ctx = new InitialDirContext(env);

jndiContext = new InitialContext(env);
} catch (NamingException e) {
System.out.println("Could not create JNDI " + "context: "
+ e.toString());
System.exit(1);
}
-------------------------------------------------------------------------------
I am using Sun App server installed on my machine.
What might be the cause of this exception.
ANy help would be appreciated.
 
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
if we use,
.fscontext.RefFSContextFactory
don't we have to use file://<<path to location>> protocol instead http?
Thanks
Maulin
 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
try using t3 instead of http. The protocol that is generally used is t3
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic