Hi,
Sorry to post this problem here but I desperately need the solution of it.
Here is my environment
OS=Window XP
J2EE SDK 1.2_beta because earlier version is not available for XP
J2SDK 1.4.2
I deployed advice bean successfully but when i run the bean through AdviceClient Client program it throws the following exception
java AdviceClient (After Compiled)
javax.naming.NoInitialContextException: Need to specify class name in environmen
t or system property, or as an applet parameter, or in an application resource f
ile: java.naming.factory.initial
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:6
40)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243
)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.jav
a:280)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at AdviceClient.go(AdviceClient.java:19)
at AdviceClient.main(AdviceClient.java:11)
After getting this error,I included all the jar files in lib diretory in the CLASSPATH,then I again run my program and get following error
javax.naming.CommunicationException: Can't find SerialContextProvider
at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.jav
a:81)
at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:138
)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at AdviceClient.go(AdviceClient.java:27)
at AdviceClient.main(AdviceClient.java:12)
I used other program to investigate the problem
import javax.naming.*;
import java.io.*;
import java.util.*;
public class test {
public static void main(String[] args) throws Exception{
Context ctx = new InitialContext();
Hashtable env = ctx.getEnvironment();
System.out.println(env.toString());
}}
it results
{java.naming.corba.orb=com.sun.corba.ee.impl.orb.ORBImpl@ad8659}
I did check this in
JBoss 3.2.2 and getting the same problem,earlier i was using it in Windows 2000 professional and it was working really fine but now I'm stuck in window XP and I believe Advive is really a normal bean which could run in any j2ee version so i think this is not the j2ee version problem or not a classpath problem because i have included all jar's.
So please anybody know the solution or comment, I really appreciate.
Regards,