on 04-13-2016 10:48 AM
Hi guys
I have SAP NW 7.4 (only JAVA stack).
Was configure p4, add to profile this parameters
icm/server_port_2 = PROT=P4, PORT=5$(SAPSYSTEM)04
icm/server_port_3 = PROT=P4SEC, PORT=5$(SAPSYSTEM)05
and set ALLOW_NON_SSL_TUNNELING = true
can you help me, what I do wrong, I write next JAVA code but can't connect to server
import javax.naming.InitialContext;
import javax.naming.NamingException;
import java.util.Properties;
public class rmi2 {
private static InitialContext ctx = null;
public static void main(String[] args) {
init ("", "10.0.0.5", "50005", "user", "1111", "httptunneling");
}
public static void init(String schema, String host, String port, String user, String pass, String transportType) {
try {
Properties p = new Properties();
if (schema == null) {
schema = "P4://";
}
p.put("java.naming.factory.initial", "com.sap.engine.services.jndi.InitialContextFactoryImpl");
p.put("java.naming.provider.url", schema+host+":"+port);
p.put("java.naming.security.principal", user);
p.put("java.naming.security.credentials", pass);
// Parameter transportType for Transport Layer Queue has value
// "None", "ssl", "httptunneling_ssl" or "httptunneling".
ctx = new InitialContext(p);
System.out.println("NamingClient context: " + ctx);
} catch(NamingException e) {
e.printStackTrace();
}
}
}
get this error
com.sap.engine.services.jndi.persistent.exceptions.NamingException: Exception while trying to get InitialContext. [Root exception is com.sap.engine.services.security.exceptions.BaseLoginException: Cannot create new RemoteLoginContext instance.]
at com.sap.engine.services.jndi.InitialContextFactoryImpl.getInitialContext(InitialContextFactoryImpl.java:539)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:684)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:313)
at javax.naming.InitialContext.init(InitialContext.java:244)
at javax.naming.InitialContext.<init>(InitialContext.java:216)
at rmi2.init(rmi2.java:25)
at rmi2.main(rmi2.java:10)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
Caused by: com.sap.engine.services.security.exceptions.BaseLoginException: Cannot create new RemoteLoginContext instance.
at com.sap.engine.services.security.remote.login.RemoteLoginContext.<init>(RemoteLoginContext.java:98)
at com.sap.engine.services.jndi.implclient.LoginHelper.clientSideLogin(LoginHelper.java:78)
at com.sap.engine.services.jndi.InitialContextFactoryImpl.getInitialContext(InitialContextFactoryImpl.java:403)
... 11 more
hi baji,
have you found this documentation link: Getting New Initial Context Using P4 Fails - SAP NetWeaver Problem Analysis Guide (PAG) - SAP Libra...?
based on the "Cannot create new RemoteLoginContext instance" error messag this document mentions the following points:
i know this documentation is not for nw7.40 but since the exception is mentioned there and it also states that its validity is J2EE Engine 6.40 and higher you might give it a try.
regards,
christian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi again
check out this documentation link Creating an Initial Context - Developing Java EE 5 Applications - SAP Library it mentions "As an external client, you have to use the InitialContext constructor with a Hashtable as a parameter, which contains environment properties specifying the connection details that should be used by the system in the context creation.".
based on your code snippet you're using Properties - try it with Hashtable instead.
regards,
christian
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.