I am doing an example from HF. I think I followed the instructions exactly as it is from HF. But I am not able to run the program. I am getting the following error:
C:\projects\advice>java AdviceClient 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 at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:640) at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243) at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:280) at javax.naming.InitialContext.lookup(InitialContext.java:347) at AdviceClient.go(AdviceClient.java:15) at AdviceClient.main(AdviceClient.java:9)
My JNDI name and the name in the context lookup are the same. Any help is greately appreciated. Thanks.
CLASSPATH should contain your j2ee jar file as well as your application jar file. just put directory path for AdviceAppClient.jar file ok. and follow the instruction in the book. $ javac -classpath %CLASSPATH%;AdviceAppClient.jar AdviceClient.java
$ java -cp %CLASSPATH%;AdviceAppClient.jar AdviceClient Bingo This is what I did and it works fine may be you can try the same. vikas prasad
I have the following in the env variable. JAVA_HOME=C:\j2sdk1.4.2_06 CLASSPATH=C:\Program Files\Apache Software Foundation\Tomcat 5.0\common\lib\servlet-api.jar;C:\Program Files\Altova\xmlspy\XMLSpyInterface.jar
When I execute the command to run,I specify the classpath in the command. C:\projects\advice>java -cp .;C:\Sun\AppServer\lib\j2ee.jar;AdviceAppClient.jar AdviceClient
Do I still have to set my environment variables?
I don't have a J2EE_HOME environment variable. Where is it pointing to?
I get the error only when I run. I can compile.
Thank you very much. [ November 28, 2005: Message edited by: PradeepPillai Pradeep ]