• 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

JBoss Initial Context

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
I am running JBoss 3. I have a client connecting to it as -

Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NaminContextFactory";
env.put(Context.PROVIDER_URL, "jnp://localhost:1099");
Context ctx = new InitialContext(env);

I run it as
java -Djava.naming.factory.url.pkgs=org.jboss.naming Client



I get an error as

javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial


Any help would be much appreciated.
Thanks a lot.
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"NaminContextFactory"

Is missing a "g" for "NamingContextFactory

you also need

java.naming.factory.url.pkgs=org.jboss.naming rg.jnp.interfaces

in your properties.

Mark
 
Mark Spritzler
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And why do you need "-Djava.naming.factory.url.pkgs=org.jboss.naming"

in running your client app?

Mark
 
Nupur Gupta
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey Mark,

Well, I needed 'org.jboss.naming' as a runtime parameter because I did not know the corresponding property name which is 'java.naming.factory.url.pkgs'. LOL, stupid reason, I know.

Well in the event, I found that a lot more jar files needed to be included in my classpath such as 'jbossall-client.jar' which are included with the jboss distribution. So I did that, and it worked.

I really appreciate your help, and I like your pithy signature .

DG
 
reply
    Bookmark Topic Watch Topic
  • New Topic