velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathan Bubna" <nbu...@gmail.com>
Subject Re: Re: getTemplate() Nullpointer but Velocity is initialised - HELP
Date Tue, 21 Aug 2007 16:47:29 GMT
On 8/21/07, PeteTh <petelists@gmail.com> wrote:
>
> Many thanks.
>
> Yes there were two exceptions, I had ignored the earlier one thinking it was
> unimportant - but I see now it was causing Velocity to not initialise - but
> then the code execution continued then getting NullPointer much later on
> ....
>
> The first exception was just a permission denied when trying to write to the
> velocity.log :-
>
> 21 Aug 2007 10:16:27 [main] ERROR
> net.sf.navigator.displayer.VelocityMenuDisplayer  - Error initializing
> Velocity: Unable to configure AvalonLogSystem :
> java.io.FileNotFoundException: /usr/share/tomcat55/velocity.log (Permission
> denied)
>
>
> For some reason the log is being written to /usr/var/tomcat55
> top directory rather than the /logs subdirectory.
>
> I see in Struts Menu velocity init there is, then it looks for a
> velocity.properties on themclasspath  :-
>
>   // default to servletlogger, which logs to the servlet engines log
>
> velocityEngine.setProperty(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM_CLASS,
>                              ServletLogger.class.getName());
>
> I will try setting up a velocity.properties with
>
> runtime.log=logs/velocity.log
>
> maybe that is what is needed ?

well, if you can't simply find a way to give the proper permissions to
access the tomcat log file, then yes, you will need to set up a
velocity.properties that tells the VelocityEngine used by StrutsMenu
to log somewhere where it does have permission.  however, it requires
more than just setting the runtime.log property, as that is ignored by
the ServletLogger.  you'll need to tell that engine to use an entirely
different log system.  see the following for more info:

http://velocity.apache.org/engine/devel/developer-guide.html#configuring_logging

>
>
>
> Nathan Bubna wrote:
> >
> > it certainly looks like some exception is thrown either prior to or
> > during the call to init(props).  can you find this Exception in your
> > logs?
> >
>
> --
> View this message in context: http://www.nabble.com/getTemplate%28%29-Nullpointer-but-Velocity-is-initialised---HELP-tf4299522.html#a12257949
> Sent from the Velocity - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>
>

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


Mime
View raw message