You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Daren Reavis <dr...@ibnads.com> on 2006/05/31 20:16:49 UTC

ClasspathResourceLoader returning binary jar instead of template

I am developing a webapp under Tomcat 5 and Velocity.  I have a
velocity.properties file that looks like this:

[VELOCITY.PROPERTIES]
/resource.loader = class
class.resource.loader.description = Velocity Classpath Resource Loader
class.resource.loader.class =
org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
/[/VELOCITY.PROPERTIES]

Then, I included my templated in a jar in my WEB-INF/lib folder.  If I
do a unzip -t on the template.jar it looks like this:

[TEMPLATE.JAR]
/Archive:  template.jar
    testing: META-INF/                OK
    testing: META-INF/MANIFEST.MF     OK
    testing: generic.vm               OK
    testing: hello.vm                 OK
    testing: reporter.vm              OK
No errors detected in compressed data of template.jar.
/[/TEMPLATE.JAR]

Then, when I call the template from a servlet, I get a bunch of garbage
in the browser that looks like it is spitting out the binary of the jar
file.  It looks like this:

[BINARY JUNK]
PK