Home > Back-end >  LDAPException (the resultCode=object class great god solve the violation
LDAPException (the resultCode=object class great god solve the violation

Time:09-23

/* *
* create user
* @ param baseDN
* @ param user
*/
Public void createEntry (String baseDN, InternalUser InternalUser) {
String entryDN="erglobalid=" + internalUser getErglobalid () + ", "+ baseDN;
Try {
//connect the LDAP
OpenConnection ();

SearchResultEntry entry=connection. The getEntry (entryDN);
If (entry==null) {
//there is no create
ArrayList The attributes=new ArrayList (a);
Attributes. The add (new Attribute (" objectClass ", "top", "inetOrgPerson", "erManagedltem", "organizationalPerson", "person", "erPersonltem"));
The attributes. The add (new Attribute (" uid ", internalUser. GetUid ()));
The attributes. The add (new Attribute (employeetype, internalUser. GetEmployeetype ()));
The attributes. The add (new Attribute (" level ", internalUser getLevel ()));
The attributes. The add (new Attribute (" erpersonstatus, "internalUser. GetErpersonstatus ()));
The attributes. The add (new Attribute (" displayOrder ", internalUser. GetDisplayorder ()));
The attributes. The add (new Attribute (" nation, "internalUser. GetNation ()));
The attributes. The add (new Attribute (" ercreatedate, "internalUser. GetErcreatedate ()));
The attributes. The add (new Attribute (" erpswdlastchanged, "internalUser. GetErpswdlastchanged ()));
The attributes. The add (new Attribute (" levelname, "internalUser. GetLevelname ()));
The attributes. The add (new Attribute (" userpassword ", internalUser getUserpassword ()));
The attributes. The add (new Attribute (" sn ", internalUser getSn ()));
The attributes. The add (new Attribute (" cn ", internalUser getCn ()));
The attributes. The add (new Attribute (" preferredmobile, "internalUser. GetPreferredmobile ()));
The attributes. The add (new Attribute (" email ", internalUser getEmail ()));
The attributes. The add (new Attribute (" function ", "12"));
The attributes. The add (new Attribute (" religion ", internalUser. GetReligion ()));
The attributes. The add (new Attribute (" c ", internalUser getC ()));
The attributes. The add (new Attribute (" ersynchpassword, "internalUser. GetErsynchpassword ()));
The attributes. The add (new Attribute (" erlastmodifiedtime, "internalUser. GetErlastmodifiedtime ()));
The attributes. The add (new Attribute (" positionlevel, "internalUser. GetPositionlevel ()));
The attributes. The add (new Attribute (" erglobalid, "internalUser. GetErglobalid ()));
The attributes. The add (new Attribute (" erparent, "internalUser. GetErparent ()));
The attributes. The add (new Attribute (" duty ", internalUser. GetDuty ()));
The attributes. The add (new Attribute (" gender ", internalUser getGender ()));
The attributes. The add (new Attribute (" employeenumber ", internalUser. GetEmployeenumber ()));
The attributes. The add (new Attribute (" o ", internalUser getO ()));
The attributes. The add (new Attribute (" l ", "the ministry"));
The attributes. The add (new Attribute (" status ", internalUser getStatus ()));
The attributes. The add (new Attribute (" erlocale, "internalUser. GetErlocale ()));
Connection. The add (entryDN, attributes);
//the connection. The modify (entryDN,)
System. EntryDN out.println (" create user "+ +" success!" );
} else {
System. Out.println (" user "+ entryDN +" already exist!" );
}
} the catch (Exception e) {
e.printStackTrace();
System. The out. Println (" create user error: \ n "+ um participant etMessage ());
}
}




Error message
LDAPException (the resultCode=object class violation, errorMessage='object class violation')
At com. Unboundid. Ldap. SDK. LDAPConnection. Add (LDAPConnection. Java: 1539)
At com. Unboundid. Ldap. SDK. LDAPConnection. Add (LDAPConnection. Java: 1464)
At net.zoneland.uum.client.com mons. LdapContextUtils. CreateEntry (LdapContextUtils. Java: 132)
At net. Zoneland. Uum. Client. Processer. AddUserProcesser. SaveInternalUser (AddUserProcesser. Java: 82)
At net. Zoneland. Uum. Client. Processer. AddUserProcesser. Process (65) AddUserProcesser. Java:
At net. Zoneland. Uum. Client. Core. JMSResponseHandler. Process (108) JMSResponseHandler. Java:
At net. Zoneland. Uum. Client. Core. JMSResponseHandler. OnMessage (JMSResponseHandler. Java: 73)
The at org. Springframework. JMS. Listener. AbstractMessageListenerContainer. DoInvokeListener (AbstractMessageListenerContainer. Java: 562)
The at org. Springframework. JMS. Listener. AbstractMessageListenerContainer. InvokeListener (AbstractMessageListenerContainer. Java: 500)
The at org. Springframework. JMS. Listener. AbstractMessageListenerContainer. DoExecuteListener (AbstractMessageListenerContainer. Java: 468)
The at org. Springframework. JMS. Listener. AbstractPollingMessageListenerContainer. DoReceiveAndExecute (AbstractPollingMessageListenerContainer. Java: 326)
The at org. Springframework. JMS. Listener. AbstractPollingMessageListenerContainer. ReceiveAndExecute (AbstractPollingMessageListenerContainer. Java: 264)
The at org. Springframework. JMS. Listener. DefaultMessageListenerContainer $AsyncMessageListenerInvoker. InvokeListener (DefaultMessageListenerContainer. Java: 1071)
The at org. Springframework. JMS. Listener. DefaultMessageListenerContainer $AsyncMessageListenerInvoker. ExecuteOngoingLoop (DefaultMessageListenerContainer. Java: 1063)
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related