Package org.apache.turbine.util

Examples of org.apache.turbine.util.TurbineException


            throw t;
        }

        catch (Throwable t)
        {
            throw new TurbineException
                    ("Failed to instantiate " + handlerClass, t);
        }
    }
View Full Code Here


            XmlRpcClient client = new XmlRpcClient(url);
            return client.execute(methodName, params);
        }
        catch (Exception e)
        {
            throw new TurbineException("XML-RPC call failed", e);
        }
    }
View Full Code Here

            client.setBasicAuthentication(username, password);
            return client.execute(methodName, params);
        }
        catch (Exception e)
        {
            throw new TurbineException("XML-RPC call failed", e);
        }
    }
View Full Code Here

        /** template name with relative path */
        String relativeTemplateName = getRelativeTemplateName(templateName);

        if (StringUtils.isEmpty(relativeTemplateName))
        {
            throw new TurbineException(
                "Template " + templateName + " not found in template paths");
        }

        // get the RequestDispatcher for the JSP
        RequestDispatcher dispatcher = data.getServletContext()
            .getRequestDispatcher(relativeTemplateName);

        try
        {
            if (isForward)
            {
                // forward the request to the JSP
                dispatcher.forward(data.getRequest(), data.getResponse());
            }
            else
            {
                data.getOut().flush();
                // include the JSP
                dispatcher.include(data.getRequest(), data.getResponse());
            }
        }
        catch (Exception e)
        {
            // as JSP service is in Alpha stage, let's try hard to send the
            // error message to the browser, to speed up debugging
            try
            {
                data.getOut().print("Error encountered processing a template: "
                    + templateName);
                e.printStackTrace(data.getOut());
            }
            catch (IOException ignored)
            {
            }

            // pass the exception to the caller according to the general
            // contract for tamplating services in Turbine
            throw new TurbineException(
                "Error encountered processing a template: " + templateName, e);
        }
    }
View Full Code Here

        // Get the specified configuration.
        String[] cfg = (String[]) configurations.get(key);
        if (cfg == null)
        {
            throw new TurbineException("RunTime configuration '" + key + "' is undefined");
        }

        TurbineRunData data;
        try
        {
            data = (TurbineRunData) pool.getInstance(cfg[0]);
            data.setParameterParser((ParameterParser) pool.getInstance(cfg[1]));
            data.setCookieParser((CookieParser) pool.getInstance(cfg[2]));
        }
        catch (ClassCastException x)
        {
            throw new TurbineException("RunData configuration '" + key + "' is illegal", x);
        }

        // Set the request and response.
        data.setRequest(req);
        data.setResponse(res);
View Full Code Here

        {
            return Torque.getDatabaseMap();
        }
        catch (Exception ex)
        {
            throw new TurbineException(ex);
        }
    }
View Full Code Here

        {
            return Torque.getDatabaseMap(name);
        }
        catch (Exception ex)
        {
            throw new TurbineException(ex);
        }
    }
View Full Code Here

    private static final void renderingError(String filename, Exception e)
            throws TurbineException
    {
        String err = "Error rendering Velocity template: " + filename;
        log.error(err, e);
        throw new TurbineException(err, e);
    }
View Full Code Here

    public Object getInstance(String className)
            throws TurbineException
    {
        if (className == null)
        {
            throw new TurbineException(
                    new NullPointerException("String className"));
        }

        Factory factory = getFactory(className);
        if (factory == null)
        {
            Class clazz;
            try
            {
                clazz = loadClass(className);
            }
            catch (ClassNotFoundException x)
            {
                throw new TurbineException(
                        "Instantiation failed for class " + className, x);
            }
            return getInstance(clazz);
        }
        else
View Full Code Here

            ClassLoader loader)
            throws TurbineException
    {
        if (className == null)
        {
            throw new TurbineException(
                    new NullPointerException("String className"));
        }

        Factory factory = getFactory(className);
        if (factory == null)
        {
            if (loader != null)
            {
                Class clazz;
                try
                {
                    clazz = loadClass(className, loader);
                }
                catch (ClassNotFoundException x)
                {
                    throw new TurbineException(
                            "Instantiation failed for class " + className, x);
                }
                return getInstance(clazz);
            }
            else
View Full Code Here

TOP

Related Classes of org.apache.turbine.util.TurbineException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.