Java Code Examples for sun.security.krb5.KrbException#printStackTrace()

The following examples show how to use sun.security.krb5.KrbException#printStackTrace() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DNS.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
public static void main(String[] args) throws Exception {
    System.setProperty("java.security.krb5.conf",
            System.getProperty("test.src", ".") +"/no-such-file.conf");
    Config config = Config.getInstance();
    try {
        String r = config.getDefaultRealm();
        throw new Exception("What? There is a default realm " + r + "?");
    } catch (KrbException ke) {
        ke.printStackTrace();
        if (ke.getCause() != null) {
            throw new Exception("There should be no cause. Won't try DNS");
        }
    }
    String kdcs = config.getKDCList("X");
    if (!kdcs.equals("a.com.:88 b.com.:99") &&
            !kdcs.equals("a.com. b.com.:99")) {
        throw new Exception("Strange KDC: [" + kdcs + "]");
    };
}
 
Example 2
Source File: DNS.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
public static void main(String[] args) throws Exception {
    System.setProperty("java.security.krb5.conf",
            System.getProperty("test.src", ".") +"/no-such-file.conf");
    Config config = Config.getInstance();
    try {
        String r = config.getDefaultRealm();
        throw new Exception("What? There is a default realm " + r + "?");
    } catch (KrbException ke) {
        ke.printStackTrace();
        if (ke.getCause() != null) {
            throw new Exception("There should be no cause. Won't try DNS");
        }
    }
    String kdcs = config.getKDCList("X");
    if (!kdcs.equals("a.com.:88 b.com.:99") &&
            !kdcs.equals("a.com. b.com.:99")) {
        throw new Exception("Strange KDC: [" + kdcs + "]");
    };
}
 
Example 3
Source File: DNS.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
public static void main(String[] args) throws Exception {
    System.setProperty("java.security.krb5.conf",
            System.getProperty("test.src", ".") +"/no-such-file.conf");
    Config config = Config.getInstance();
    try {
        String r = config.getDefaultRealm();
        throw new Exception("What? There is a default realm " + r + "?");
    } catch (KrbException ke) {
        ke.printStackTrace();
        if (ke.getCause() != null) {
            throw new Exception("There should be no cause. Won't try DNS");
        }
    }
    String kdcs = config.getKDCList("X");
    if (!kdcs.equals("a.com.:88 b.com.:99") &&
            !kdcs.equals("a.com. b.com.:99")) {
        throw new Exception("Strange KDC: [" + kdcs + "]");
    };
}
 
Example 4
Source File: DNS.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public static void main(String[] args) throws Exception {
    System.setProperty("java.security.krb5.conf",
            System.getProperty("test.src", ".") +"/no-such-file.conf");
    Config config = Config.getInstance();
    try {
        String r = config.getDefaultRealm();
        throw new Exception("What? There is a default realm " + r + "?");
    } catch (KrbException ke) {
        ke.printStackTrace();
        if (ke.getCause() != null) {
            throw new Exception("There should be no cause. Won't try DNS");
        }
    }
    String kdcs = config.getKDCList("X");
    if (!kdcs.equals("a.com.:88 b.com.:99") &&
            !kdcs.equals("a.com. b.com.:99")) {
        throw new Exception("Strange KDC: [" + kdcs + "]");
    };
}
 
Example 5
Source File: DNS.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public static void main(String[] args) throws Exception {
    System.setProperty("java.security.krb5.conf",
            System.getProperty("test.src", ".") +"/no-such-file.conf");
    Config config = Config.getInstance();
    try {
        String r = config.getDefaultRealm();
        throw new Exception("What? There is a default realm " + r + "?");
    } catch (KrbException ke) {
        ke.printStackTrace();
        if (ke.getCause() != null) {
            throw new Exception("There should be no cause. Won't try DNS");
        }
    }
    String kdcs = config.getKDCList("X");
    if (!kdcs.equals("a.com.:88 b.com.:99") &&
            !kdcs.equals("a.com. b.com.:99")) {
        throw new Exception("Strange KDC: [" + kdcs + "]");
    };
}
 
