velocity-user mailing list archives

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

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.

Phill

-----Original Message-----
From: Shinobu Kawai [mailto:shinobu.kawai@gmail.com] 
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
> er.java:154)
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(shinobu.kawai@gmail.com)

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


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


Mime
View raw message