You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Lance Lavandowska <la...@brainopolis.com> on 2003/01/15 19:43:23 UTC

ResourceManager.getResource() exception new: java.lang.NullPointerException

Hello,

I am using Velocity 1.3 (not sure exactly which version, the date on my 
jar is 7/28/2002), trying to make the Roller project use Velocity 
properly (http://www.rollerweblogger.org).  I've created a velocimacros 
file that performs all the functionality currently presented by Roller 
through a Macros.java file.

To make a long story longer, when Velocity initializes I see the 
following in my log:

[info] Velocimacro : initialization starting.
[info] Velocimacro : adding VMs from VM library template : roller.vm
[error] ResourceManager.getResource() exception new: 
java.lang.NullPointerException
[info] Velocimacro : error using  VM library template roller.vm : 
java.lang.NullPointerException

And the macros are not available for use (no kidding).  The last 
ResourceLoader in our list is the ClasspathResourceLoader, and roller.vm 
is placed in /WEB-INF/classes.  I think it is finding the file, 
otherwise I would expect other errors.  But I'm not clear on what this 
error means.

I've used the new Eclipse Velocity tool, and it isn't flagging anything 
as a problem.  I've also run roller.vm through the velocidoc tool 
without trouble.  So I don't think it is a parsing problem.

Any hints or suggestions welcome.

Thanks,

Lance


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: ResourceManager.getResource() exception new: java.lang.NullPointerException

Posted by Lance Lavandowska <la...@brainopolis.com>.
Well, I'm left thinking that ResourceManager is not finding my file, 
even though I would expect to get a ResourceNotFoundException: I removed 
the file from its location and got the exact same error.

I've tried using the file loader and pointing it specifically to the 
webapp/WEB-INF/classes directory (after putting the file back) and it 
still gave the same message, however.

Lance

Lance Lavandowska wrote:
> Lance Lavandowska wrote:
> 
>> [info] Velocimacro : initialization starting.
>> [info] Velocimacro : adding VMs from VM library template : roller.vm
>> [error] ResourceManager.getResource() exception new: 
>> java.lang.NullPointerException
>> [info] Velocimacro : error using  VM library template roller.vm : 
>> java.lang.NullPointerException
> 
> 
> Obviously the problem lies in ResourceManagerImpl.getResource(). 
> Unfortunately, there are two places in that method that both log 
> "ResourceManager.getResource() exception new:", and it is pure guesswork 
> as to which of the two is throwing the error.  Also, without a 
> stacktrace it isn't possible to tell if the NPE is happening in 
> getResource() or in one of the methods it calls.
> 
> Is there someway to get the stacktrace out of this?
> 
> Thanks,
> 
> Lance



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: ResourceManager.getResource() exception new: java.lang.NullPointerException

Posted by Lance Lavandowska <la...@brainopolis.com>.
Lance Lavandowska wrote:

> [info] Velocimacro : initialization starting.
> [info] Velocimacro : adding VMs from VM library template : roller.vm
> [error] ResourceManager.getResource() exception new: 
> java.lang.NullPointerException
> [info] Velocimacro : error using  VM library template roller.vm : 
> java.lang.NullPointerException

Obviously the problem lies in ResourceManagerImpl.getResource(). 
Unfortunately, there are two places in that method that both log 
"ResourceManager.getResource() exception new:", and it is pure guesswork 
as to which of the two is throwing the error.  Also, without a 
stacktrace it isn't possible to tell if the NPE is happening in 
getResource() or in one of the methods it calls.

Is there someway to get the stacktrace out of this?

Thanks,

Lance


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>