Regarding Remote Server Connection

Hi all,

I am try'n to connect to the remote server ,which is the AppServer ,to get the datasource connection from it from my local system ,here is the code am using for it

public Connection getConnection() throws Exception {

Connection conn = null;

if (conn == null) {

try{

env.put(Context.INITIAL_CONTEXT_FACTORY,

"com.evermind.server.rmi.RMIInitialContextFactory"/*"com.evermind.server.rmi.ApplicationClientInitialContextFactory"*/);

env.put(Context.SECURITY_PRINCIPAL, props.getProperty("csms.server.security.principal"));

env.put(Context.SECURITY_CREDENTIALS,props.getProperty("csms.server.security.credentials"));

env.put(Context.PROVIDER_URL, props.getProperty("csms.server.provider.url"));

}

catch(Exception e){

e.printStackTrace();

}

Context ctx = new InitialContext(env);

try {

DataSource ds = (DataSource) ctx.lookup(props.getProperty("csms.server.datasourcename"));

conn = ds.getConnection();

} catch (Exception e) {

e.printStackTrace();

}

}

return conn;

}

Properties:

csms.server.security.principal=orcladmin

csms.server.security.credentials=admin123

csms.server.provider.url=ormi://172.16.1.134:12401

csms.server.datasourcename=jdbc/csms

i am getting the following exception

I AM ABLE TO GET THE CONTEXT BUT NOT THE DATASOURCE LOOKUP FROM IT

Lookup error: javax.naming.AuthenticationException: Invalid username/password for default (orcladmin);

[1559 byte] By [rajnikanthgoldstonea] at [2007-11-27 11:09:27]
# 1

You are supplying an incorrect username and/or password.

cotton.ma at 2007-7-29 13:35:29 > top of Java-index,Java Essentials,Java Programming...
# 2

I'm using the same username and password which is used to login the enterprise manager server.

rajnikanthgoldstonea at 2007-7-29 13:35:29 > top of Java-index,Java Essentials,Java Programming...
# 3

There might be an xml config file for the data source where the username/password has to be specified -- maybe the values are wrong in that file?

Time_Agentessa at 2007-7-29 13:35:29 > top of Java-index,Java Essentials,Java Programming...