velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Castle <cast...@yahoo.com>
Subject Problem with ClasspathResourceLoader
Date Sat, 19 Mar 2011 15:34:34 GMT
Hi all, I’ve got what I’m sure is a simple problem with the ClasspathResourceLoader.  I
have defined the following properties and put my template in the root of my single jar.  I’m
getting a ResourceNotFoundException from it.

        Properties vProps = new Properties();
        vProps.put(Velocity.RESOURCE_LOADER, "classpath");
        vProps.put("classpath." + Velocity.RESOURCE_LOADER + ".class" , ClasspathResourceLoader.class.getName());
        Velocity.init(vProps);
        try {
            Template template = Velocity.getTemplate("template.vm");
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
}

On a side note, is there an archive search somewhere that I have missed?  I'm sure this problem
has been answered plenty of times.
Thanks for the help ,

Chris


      

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org


Mime
View raw message