Example 6
Source File: DNS.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public static void main(String[] args) throws Exception {
    System.setProperty("java.security.krb5.conf",
            System.getProperty("test.src", ".") +"/no-such-file.conf");
    Config config = Config.getInstance();
    try {
        String r = config.getDefaultRealm();
        throw new Exception("What? There is a default realm " + r + "?");
    } catch (KrbException ke) {
        ke.printStackTrace();
        if (ke.getCause() != null) {
            throw new Exception("There should be no cause. Won't try DNS");
        }
    }
    String kdcs = config.getKDCList("X");
    if (!kdcs.equals("a.com.:88 b.com.:99") &&
            !kdcs.equals("a.com. b.com.:99")) {
        throw new Exception("Strange KDC: [" + kdcs + "]");
    };
}
 
Example 7
Source File: DNS.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public static void main(String[] args) throws Exception {
    System.setProperty("java.security.krb5.conf",
            System.getProperty("test.src", ".") +"/no-such-file.conf");
    Config config = Config.getInstance();
    try {
        String r = config.getDefaultRealm();
        throw new Exception("What? There is a default realm " + r + "?");
    } catch (KrbException ke) {
        ke.printStackTrace();
        if (ke.getCause() != null) {
            throw new Exception("There should be no cause. Won't try DNS");
        }
    }
    String kdcs = config.getKDCList("X");
    if (!kdcs.equals("a.com.:88 b.com.:99") &&
            !kdcs.equals("a.com. b.com.:99")) {
        throw new Exception("Strange KDC: [" + kdcs + "]");
    };
}
 
Example 8
Source File: Duration.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
static void check(String s, int ex) throws Exception {
    System.out.print("\u001b[1;37;41m" +s + " " + ex);
    System.out.print("\u001b[m\n");
    try {
        int result = Config.duration(s);
        if (result != ex) throw new Exception("for " + s + " is " + result);
    } catch (KrbException ke) {
        ke.printStackTrace();
        if (ex != -1) throw new Exception();
    }
}
 
Example 9
Source File: Duration.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
static void check(String s, int ex) throws Exception {
    System.out.print("\u001b[1;37;41m" +s + " " + ex);
    System.out.print("\u001b[m\n");
    try {
        int result = Config.duration(s);
        if (result != ex) throw new Exception("for " + s + " is " + result);
    } catch (KrbException ke) {
        ke.printStackTrace();
        if (ex != -1) throw new Exception();
    }
}
 
Example 10
Source File: Duration.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
static void check(String s, int ex) throws Exception {
    System.out.print("\u001b[1;37;41m" +s + " " + ex);
    System.out.print("\u001b[m\n");
    try {
        int result = Config.duration(s);
        if (result != ex) throw new Exception("for " + s + " is " + result);
    } catch (KrbException ke) {
        ke.printStackTrace();
        if (ex != -1) throw new Exception();
    }
}
 
Example 11
Source File: Duration.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
static void check(String s, int ex) throws Exception {
    System.out.print("\u001b[1;37;41m" +s + " " + ex);
    System.out.print("\u001b[m\n");
    try {
        int result = Config.duration(s);
        if (result != ex) throw new Exception("for " + s + " is " + result);
    } catch (KrbException ke) {
        ke.printStackTrace();
        if (ex != -1) throw new Exception();
    }
}
 
