This content has been marked as final.
Show 3 replies
-
2. Re: how to call the session bean after deployed
jaikiran Oct 27, 2006 12:51 PM (in response to darrencnz1976)Happened to read your post again. Your problem lies in this code:
Properties props = System.getProperties(); Context ctx = new InitialContext(props); Object obj = ctx.lookup("HelloBean");
Change it to:Context ctx = new InitialContext(); Object obj = ctx.lookup("HelloBean");
-
3. Re: how to call the session bean after deployed
darrencnz1976 Oct 29, 2006 1:09 PM (in response to darrencnz1976)"jaikiran" wrote:
Have a look at:
http://wiki.jboss.org/wiki/Wiki.jsp?page=Getquotjavax.naming.NoInitialContextExceptionquot
I just realized the real problem is:
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 have changed my code to:
try{
InitialContext ic = new InitialContext();
ic.createSubcontext("Test");
System.out.println("pass");
System.out.println("pass");
}catch(Exception e){
System.out.println(e);
e.printStackTrace();
}
it having problem on this sentence: ic.createSubcontext("Test");
i have put jndi.properties into the classpath, this file contains:
# DO NOT EDIT THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING
#
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
pls help!