Hello,
I'm trying to connect to R/3 via J2EE Engine directly (by obtaining the initial JNDI/Java Naming and Directory Interface context). But I'm getting an error. With debug mode on server I find out via debugger chained exceptions: ConnectionFailedException "Connection Failed: Nested Exception. Failed to get connection. Please contact your admin. " / ConnectionFailedException "Connection Failed: Nested Exception. Physical connection was not initialized. " / ConnectionFailedException "Connection Failed: Nested Exception. Failed in creating the JCO Connection. " / JCO$Exception "Name or password is incorrect. Please re-enter" (key= "RFC_ERROR_LOGON_FAILURE"). But I'm sure I filled name and password to R/3 correctly. My code is below:
Context ctx;
IConnectionFactory connectionFactory = null;
try {
ctx = new InitialContext();
connectionFactory = (IConnectionFactory) ctx.lookup("deployedAdapters/SAPFactory/shareable/SAPFactory");
} catch (NamingException e1) {
e1.printStackTrace();
}
IConnectionSpec spec = connectionFactory.getConnectionSpec();
((Map) spec).put("client", "080");
((Map) spec).put("UserName", "SAP_BC");
((Map) spec).put("Password", "*****");
((Map) spec).put("logonmethod", "UIDPW");
((Map) spec).put("Language", "EN");
((Map) spec).put("ashost", "mysapp3.mydomain.cz");
((Map) spec).put("sysnr", "00");
((Map) spec).put("SystemType", "SAP_R3");
((Map) spec).put("type", "3");
IConnection aConnection = connectionFactory.getConnectionEx(spec);
What's wrong?
I'm trying to connect to R/3 from service created by Scheduler task wizard in NWDS. How can I use the second way to get connection - the Connector Gateway service (opening a connection via the Portal service) from my scheduler task service? I think I need a request for this..
I appreciate any help.
Best regards,
Josef Motl
Message was edited by: Josef Motl