when we execute some java code (OIM api) form Eclipse, we may face the below issue :
Caused by: weblogic.socket.MaxMessageSizeExceededException: Incoming message of size: '10000080' bytes exceeds the configured maximum of: '10000000' bytes for protocol: 't3'
to resolve the issue we can just add a system property in the java code
System.setProperty("weblogic.MaxMessageSize", "300000000"); and you are done :)
sample code:
public OIMClient envContext(String oimUserName, String oimPassword, String oimURL ){
/*String oimUserName = "xelsysadm";
String oimPassword = "xxxxxxxxxxxxxxxxxxx";
String oimURL = "t3://xxxxxxxxxxxxxxxxxxxxxxxt:14000"; */
String oimInitialContextFactory = "weblogic.jndi.WLInitialContextFactory";
OIMClient oimClient= null;
Hashtable<Object, Object> env = new Hashtable<Object, Object>();
env.put(OIMClient.JAVA_NAMING_FACTORY_INITIAL, oimInitialContextFactory);
env.put(OIMClient.JAVA_NAMING_PROVIDER_URL,oimURL);
System.setProperty("java.security.auth.login.config", "./config/authwl.conf");
System.setProperty("java.security.policy", "./config/xl.policy");
System.setProperty("OIM.AppServerType", "wls");
System.setProperty("APPSERVER_TYPE", "wls");
System.setProperty("weblogic.Name", "oim_server1");
System.setProperty("weblogic.MaxMessageSize", "300000000");
System.setProperty("weblogic.security.SSL.trustedCAKeyStore", "./config/xxxxxxx.jks");
oimClient = new OIMClient(env);
try {
oimClient.login(oimUserName, oimPassword.toCharArray());
System.out.println("Successfully Connected with OIM ");
} catch (LoginException e) {
System.out.println("Login Exception"+ e);
}
return oimClient;
}