• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

getting javax.naming.NoInitialContextException: Need to specify class name in environmen t or system

 
Nitish Bijalwan
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please help . I have written client for my helloWorld bean class . But it while running it is throwing the javax.naming.NoInitialContextException . I qm using PE server which comes in j2ee 1.4 sdk.
 
Nitish Bijalwan
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nitish Bijalwan wrote:Please help . I have written client for my helloWorld bean class . But it while running it is throwing the javax.naming.NoInitialContextException . I qm using PE server which comes in j2ee 1.4 sdk.


Got the answer.


In your classpath variable just add appserv-rt.jar
For example I have install appserv in C: directory
classpath = .;C:\Sun\AppServer\lib\j2ee.jar;C:\Sun\AppServer\lib\appserv-rt.jar;

And just compile it by
javac -classpath %classpath%;AdvieAppClient.jar AdviceClient.java

And run it as

java -cp %classpath%;AdviceAppClient.jar AdviceClient
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic