Hi,
I have a simple Hello bean deployed and my client throws following
exceptions(trace at the end of message)... the code for getting initial
context and then the bean instance is
//getting the context
Context ctx = null;
try {
ctx = new InitialContext();
}
catch (Exception e1) {
e1.printStackTrace();
return;
}
//getting the bean instance
HelloHome helloHome = null;
try {
helloHome = (HelloHome) ctx.lookup("Hello");
} catch (Exception e2) {
e2.printStackTrace();
return;
}
The same client and bean used to work with an older version of jboss(I
am using jboss after some 2-3 months).... earlier i used to get context
like
Properties prop = new Properties();
prop.put(Context.INITIAL_CONTEXT_FACTORY,
"org.jnp.interfaces.NamingContextFactory");
Context ctx = null;
try {
ctx = new InitialContext(prop);
}
Since, it looks like things have changed now and I checked the samples
as well...
What more do I need to do?
--------
Trace
-------
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:646)
at
javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:246)
at
javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:283)
at javax.naming.InitialContext.lookup(InitialContext.java:350)
at hello.HelloClient.<init>(HelloClient.java:36)
at hello.HelloClient.main(HelloClient.java:75)
Exception in thread "main" java.lang.NullPointerException
at hello.HelloClient.run(HelloClient.java:61)
at hello.HelloClient.main(HelloClient.java:77)
Thanks
Abhishek
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]