Example 12
Source File: KDCOptions.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
private void setDefault() {
    try {

        Config config = Config.getInstance();

        // If key not present, returns Integer.MIN_VALUE, which is
        // almost all zero.

        int options = config.getIntValue("libdefaults",
                "kdc_default_options");

        if ((options & KDC_OPT_RENEWABLE_OK) == KDC_OPT_RENEWABLE_OK) {
            set(RENEWABLE_OK, true);
        } else {
            if (config.getBooleanValue("libdefaults", "renewable")) {
                set(RENEWABLE_OK, true);
            }
        }
        if ((options & KDC_OPT_PROXIABLE) == KDC_OPT_PROXIABLE) {
            set(PROXIABLE, true);
        } else {
            if (config.getBooleanValue("libdefaults", "proxiable")) {
                set(PROXIABLE, true);
            }
        }

        if ((options & KDC_OPT_FORWARDABLE) == KDC_OPT_FORWARDABLE) {
            set(FORWARDABLE, true);
        } else {
            if (config.getBooleanValue("libdefaults", "forwardable")) {
                set(FORWARDABLE, true);
            }
        }
    } catch (KrbException e) {
        if (DEBUG) {
            System.out.println("Exception in getting default values for " +
                    "KDC Options from the configuration ");
            e.printStackTrace();

        }
    }
}
 
Example 13
Source File: KDCOptions.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
private void setDefault() {
    try {

        Config config = Config.getInstance();

        // If key not present, returns Integer.MIN_VALUE, which is
        // almost all zero.

        int options = config.getIntValue("libdefaults",
                "kdc_default_options");

        if ((options & KDC_OPT_RENEWABLE_OK) == KDC_OPT_RENEWABLE_OK) {
            set(RENEWABLE_OK, true);
        } else {
            if (config.getBooleanValue("libdefaults", "renewable")) {
                set(RENEWABLE_OK, true);
            }
        }
        if ((options & KDC_OPT_PROXIABLE) == KDC_OPT_PROXIABLE) {
            set(PROXIABLE, true);
        } else {
            if (config.getBooleanValue("libdefaults", "proxiable")) {
                set(PROXIABLE, true);
            }
        }

        if ((options & KDC_OPT_FORWARDABLE) == KDC_OPT_FORWARDABLE) {
            set(FORWARDABLE, true);
        } else {
            if (config.getBooleanValue("libdefaults", "forwardable")) {
                set(FORWARDABLE, true);
            }
        }
    } catch (KrbException e) {
        if (DEBUG) {
            System.out.println("Exception in getting default values for " +
                    "KDC Options from the configuration ");
            e.printStackTrace();

        }
    }
}
 
Example 14
Source File: KDCOptions.java    From jdk8u-dev-jdk with GNU General Public License v2.0 4 votes vote down vote up
private void setDefault() {
    try {

        Config config = Config.getInstance();

        // If key not present, returns Integer.MIN_VALUE, which is
        // almost all zero.

        int options = config.getIntValue("libdefaults",
                "kdc_default_options");

        if ((options & KDC_OPT_RENEWABLE_OK) == KDC_OPT_RENEWABLE_OK) {
            set(RENEWABLE_OK, true);
        } else {
            if (config.getBooleanValue("libdefaults", "renewable")) {
                set(RENEWABLE_OK, true);
            }
        }
        if ((options & KDC_OPT_PROXIABLE) == KDC_OPT_PROXIABLE) {
            set(PROXIABLE, true);
        } else {
            if (config.getBooleanValue("libdefaults", "proxiable")) {
                set(PROXIABLE, true);
            }
        }

        if ((options & KDC_OPT_FORWARDABLE) == KDC_OPT_FORWARDABLE) {
            set(FORWARDABLE, true);
        } else {
            if (config.getBooleanValue("libdefaults", "forwardable")) {
                set(FORWARDABLE, true);
            }
        }
    } catch (KrbException e) {
        if (DEBUG) {
            System.out.println("Exception in getting default values for " +
                    "KDC Options from the configuration ");
            e.printStackTrace();

        }
    }
}
 
