Example usage for javax.servlet ServletException getRootCause

List of usage examples for javax.servlet ServletException getRootCause

Introduction

In this page you can find the example usage for javax.servlet ServletException getRootCause.

Prototype


public Throwable getRootCause() 

Source Link

Document

Returns the exception that caused this servlet exception.

Usage

From source file:jp.terasoluna.fw.web.struts.plugins.BLogicIOPlugInTest.java

/**
 * testInit02()/*from  ww  w . j av  a 2s .  co  m*/
 * <br><br>
 *
 * (?n)
 * <br>
 * _?FCG
 * <br><br>
 * l?F(?) servlet:not null<br>
 *         (?) config:W?[(?)=""<br>
 *         (?) rules?iDigester?[t@C?j:""()<br>
 *         (?) blogic-io?i?WbN?o?}bsO`t@C?j:"BLogicIOPlugInTest-blogic-io.xml"<br>
 *         (?) mapperStr?i?WbN?o?fNX?j:null<br>
 *         (?) digester:null<br>
 *
 * <br>
 * l?F(?) O:ServletException<br>
 *                    bvO?FXmlLoadException<br>
 *         (?) ?O:??O?<br>
 *                    G?[?O?F""<br>
 *                    O?FXmlLoadException<br>
 *
 * <br>
 * ?[t@C???AServletExceptionX??[?B
 * <br>
 *
 * @throws Exception ?\bh?O
 */
public void testInit02() throws Exception {
    // eXgf?[^?
    // W?[??
    ModuleConfig config = new ModuleConfigImpl("");
    // BLogic`?[t@C
    UTUtil.setPrivateField(plugin, "digesterRules", "");
    // BLogic`t@C
    UTUtil.setPrivateField(plugin, "resources",
            BLogicIOPlugInTest.class.getResource("BLogicIOPlugInTest-blogic-io.xml").getPath());
    // }bp?[NX
    UTUtil.setPrivateField(plugin, "mapperStr", null);

    // ANVT?[ubg??
    BLogicIOPlugIn_ActionServletStub01 servlet = new BLogicIOPlugIn_ActionServletStub01();

    // eXg?s
    try {
        plugin.init(servlet, config);
        fail();
    } catch (ServletException e) {
        // eXgmF
        assertEquals(XmlLoadException.class.getName(), e.getRootCause().getClass().getName());
        assertTrue(LogUTUtil.checkError("", e.getRootCause()));
    }
}

From source file:jp.terasoluna.fw.web.struts.plugins.BLogicIOPlugInTest.java

/**
 * testInit03()//from  w ww . j  a  v  a  2 s. c  om
 * <br><br>
 *
 * (?n)
 * <br>
 * _?FCG
 * <br><br>
 * l?F(?) servlet:not null<br>
 *         (?) config:W?[(?)=""<br>
 *         (?) rules?iDigester?[t@C?j:"/nothing.xml"?i??[t@C?j<br>
 *         (?) blogic-io?i?WbN?o?}bsO`t@C?j:"BLogicIOPlugInTest-blogic-io.xml"<br>
 *         (?) mapperStr?i?WbN?o?fNX?j:null<br>
 *         (?) digester:null<br>
 *
 * <br>
 * l?F(?) O:ServletException<br>
 *                    bvO?FXmlLoadException<br>
 *         (?) ?O:??O?<br>
 *                    G?[?O?F""<br>
 *                    O?FXmlLoadException<br>
 *
 * <br>
 * ??[t@Cw???AServletExceptionX??[?B
 * <br>
 *
 * @throws Exception ?\bh?O
 */
public void testInit03() throws Exception {
    // eXgf?[^?
    // W?[??
    ModuleConfig config = new ModuleConfigImpl("");
    // BLogic`?[t@C
    UTUtil.setPrivateField(plugin, "digesterRules", "/nothing.xml");
    // BLogic`t@C
    UTUtil.setPrivateField(plugin, "resources",
            BLogicIOPlugInTest.class.getResource("BLogicIOPlugInTest-blogic-io.xml").getPath());
    // }bp?[NX
    UTUtil.setPrivateField(plugin, "mapperStr", null);

    // ANVT?[ubg??
    BLogicIOPlugIn_ActionServletStub01 servlet = new BLogicIOPlugIn_ActionServletStub01();

    // eXg?s
    try {
        plugin.init(servlet, config);
        fail();
    } catch (ServletException e) {
        // eXgmF
        assertEquals(XmlLoadException.class.getName(), e.getRootCause().getClass().getName());
        assertTrue(LogUTUtil.checkError("", e.getRootCause()));
    }
}

From source file:jp.terasoluna.fw.web.struts.plugins.BLogicIOPlugInTest.java

/**
 * testInit04()// w w  w .  j  a v a  2s.c o  m
 * <br><br>
 *
 * (?n)
 * <br>
 * _?FCG
 * <br><br>
 * l?F(?) servlet:not null<br>
 *         (?) config:W?[(?)=""<br>
 *         (?) rules?iDigester?[t@C?j:"BLogicIOPlugInTest-blogic-io-empty.xml"?ip?[XG?[?t@C?j<br>
 *         (?) blogic-io?i?WbN?o?}bsO`t@C?j:"BLogicIOPlugInTest-blogic-io.xml"<br>
 *         (?) mapperStr?i?WbN?o?fNX?j:null<br>
 *         (?) digester:null<br>
 *
 * <br>
 * l?F(?) O:ServletException<br>
 *                    bvO?FXmlLoadException<br>
 *         (?) ?O:??O?<br>
 *                    G?[?O?F""<br>
 *                    O?FXmlLoadException<br>
 *
 * <br>
 * p?[XG?[??[t@Cw???AServletExceptionX??[?B
 * <br>
 *
 * @throws Exception ?\bh?O
 */
public void testInit04() throws Exception {
    // eXgf?[^?
    // W?[??
    ModuleConfig config = new ModuleConfigImpl("");

    // p?[XG?[?t@C?irules?j
    UTUtil.setPrivateField(plugin, "digesterRules",
            BLogicIOPlugInTest.class.getResource("BLogicIOPlugInTest-blogic-io-empty.xml").getPath());
    // BLogic`t@C
    UTUtil.setPrivateField(plugin, "resources",
            BLogicIOPlugInTest.class.getResource("BLogicIOPlugInTest-blogic-io.xml").getPath());
    // }bp?[NX
    UTUtil.setPrivateField(plugin, "mapperStr", null);

    // ANVT?[ubg??
    BLogicIOPlugIn_ActionServletStub01 servlet = new BLogicIOPlugIn_ActionServletStub01();

    // eXg?s
    try {
        plugin.init(servlet, config);
        fail();
    } catch (ServletException e) {
        // eXgmF
        assertEquals(XmlLoadException.class.getName(), e.getRootCause().getClass().getName());
        assertTrue(LogUTUtil.checkError("", e.getRootCause()));
    }
}

From source file:jp.terasoluna.fw.web.struts.plugins.BLogicIOPlugInTest.java

/**
 * testInit05()/*from   w ww . j av a  2 s  .  com*/
 * <br><br>
 *
 * (?n)
 * <br>
 * _?FG
 * <br><br>
 * l?F(?) servlet:not null<br>
 *         (?) config:W?[(?)=""<br>
 *         (?) rules?iDigester?[t@C?j:"BLogicIOPlugInTest-blogic-io-rules.xml"<br>
 *         (?) blogic-io?i?WbN?o?}bsO`t@C?j:"BLogicIOPlugInTest-blogic-io.xml"<br>
 *         (?) mapperStr?i?WbN?o?fNX?j:null<br>
 *         (?) digester:parse()?\bhIOExceptionX??[Digester<br>
 *
 * <br>
 * l?F(?) O:ServletException<br>
 *                    bvO?FIOException<br>
 *         (?) ?O:??O?<br>
 *                    G?[?O?F""<br>
 *                    O?FIOException<br>
 *
 * <br>
 * IOException????AServletExceptionbvX??[?B
 * <br>
 *
 * @throws Exception ?\bh?O
 */
public void testInit05() throws Exception {
    // eXgf?[^?
    // W?[??
    ModuleConfig config = new ModuleConfigImpl("");

    // BLogic`?[t@C
    UTUtil.setPrivateField(plugin, "digesterRules",
            BLogicIOPlugInTest.class.getResource("BLogicIOPlugInTest-blogic-io-rules.xml").getPath());
    // BLogic`t@C
    UTUtil.setPrivateField(plugin, "resources",
            BLogicIOPlugInTest.class.getResource("BLogicIOPlugInTest-blogic-io.xml").getPath());
    // }bp?[NX
    UTUtil.setPrivateField(plugin, "mapperStr",
            "jp.terasoluna.fw.web.struts.plugins" + ".BLogicIOPlugIn_BLogicMapperStub01");
    UTUtil.setPrivateField(plugin, "mapperStr", null);

    // ANVT?[ubg??
    BLogicIOPlugIn_ActionServletStub01 servlet = new BLogicIOPlugIn_ActionServletStub01();

    // Digester???iIOException??j
    BLogicIOPlugIn_DigesterStub01 digester = new BLogicIOPlugIn_DigesterStub01();
    UTUtil.setPrivateField(BLogicIOPlugIn.class, "digester", digester);

    // eXg?s
    try {
        plugin.init(servlet, config);
        fail();
    } catch (ServletException e) {
        // eXgmF
        assertEquals(IOException.class.getName(), e.getRootCause().getClass().getName());
        assertTrue(LogUTUtil.checkError("", e.getRootCause()));
    }
}

From source file:jp.terasoluna.fw.web.struts.plugins.BLogicIOPlugInTest.java

/**
 * testInit09()/*from w w w  .j  a v  a  2 s  . co m*/
 * <br><br>
 *
 * (?n)
 * <br>
 * _?FCG
 * <br><br>
 * l?F(?) servlet:not null<br>
 *         (?) config:W?[(?)=""<br>
 *         (?) rules?iDigester?[t@C?j:"BLogicIOPlugInTest-blogic-io-rules.xml"<br>
 *         (?) blogic-io?i?WbN?o?}bsO`t@C?j:"BLogicIOPlugInTest-blogic-io.xml"<br>
 *         (?) mapperStr?i?WbN?o?fNX?j:?NXw<br>
 *         (?) digester:null<br>
 *
 * <br>
 * l?F(?) O:ServletException<br>
 *                    bvO?FClassLoadException<br>
 *         (?) ?O:??O?<br>
 *                    G?[?O?F""<br>
 *                    O?FClassLoadException<br>
 *
 * <br>
 * ?}bp?[NXw???AServletExceptionX??[?B
 * <br>
 *
 * @throws Exception ?\bh?O
 */
public void testInit09() throws Exception {
    // eXgf?[^?
    // W?[??
    ModuleConfig config = new ModuleConfigImpl("");

    // BLogic`?[t@C
    UTUtil.setPrivateField(plugin, "digesterRules",
            BLogicIOPlugInTest.class.getResource("BLogicIOPlugInTest-blogic-io-rules.xml").getPath());
    // BLogic`t@C
    UTUtil.setPrivateField(plugin, "resources",
            BLogicIOPlugInTest.class.getResource("BLogicIOPlugInTest-blogic-io.xml").getPath());
    // }bp?[NX(?NX?j
    UTUtil.setPrivateField(plugin, "mapperStr", "nothing.NothingClass");

    // ANVT?[ubg??
    BLogicIOPlugIn_ActionServletStub01 servlet = new BLogicIOPlugIn_ActionServletStub01();

    // eXg?s
    try {
        plugin.init(servlet, config);
        fail();
    } catch (ServletException e) {
        // eXgmF
        assertEquals(ClassLoadException.class.getName(), e.getRootCause().getClass().getName());
        assertTrue(LogUTUtil.checkError("", e.getRootCause()));
    }
}

From source file:jp.terasoluna.fw.web.struts.plugins.BLogicIOPlugInTest.java

/**
 * testInit10()//from w  w  w . j  ava  2s.co  m
 * <br><br>
 *
 * (?n)
 * <br>
 * _?FCG
 * <br><br>
 * l?F(?) servlet:not null<br>
 *         (?) config:W?[(?)=""<br>
 *         (?) rules?iDigester?[t@C?j:"BLogicIOPlugInTest-blogic-io-rules.xml"<br>
 *         (?) blogic-io?i?WbN?o?}bsO`t@C?j:"BLogicIOPlugInTest-blogic-io.xml"<br>
 *         (?) mapperStr?i?WbN?o?fNX?j:""()<br>
 *         (?) digester:null<br>
 *
 * <br>
 * l?F(?) O:ServletException<br>
 *                    bvO?FClassLoadException<br>
 *         (?) ?O:??O?<br>
 *                    G?[?O?F""<br>
 *                    O?FClassLoadException<br>
 *
 * <br>
 * }bp?[NX?AServletExceptionX??[?B
 * <br>
 *
 * @throws Exception ?\bh?O
 */
public void testInit10() throws Exception {
    // eXgf?[^?
    // W?[??
    ModuleConfig config = new ModuleConfigImpl("");

    // BLogic`?[t@C
    UTUtil.setPrivateField(plugin, "digesterRules",
            BLogicIOPlugInTest.class.getResource("BLogicIOPlugInTest-blogic-io-rules.xml").getPath());
    // BLogic`t@C
    UTUtil.setPrivateField(plugin, "resources",
            BLogicIOPlugInTest.class.getResource("BLogicIOPlugInTest-blogic-io.xml").getPath());
    // }bp?[NX(?j
    UTUtil.setPrivateField(plugin, "mapperStr", "");

    // ANVT?[ubg??
    BLogicIOPlugIn_ActionServletStub01 servlet = new BLogicIOPlugIn_ActionServletStub01();

    // eXg?s
    try {
        plugin.init(servlet, config);
        fail();
    } catch (ServletException e) {
        // eXgmF
        assertEquals(ClassLoadException.class.getName(), e.getRootCause().getClass().getName());
        assertTrue(LogUTUtil.checkError("", e.getRootCause()));
    }
}

From source file:jp.terasoluna.fw.web.struts.plugins.BLogicIOPlugInTest.java

/**
 * testInit08()/*from  w w w . j ava2s . c o  m*/
 * <br><br>
 *
 * (?n)
 * <br>
 * _?FCG
 * <br><br>
 * l?F(?) servlet:not null<br>
 *         (?) config:W?[(?)=""<br>
 *         (?) rules?iDigester?[t@C?j:"BLogicIOPlugInTest-blogic-io-rules.xml"<br>
 *         (?) blogic-io?i?WbN?o?}bsO`t@C?j:"BLogicIOPlugInTest-blogic-io.xml"<br>
 *         (?) mapperStr?i?WbN?o?fNX?j:BLogicMapper?AAbstractBLogicMapperp?NXw<br>
 *         (?) digester:null<br>
 *
 * <br>
 * l?F(?) O:ServletException<br>
 *                    bvO?FClassCastException<br>
 *         (?) ?O:??O?<br>
 *                    G?[?O?F""<br>
 *                    O?FClassCastException<br>
 *
 * <br>
 * }bp?[NXBLogicMapper?AAbstractBLogicMapperp?NX?AServletExceptionX??[?B
 * <br>
 *
 * @throws Exception ?\bh?O
 */
public void testInit08() throws Exception {
    // eXgf?[^?
    // W?[??
    ModuleConfig config = new ModuleConfigImpl("");

    // BLogic`?[t@C
    UTUtil.setPrivateField(plugin, "digesterRules",
            BLogicIOPlugInTest.class.getResource("BLogicIOPlugInTest-blogic-io-rules.xml").getPath());
    // BLogic`t@C
    UTUtil.setPrivateField(plugin, "resources",
            BLogicIOPlugInTest.class.getResource("BLogicIOPlugInTest-blogic-io.xml").getPath());
    // }bp?[NX(BLogicMapperNX?j
    UTUtil.setPrivateField(plugin, "mapperStr",
            "jp.terasoluna.fw.web.struts.plugins." + "BLogicIOPlugIn_BLogicMapperStub02");

    // ANVT?[ubg??
    BLogicIOPlugIn_ActionServletStub01 servlet = new BLogicIOPlugIn_ActionServletStub01();

    // eXg?s
    try {
        plugin.init(servlet, config);
        fail();
    } catch (ServletException e) {
        // eXgmF
        assertEquals(ClassCastException.class.getName(), e.getRootCause().getClass().getName());
        assertTrue(LogUTUtil.checkError("", e.getRootCause()));
    }
}

From source file:jp.terasoluna.fw.web.struts.plugins.BLogicIOPlugInTest.java

/**
 * testInit12()/*from   www.j av a 2  s. c o m*/
 * <br><br>
 *
 * (?n)
 * <br>
 * _?FCG
 * <br><br>
 * l?F(?) servlet:not null<br>
 *         (?) config:W?[(?)=""<br>
 *         (?) rules?iDigester?[t@C?j:"BLogicIOPlugInTest-blogic-io-rules.xml"<br>
 *         (?) blogic-io?i?WbN?o?}bsO`t@C?j:"nothing.xml"(?t@C)<br>
 *         (?) mapperStr?i?WbN?o?fNX?j:null<br>
 *         (?) digester:null<br>
 *
 * <br>
 * l?F(?) O:ServletException<br>
 *                    bvO?FMalformedURLException<br>
 *         (?) ?O:??O?<br>
 *                    G?[?O?F""<br>
 *                    O?FMalformedURLException<br>
 *
 * <br>
 * ??WbN?o?}bsO`t@Cw???AServletExceptionX??[?B
 * <br>
 *
 * @throws Exception ?\bh?O
 */
public void testInit12() throws Exception {
    // eXgf?[^?
    // W?[??
    ModuleConfig config = new ModuleConfigImpl("");

    // BLogic`?[t@C
    UTUtil.setPrivateField(plugin, "digesterRules",
            BLogicIOPlugInTest.class.getResource("BLogicIOPlugInTest-blogic-io-rules.xml").getPath());
    // BLogic`t@C(?t@C)
    UTUtil.setPrivateField(plugin, "resources", "nothing.xml");
    // }bp?[NX
    UTUtil.setPrivateField(plugin, "mapperStr", null);

    // ANVT?[ubg??
    BLogicIOPlugIn_ActionServletStub01 servlet = new BLogicIOPlugIn_ActionServletStub01();

    // eXg?s
    try {
        plugin.init(servlet, config);
        fail();
    } catch (ServletException e) {
        // eXgmF
        assertEquals(MalformedURLException.class.getName(), e.getRootCause().getClass().getName());
        assertTrue(LogUTUtil.checkError("", e.getRootCause()));
    }
}

From source file:jp.terasoluna.fw.web.struts.plugins.BLogicIOPlugInTest.java

/**
 * testInit01()/*from  w  w w . j  ava2  s.  c o m*/
 * <br><br>
 *
 *  (?n)
 * <br>
 * _?FCG
 * <br><br>
 * l?F(?) servlet:not null<br>
 *         (?) config:W?[(?)=""<br>
 *         (?) rules?iDigester?[t@C?j:null<br>
 *         (?) blogic-io?i?WbN?o?}bsO`t@C?j:"BLogicIOPlugInTest-blogic-io.xml"<br>
 *         (?) mapperStr?i?WbN?o?fNX?j:null<br>
 *         (?) digester:null<br>
 *
 * <br>
 * l?F(?) O:ServletException<br>
 *                    bvO?FXmlLoadException<br>
 *                    ?ftHg?[t@C??A?O<br>
 *         (?) ?O:??O?<br>
 *                    G?[?O?F""<br>
 *                    O?FXmlLoadException<br>
 *         (?) digesterRules:"/WEB-INF/blogic-io-rules.xml"<br>
 *
 * <br>
 * Digester?[t@Cw???AT?[ubgReLXg\?[XftHg?[t@Co^?B
 * <br>
 *
 * @throws Exception ?\bh?O
 */
public void testInit01() throws Exception {
    // eXgf?[^?
    // BLogic`?[t@C
    UTUtil.setPrivateField(plugin, "digesterRules", null);
    // BLogic`t@C
    UTUtil.setPrivateField(plugin, "resources",
            BLogicIOPlugInTest.class.getResource("BLogicIOPlugInTest-blogic-io.xml").getPath());

    // }bp?[NX
    UTUtil.setPrivateField(plugin, "mapperStr", null);

    // ANVT?[ubg??
    BLogicIOPlugIn_ActionServletStub01 servlet = new BLogicIOPlugIn_ActionServletStub01();

    // W?[??
    ModuleConfig config = new ModuleConfigImpl("");

    // eXg?s
    try {
        plugin.init(servlet, config);
        fail();
    } catch (ServletException e) {
        // eXgmF
        assertEquals(XmlLoadException.class.getName(), e.getRootCause().getClass().getName());
        assertEquals("/WEB-INF/blogic-io-rules.xml", UTUtil.getPrivateField(plugin, "digesterRules"));
        assertTrue(LogUTUtil.checkError("", e.getRootCause()));
        // T?[ubgReLXgo^\?[X
        // ftHg?[t@C?B
        BLogicIOPlugIn_MockServletContextStub01 ctx = (BLogicIOPlugIn_MockServletContextStub01) servlet
                .getServletContext();
        assertEquals("/WEB-INF/blogic-io-rules.xml", ctx.getCalledResources());

    }
}

From source file:jp.terasoluna.fw.web.struts.plugins.BLogicIOPlugInTest.java

/**
 * testInit14()/*from w  w  w. j  a  v  a2s .  co m*/
 * <br><br>
 *
 * (?n)
 * <br>
 * _?FCG
 * <br><br>
 * l?F(?) servlet:not null<br>
 *         (?) config:W?[(?)=""<br>
 *         (?) rules?iDigester?[t@C?j:"BLogicIOPlugInTest-blogic-io-rules.xml"<br>
 *         (?) blogic-io?i?WbN?o?}bsO`t@C?j:"BLogicIOPlugInTest-error-blogic-io.xml"(p?[XG?[?t@C)<br>
 *         (?) mapperStr?i?WbN?o?fNX?j:null<br>
 *         (?) digester:null<br>
 *
 * <br>
 * l?F(?) O:ServletException<br>
 *                    bvO?F<br>
 *                    SAXException<br>
 *         (?) ?O:??O?<br>
 *                    G?[?O?F""<br>
 *                    O?FSAXException<br>
 *
 * <br>
 * p?[XG?[??WbN?o?}bsO`t@Cw???AServletExceptionX??[?B
 * <br>
 *
 * @throws Exception ?\bh?O
 */
public void testInit14() throws Exception {
    // eXgf?[^?
    // W?[??
    ModuleConfig config = new ModuleConfigImpl("");

    // BLogic`?[t@C
    UTUtil.setPrivateField(plugin, "digesterRules",
            BLogicIOPlugInTest.class.getResource("BLogicIOPlugInTest-blogic-io-rules.xml").getPath());
    // BLogic`t@C(p?[XG?[??j
    UTUtil.setPrivateField(plugin, "resources",
            BLogicIOPlugInTest.class.getResource("BLogicIOPlugInTest-error-blogic-io.xml").getPath());
    // }bp?[NX
    UTUtil.setPrivateField(plugin, "mapperStr", null);

    // ANVT?[ubg??
    BLogicIOPlugIn_ActionServletStub01 servlet = new BLogicIOPlugIn_ActionServletStub01();

    // eXg?s
    try {
        plugin.init(servlet, config);
        fail();
    } catch (ServletException e) {
        // eXgmF
        // ????ASAXParseException??AcatchSAXExceptioninstanceof`FbN
        assertTrue(e.getRootCause() instanceof SAXException);
        assertTrue(LogUTUtil.checkError("", e.getRootCause()));
    }
}