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);