Example 15
Source File: KDCOptions.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
private void setDefault() {
    try {

        Config config = Config.getInstance();

        // If key not present, returns Integer.MIN_VALUE, which is
        // almost all zero.

        int options = config.getIntValue("libdefaults",
                "kdc_default_options");

        if ((options & KDC_OPT_RENEWABLE_OK) == KDC_OPT_RENEWABLE_OK) {
            set(RENEWABLE_OK, true);
        } else {
            if (config.getBooleanObject("libdefaults", "renewable") == Boolean.TRUE) {
                set(RENEWABLE_OK, true);
            }
        }
        if ((options & KDC_OPT_PROXIABLE) == KDC_OPT_PROXIABLE) {
            set(PROXIABLE, true);
        } else {
            if (config.getBooleanObject("libdefaults", "proxiable") == Boolean.TRUE) {
                set(PROXIABLE, true);
            }
        }

        if ((options & KDC_OPT_FORWARDABLE) == KDC_OPT_FORWARDABLE) {
            set(FORWARDABLE, true);
        } else {
            if (config.getBooleanObject("libdefaults", "forwardable") == Boolean.TRUE) {
                set(FORWARDABLE, true);
            }
        }
    } catch (KrbException e) {
        if (DEBUG) {
            System.out.println("Exception in getting default values for " +
                    "KDC Options from the configuration ");
            e.printStackTrace();

        }
    }
}
 
Example 16
Source File: KDCOptions.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
private void setDefault() {
    try {

        Config config = Config.getInstance();

        // If key not present, returns Integer.MIN_VALUE, which is
        // almost all zero.

        int options = config.getIntValue("libdefaults",
                "kdc_default_options");

        if ((options & KDC_OPT_RENEWABLE_OK) == KDC_OPT_RENEWABLE_OK) {
            set(RENEWABLE_OK, true);
        } else {
            if (config.getBooleanValue("libdefaults", "renewable")) {
                set(RENEWABLE_OK, true);
            }
        }
        if ((options & KDC_OPT_PROXIABLE) == KDC_OPT_PROXIABLE) {
            set(PROXIABLE, true);
        } else {
            if (config.getBooleanValue("libdefaults", "proxiable")) {
                set(PROXIABLE, true);
            }
        }

        if ((options & KDC_OPT_FORWARDABLE) == KDC_OPT_FORWARDABLE) {
            set(FORWARDABLE, true);
        } else {
            if (config.getBooleanValue("libdefaults", "forwardable")) {
                set(FORWARDABLE, true);
            }
        }
    } catch (KrbException e) {
        if (DEBUG) {
            System.out.println("Exception in getting default values for " +
                    "KDC Options from the configuration ");
            e.printStackTrace();

        }
    }
}
 
Example 17
Source File: KDCOptions.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
private void setDefault() {
    try {

        Config config = Config.getInstance();

        // If key not present, returns Integer.MIN_VALUE, which is
        // almost all zero.

        int options = config.getIntValue("libdefaults",
                "kdc_default_options");

        if ((options & KDC_OPT_RENEWABLE_OK) == KDC_OPT_RENEWABLE_OK) {
            set(RENEWABLE_OK, true);
        } else {
            if (config.getBooleanValue("libdefaults", "renewable")) {
                set(RENEWABLE_OK, true);
            }
        }
        if ((options & KDC_OPT_PROXIABLE) == KDC_OPT_PROXIABLE) {
            set(PROXIABLE, true);
        } else {
            if (config.getBooleanValue("libdefaults", "proxiable")) {
                set(PROXIABLE, true);
            }
        }

        if ((options & KDC_OPT_FORWARDABLE) == KDC_OPT_FORWARDABLE) {
            set(FORWARDABLE, true);
        } else {
            if (config.getBooleanValue("libdefaults", "forwardable")) {
                set(FORWARDABLE, true);
            }
        }
    } catch (KrbException e) {
        if (DEBUG) {
            System.out.println("Exception in getting default values for " +
                    "KDC Options from the configuration ");
            e.printStackTrace();

        }
    }
}
 
