• Post Reply Bookmark Topic Watch Topic
  • New Topic

JBoss Initial Context

 
Nupur Gupta
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • 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.
 
Mark Spritzler
ranger
Sheriff
Posts: 17290
9
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • 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
Sheriff
Posts: 17290
9
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!