LdifIterator iterator = new LdifIterator( in );  LdifParser ldifParser = new LdifParserImpl();
Iterator iterator = new LdifReader( in );
    protected void load( DirContext ctx, String ldifPath )    {        Name rdn = null;        try        {            InputStream in = getLdifStream( ldifPath );            LdifIterator iterator = new LdifIterator( in );            LdifParser ldifParser = new LdifParserImpl();            while ( iterator.hasNext() )            {                String ldif = ( String ) iterator.next();                Attributes attributes = new LockableAttributesImpl();                ldifParser.parse( attributes, ldif );                String dn = ( String ) attributes.remove( "dn" ).get();                if ( attributes.get( "objectClass" ).contains( "krb5KDCEntry" ) )                {                    String pw = ( String ) attributes.get( "userpassword" ).get();                    String krbPrincipal = ( String ) attributes.get( KerberosAttribute.PRINCIPAL ).get();                    KerberosPrincipal principal = new KerberosPrincipal( krbPrincipal );                    KerberosKey key = new KerberosKey( principal, pw.toCharArray(), "DES" );                    byte[] encodedKey = key.getEncoded();                    attributes.put( KerberosAttribute.KEY, encodedKey );                    attributes.put( KerberosAttribute.VERSION, Integer.toString( key.getVersionNumber() ) );                    attributes.put( KerberosAttribute.TYPE, Integer.toString( key.getKeyType() ) );                }                rdn = getRelativeName( ctx.getNameInNamespace(), dn );                try                {                    ctx.lookup( rdn );                    log.info( "Found {}, will not create.", rdn );                }                catch ( Exception e )                {                    ctx.createSubcontext( rdn, attributes );                    log.info( "Created {}.", rdn );                }            }        }        catch ( FileNotFoundException fnfe )        {            log.error( "LDIF file does not exist." );            return;        }        catch ( IOException ioe )        {            log.error( "Failed to import LDIF into backing store.", ioe );            return;        }        catch ( NamingException ne )        {            log.error( "Failed to import LDIF into backing store.", ne );            return;        }        try        {            InputStream in = getLdifStream( ldifPath );            LdifIterator iterator = new LdifIterator( in );            LdifParser ldifParser = new LdifParserImpl();            while ( iterator.hasNext() )            {                String ldif = ( String ) iterator.next();                Attributes attributes = new LockableAttributesImpl();                ldifParser.parse( attributes, ldif );                String dn = ( String ) attributes.remove( "dn" ).get();                rdn = getRelativeName( ctx.getNameInNamespace(), dn );                Object stored = ctx.lookup( rdn );                log.debug( "Lookup for {} returned {}.", rdn, stored );                if ( stored == null )                {                    log.error( "{} was null.", rdn );                    throw new IllegalStateException( "LDIF entries not being pushed to disk." );                }            }        }        catch ( Exception e )        {            log.error( "Failed to find {}", rdn );            if ( log.isDebugEnabled() )            {                log.error( "Failed to import LDIF into backing store.", e );            }            else            {                log.error( "Failed to import LDIF into backing store." );            }            return;        }    }