i was trying the HF EJB advicebean example in chap.1. everything was going fine till the last step,when I ran the AdviceClient,this was what i got: 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 Please help me out. Thanx in advance.
I don't have HF EJB, but the error occur because you doesn't have the right properties, or classpath settings for your client. Try to create a jndi.properties file whit the following arguments:
And put it in the classpath of your client app.
Note that this example is for JBoss, you have to provide the right values for Initial Factory and Connection URL for the conteiner that you are using, also you need the jar that contain the class for Initial Factory in your client classpath.
There are other ways to pass that values, like command Line option -D and, in your code, passing as an argument for your Initial Context