Hello Subadhra,
I get the same exception as you get can you tell me what user name & password should i give for the
Context.SECURITY_PRINCIPAL and Context.SECURITY_CREDENTIALS
Now i'm giving the user name and password that i give to login into Oracle App Server
private HelloHome lookupHome()throws NamingException
{
// Lookup the beans home using JNDI
Context ctx = getInitialContext();
try
{
Object home = ctx.lookup(JNDI_NAME); // Getting error here
return (HelloHome) narrow(home, HelloHome.class);
}
catch (NamingException ne)
{
log(ne.toString());
log("The client was unable to lookup the EJBHome. Please make sure ");
log("that you have deployed the
ejb with the JNDI name "+JNDI_NAME+" on the server at "+url);
throw ne;
}
}
private Context getInitialContext() throws NamingException
{
try
{
// Get an InitialContext
Properties h = new Properties();
h.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.ApplicationClientInitialContextFactory");
//
h.put(Context.PROVIDER_URL, url);//ormi:localhost:23791
h.put(Context.SECURITY_PRINCIPAL, "ias_admin");
h.put(Context.SECURITY_CREDENTIALS, "system12");
return new InitialContext(h);
}
catch (NamingException ne)
{
log (ne.toString());
log("We were unable to get a connection to the server at "+url);
log("Please make sure that the server is running.");
throw ne;
}
}
java.lang.InstantiationException: Error communicating with server: Lookup error:
java.net.ConnectException: Connection refused: connect; nested exception is:
java.net.ConnectException: Connection refused: connect; nested exception
is:
javax.naming.NamingException: Lookup error: java.net.ConnectException: C
onnection refused: connect; nested exception is:
java.net.ConnectException: Connection refused: connect [Root exception i
s java.net.ConnectException: Connection refused: connect]
at com.evermind.server.ApplicationClientContext.createContext(Applicatio
nClientContext.java:61)
at com.evermind.server.ApplicationClientInitialContextFactory.getInitial
Context(ApplicationClientInitialContextFactory.java:155)
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.init(Unknown Source)
at javax.naming.InitialContext.<init>(Unknown Source)
at Client.getInitialContext(Client.java:111)
at Client.lookupHome(Client.java:80)
at Client.<init>(Client.java:22)
at Client.main(Client.java:33)
javax.naming.NamingException: Error reading application-client descriptor: Error
communicating with server: Lookup error: java.net.ConnectException: Connection
refused: connect; nested exception is:
java.net.ConnectException: Connection refused: connect; nested exception
is:
javax.naming.NamingException: Lookup error: java.net.ConnectException: C
onnection refused: connect; nested exception is:
java.net.ConnectException: Connection refused: connect [Root exception i
s java.net.ConnectException: Connection refused: connect]
We were unable to get a connection to the server at
ormi://localhost:23791 Please make sure that the server is running.
[ July 28, 2004: Message edited by: oman tel ]