Example 18
Source File: KDCOptions.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
private void setDefault() {
    try {

        Config config = Config.getInstance();

        // If key not present, returns Integer.MIN_VALUE, which is
        // almost all zero.

        int options = config.getIntValue("libdefaults",
                "kdc_default_options");

        if ((options & KDC_OPT_RENEWABLE_OK) == KDC_OPT_RENEWABLE_OK) {
            set(RENEWABLE_OK, true);
        } else {
            if (config.getBooleanValue("libdefaults", "renewable")) {
                set(RENEWABLE_OK, true);
            }
        }
        if ((options & KDC_OPT_PROXIABLE) == KDC_OPT_PROXIABLE) {
            set(PROXIABLE, true);
        } else {
            if (config.getBooleanValue("libdefaults", "proxiable")) {
                set(PROXIABLE, true);
            }
        }

        if ((options & KDC_OPT_FORWARDABLE) == KDC_OPT_FORWARDABLE) {
            set(FORWARDABLE, true);
        } else {
            if (config.getBooleanValue("libdefaults", "forwardable")) {
                set(FORWARDABLE, true);
            }
        }
    } catch (KrbException e) {
        if (DEBUG) {
            System.out.println("Exception in getting default values for " +
                    "KDC Options from the configuration ");
            e.printStackTrace();

        }
    }
}
 
Example 19
Source File: KDCOptions.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
private void setDefault() {
    try {

        Config config = Config.getInstance();

        // If key not present, returns Integer.MIN_VALUE, which is
        // almost all zero.

        int options = config.getIntValue("libdefaults",
                "kdc_default_options");

        if ((options & KDC_OPT_RENEWABLE_OK) == KDC_OPT_RENEWABLE_OK) {
            set(RENEWABLE_OK, true);
        } else {
            if (config.getBooleanValue("libdefaults", "renewable")) {
                set(RENEWABLE_OK, true);
            }
        }
        if ((options & KDC_OPT_PROXIABLE) == KDC_OPT_PROXIABLE) {
            set(PROXIABLE, true);
        } else {
            if (config.getBooleanValue("libdefaults", "proxiable")) {
                set(PROXIABLE, true);
            }
        }

        if ((options & KDC_OPT_FORWARDABLE) == KDC_OPT_FORWARDABLE) {
            set(FORWARDABLE, true);
        } else {
            if (config.getBooleanValue("libdefaults", "forwardable")) {
                set(FORWARDABLE, true);
            }
        }
    } catch (KrbException e) {
        if (DEBUG) {
            System.out.println("Exception in getting default values for " +
                    "KDC Options from the configuration ");
            e.printStackTrace();

        }
    }
}
 
Example 20
Source File: KDCOptions.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
private void setDefault() {
    try {

        Config config = Config.getInstance();

        // If key not present, returns Integer.MIN_VALUE, which is
        // almost all zero.

        int options = config.getIntValue("libdefaults",
                "kdc_default_options");

        if ((options & KDC_OPT_RENEWABLE_OK) == KDC_OPT_RENEWABLE_OK) {
            set(RENEWABLE_OK, true);
        } else {
            if (config.getBooleanValue("libdefaults", "renewable")) {
                set(RENEWABLE_OK, true);
            }
        }
        if ((options & KDC_OPT_PROXIABLE) == KDC_OPT_PROXIABLE) {
            set(PROXIABLE, true);
        } else {
            if (config.getBooleanValue("libdefaults", "proxiable")) {
                set(PROXIABLE, true);
            }
        }

        if ((options & KDC_OPT_FORWARDABLE) == KDC_OPT_FORWARDABLE) {
            set(FORWARDABLE, true);
        } else {
            if (config.getBooleanValue("libdefaults", "forwardable")) {
                set(FORWARDABLE, true);
            }
        }
    } catch (KrbException e) {
        if (DEBUG) {
            System.out.println("Exception in getting default values for " +
                    "KDC Options from the configuration ");
            e.printStackTrace();

        }
    }
}