Hi, folks,
Sorry for asking this question, as the similar question was posted before! However, as I searched through all the posts regarding the question, I still CANNOT find the solution.
I followed the steps in Chapter 1 for running the AdviceClient example, in the following environment:
1)J2SDK 1.5
2)
J2EE SDK 1.4 and Sun
Java Application Server v8
3)XP pro
And I was reported the following error:
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
...
I had tried several suggestions regarding the same problem posted in the forum, none of which is working for me!
1) Provide the interpreter java with j2ee.jar file and other archive files
java -cp c:\AppServer\lib\j2ee.jar;AdviceAppClient.jar;. AdviceClient
Note c:\AppServer\ is J2EE SDK 1.4 directory
2) Change getAdvice to getMessage posted on the following link:
http://wickedlysmart.com/HeadFirst/HeadFirstEJB/HeadFirstEJBNotes.html 3) Provide properties in a JNDI.properties file
4)Hard-code properties in the AdviceClient
Here is my question:
MUST I use J2EE SDK 1.3 in order to run the example? However, the link for downloading j2EE SDK 1.3 or 1.3.1 is down currently.
http://java.sun.com/j2ee/sdk_1.3/ But I think J2EE 1.4 should be able to run the example, which I cannot do it.
Any ideas? Thanks in advance!!!
Regards
Song
[ February 08, 2005: Message edited by: Songxun Lin ]