velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Phillip Gibb" <>
Subject RE: NullPointerException with templates in jar files
Date Wed, 22 Sep 2004 09:34:40 GMT

Yeah that's it. The problem is that it can't find the jar file.

Now that really bothers me because the properties file that contains the
property "jar.resource.loader.path"
is in the jar!

But it works when I specify an absolute path to where this jar resides.
Surely it can be relative because it is part of the classpath?

The reason why it is in the jar; is because the templates are used in a
wizard created for Jbuilder.


-----Original Message-----
From: Shinobu Kawai [] 
Sent: 21 September 2004 05:18 PM
To: Velocity Users List
Subject: NullPointerException with templates in jar files

Hi Phillip,
(Changed the subject)

> I keep getting a null pointer Exception loading template error 
> message. My templates are in a jar file as a package starting from the

> root dir of the jar.
> the properties file is successfully read :
It may be /read/ successfully, but it isn't /initializing/ Velocity
successfully.  It looks like it's failing to get the entries of the jar
file.  Could the jar file be corrupt?  Anyways, look at the Velocity
logs for a bit more detail.

> But it keeps producing a null pointer exception on
> Velocity.getTemplate("mypackage.templates.templateTest.vm")
> [
> at 
> org.apache.velocity.runtime.resource.loader.JarHolder.getEntries(JarHo
> ld
Is this the full stack trace?  The "at" tells me there's a little more
to it.  And BTW, which version of Velocity are you using?  The line
numbers don't match the ones for 1.4.

Best regards,
-- Shinobu Kawai

Shinobu Kawai(

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message