• 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
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

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
 
"Don't believe every tiny ad you see on the internet. But this one is rock solid." - George Washington
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic