Tuesday, December 1, 2015

weblogic.socket.MaxMessageSizeExceededException

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

Retry Evaluate user policies task

Some time we need to retry Evaluate user policies task. But  some time when we  run the Evaluate user policies task again, the task seems to ignore users who failed the previous run. To solve this issue we need to execute the below query to reset the POLICY_EVAL_NEEDED flag in DB.

query:
UPDATE USER_PROVISIONING_ATTRS SET POLICY_EVAL_IN_PROGRESS = 0, POLICY_EVAL_NEEDED = 1, UPDATE_DATE = SYSDATE where USR_KEY IN( all affected  user Ids)