velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geir Magnusson Jr. <ge...@optonline.net>
Subject Re: Unable to locate .VM files in Jar (Velocity 1.3.1)
Date Fri, 31 Oct 2003 14:44:50 GMT

On Friday, October 31, 2003, at 05:30 AM, Geir Magnusson Jr. wrote:

>
> On Thursday, October 30, 2003, at 08:14 PM, Charles Oliver Nutter 
> wrote:
>
>> Let me know if you need any help!
>>
>> Seriously though, it wouldn't be a bad idea to put this in place 
>> wherever ClassLoader is used; for example, in locating ResourceLoader 
>> instances. As it is, I created my own ThreadContextResourceLoader so 
>> I could load from a jar in an EJB container...but I had to put that 
>> classloader in a jar at the same level as the Velocity jar 
>> (system-wide). An app should be able to configure resource loaders 
>> that might only exist in its context classloader.
>>
>> I'm sure there's other places also.
>
> You're exactly right.  It's a simple change so we can see where else 
> we have it.
>
> It did break a texen test case, so I'm chasing that down now.  Started 
> last night, but decided it was time to carve pumpkins for my 5 month 
> old.  I had fun - seems like at that age, it's mostly for the parents. 
>  She didn't give a hoot, other than trying to lick one.  I guess a big 
> orange vegetable is good for that at that age.
>

Hoo boy.  Here's the beef.  Ant doesn't set the context classloader

so Thread.currentThread().getContextClassloader()

return the primordial classloader, which of course, doesn't have the 
classpath that you set in the ant build script.  I you use the canonical

this.getClass().getClassloader()

you get the ant classloader, which has your classpath.

I'm asking the ant crew about what to do.

-- 
Geir Magnusson Jr                                   203-247-1713(m)
geirm@optonline.net


---------------------------------------------------------------------
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