Package org.apache.velocity.exception

Examples of org.apache.velocity.exception.VelocityException


        {
            repo = (StringResourceRepository) ClassUtils.getNewInstance(className);
        }
        catch (ClassNotFoundException cnfe)
        {
            throw new VelocityException("Could not find '" + className + "'", cnfe);
        }
        catch (IllegalAccessException iae)
        {
            throw new VelocityException("Could not access '" + className + "'", iae);
        }
        catch (InstantiationException ie)
        {
            throw new VelocityException("Could not instantiate '" + className + "'", ie);
        }

        if (encoding != null)
        {
            repo.setEncoding(encoding);
View Full Code Here


                postRender(context);
            }
        }
        else if (strictRef)
        {
            throw new VelocityException("Macro '#" + macroName + "' is not defined at "
                + Log.formatFileString(node));
        }
       
        /**
         * If we cannot find an implementation write the literal text
View Full Code Here

            byteArray = resource.getBody().getBytes(resource.getEncoding());
            return new ByteArrayInputStream(byteArray);
        }
        catch(UnsupportedEncodingException ue)
        {
            throw new VelocityException("Could not convert String using encoding " + resource.getEncoding(), ue);
        }
    }
View Full Code Here

        }
        catch (Exception e)
        {
            String msg = "VelocimacroProxy.render() : exception VM = #" + macroName + "()";
            rsvc.getLog().error(msg, e);
            throw new VelocityException(msg, e);
        }
    }
View Full Code Here

            }
            catch (Exception e)
            {
                String msg = "DataSourceResourceLoader: problem when closing connection";
                log.error(msg, e);
                throw new VelocityException(msg, e);
            }
        }
    }
View Full Code Here

            }
            catch (Exception e)
            {
                String msg = "DataSourceResourceLoader: problem when closing result set";
                log.error(msg, e);
                throw new VelocityException(msg, e);
            }
        }
    }
View Full Code Here

            }
            catch (Exception e)
            {
                String msg = "DataSourceResourceLoader: problem when closing PreparedStatement ";
                log.error(msg, e);
                throw new VelocityException(msg, e);
            }
        }
    }
View Full Code Here

                         }
                         catch (Exception e)
                         {
                             String msg = "Velocimacro : Error using VM library : " + lib;
                             log.error(true, msg, e);
                             throw new VelocityException(msg, e);
                         }

                         log.trace("VM library registration complete.");

                         vmManager.setRegisterFromLib(false);
View Full Code Here

                    }
                    catch (Exception e)
                    {
                        String msg = "Velocimacro : Error using VM library : " + lib;
                        log.error(true, msg, e);
                        throw new VelocityException(msg, e);
                    }

                    vp = vmManager.get(vmName, sourceTemplate, renderingTemplate);
                }
            }
View Full Code Here

            /**
             * pass through runtime exceptions
             */
            catch( RuntimeException e )
            {
                errorCondition = new VelocityException("Exception thrown processing Template "
                    +getName(), e);
                throw errorCondition;
            }
            finally
            {
                /*
                 *  Make sure to close the inputstream when we are done.
                 */
                try
                {
                    is.close();
                }
                catch(IOException e)
                {
                    // If we are already throwing an exception then we want the original
                    // exception to be continued to be thrown, otherwise, throw a new Exception.
                    if (errorCondition == null)
                    {
                         throw new VelocityException(e);
                    }                   
                }
            }
        }
        else
View Full Code Here

TOP

Related Classes of org.apache.velocity.exception.VelocityException

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.