I am having a LDAP Queue which process a object class.I cant find the exact location why it is giving the exception. The objclass is a concadenation string with pipe symbol. Any program coding to find the exact location in which concadination part is going to the Exception?.Please Assist.
try {
Attributes objClass = null; try { objClass = getObjClass(LdapInfo.PER_ID, person.perId); } catch (NamingException e) { DCXError.myInstance().writeError("LdapUpdaterConnection: " + e.getMessage()); } NamingEnumeration oc = objClass.get("objectclass").getAll();
String baseObjClass = null; while (oc.hasMoreElements()) { baseObjClass = (String) oc.nextElement(); if (baseObjClass.equalsIgnoreCase(LdapInfo.NON_EMPLOYEE_PERSON) || baseObjClass.equalsIgnoreCase("N/开发者_StackOverflowA")|| baseObjClass.equalsIgnoreCase(LdapInfo.EMPLOYEE_PERSON))
break; } } catch (SchemaViolationException e4) {DCXError.myInstance().writeError( "LdapUpdaterConnection:doUpdate SchemaViolationException "+ e4.getExplanation()); DCXError.myInstance().writeError("LdapUpdaterConnection:update persID = " + personId); return (LdapUpdaterConnection.BAD_DATA); }
You can't find the exact location only because you haven't logged the stack trace. You would also need to reformat your code so that each statement is on a separate line to make any use of that information. You should also use variable names that actually correspond to the content.
This is really terrible code.
It's also hard to see why you are doing all this in the first place. A decent query filter would do all that for you far more simply.
精彩评论