You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Va...@lntinfotech.com on 2002/05/15 07:32:49 UTC

velocity log is not getting created

Hi,

    we had done a project using velocity and tomcat 3.3. when we tried to
invoke a servlet  we got...

[ resource not found exception  and the resource file name. ]

The path for the templates in velocity.properties file is right

file.resource.loader.path = /WEB-INF/templates
runtime.log = WEB-INF/velocity.log



in tomcat log file we found this exception..


   PANIC : Error configuring AvalonLogSystem :
java.io.FileNotFoundException: C:\Program
Files\Hitachi\CIFE1.0\WEB-INF\velocity.log (Access Denied)
java.lang.Exception: Unable to configure AvalonLogSystem :
java.io.FileNotFoundException: C:\Program
Files\Hitachi\CIFE1.0\WEB-INF\velocity.log (Access Denied)
     at
org.apache.velocity.runtime.log.AvalonLogSystem.init(AvalonLogSystem.java:135)
     at
org.apache.velocity.runtime.log.LogManager.createLogSystem(LogManager.java:108)
     at
org.apache.velocity.runtime.RuntimeInstance.initializeLogger(RuntimeInstance.java:468)
     at
org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:259)
     at
org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:438)
     at
org.apache.velocity.runtime.RuntimeSingleton.init(RuntimeSingleton.java:260)
     at org.apache.velocity.app.Velocity.init(Velocity.java:149)
     at
org.apache.velocity.servlet.VelocityServlet.init(VelocityServlet.java:205)
     at
org.apache.tomcat.facade.ServletHandler.doInit(ServletHandler.java:447)
     at org.apache.tomcat.facade.ServletHandler.init(ServletHandler.java,
Compiled Code)
     at
org.apache.tomcat.facade.ServletHandler.service(ServletHandler.java:472)
     at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java,
Compiled Code)
     at org.apache.tomcat.core.ContextManager.service(ContextManager.java,
Compiled Code)
     at
org.apache.tomcat.modules.server.JNIConnectionHandler.processConnection(JNIConnectionHandler.java:185)
     at
org.apache.tomcat.modules.server.JNIEndpoint.service(JNIEndpoint.java:188)
2002-05-14 20:20:41 - SessionIdGenerator: Created random class
java.security.SecureRandom



velocity log file is not created and we are unable to figure out the
problem...

Need an urgent help.

Thanks and Regards
Vanitha


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


Re: velocity log is not getting created

Posted by Derick <de...@xenocex.com>.
Try something like this:

    protected Properties loadConfiguration(ServletConfig config )
        throws IOException, FileNotFoundException
    {
        String path = "";
        Properties p = new Properties();
        path = config.getServletContext().getRealPath("/");

        if (path == null)
        {
            System.out.println(" SampleServlet.loadConfiguration() : unable
to "
                               + "get the current webapp root.  Using '/'.
Please fix.");
            path = "/";
        }

        p.setProperty( Velocity.FILE_RESOURCE_LOADER_PATH,  path );
        p.setProperty( "runtime.log", path + "velocity.log" );
        return p;
    }

Derick Fernando

----- Original Message -----
From: <Va...@lntinfotech.com>
To: "Velocity Users List" <ve...@jakarta.apache.org>
Sent: Tuesday, May 14, 2002 10:32 PM
Subject: velocity log is not getting created


> Hi,
>
>     we had done a project using velocity and tomcat 3.3. when we tried to
> invoke a servlet  we got...
>
> [ resource not found exception  and the resource file name. ]
>
> The path for the templates in velocity.properties file is right
>
> file.resource.loader.path = /WEB-INF/templates
> runtime.log = WEB-INF/velocity.log
>
>
>
> in tomcat log file we found this exception..
>
>
>    PANIC : Error configuring AvalonLogSystem :
> java.io.FileNotFoundException: C:\Program
> Files\Hitachi\CIFE1.0\WEB-INF\velocity.log (Access Denied)
> java.lang.Exception: Unable to configure AvalonLogSystem :
> java.io.FileNotFoundException: C:\Program
> Files\Hitachi\CIFE1.0\WEB-INF\velocity.log (Access Denied)
>      at
>
org.apache.velocity.runtime.log.AvalonLogSystem.init(AvalonLogSystem.java:13
5)
>      at
>
org.apache.velocity.runtime.log.LogManager.createLogSystem(LogManager.java:1
08)
>      at
>
org.apache.velocity.runtime.RuntimeInstance.initializeLogger(RuntimeInstance
.java:468)
>      at
> org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:259)
>      at
> org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:438)
>      at
>
org.apache.velocity.runtime.RuntimeSingleton.init(RuntimeSingleton.java:260)
>      at org.apache.velocity.app.Velocity.init(Velocity.java:149)
>      at
> org.apache.velocity.servlet.VelocityServlet.init(VelocityServlet.java:205)
>      at
> org.apache.tomcat.facade.ServletHandler.doInit(ServletHandler.java:447)
>      at org.apache.tomcat.facade.ServletHandler.init(ServletHandler.java,
> Compiled Code)
>      at
> org.apache.tomcat.facade.ServletHandler.service(ServletHandler.java:472)
>      at
> org.apache.tomcat.core.ContextManager.internalService(ContextManager.java,
> Compiled Code)
>      at org.apache.tomcat.core.ContextManager.service(ContextManager.java,
> Compiled Code)
>      at
>
org.apache.tomcat.modules.server.JNIConnectionHandler.processConnection(JNIC
onnectionHandler.java:185)
>      at
> org.apache.tomcat.modules.server.JNIEndpoint.service(JNIEndpoint.java:188)
> 2002-05-14 20:20:41 - SessionIdGenerator: Created random class
> java.security.SecureRandom
>
>
>
> velocity log file is not created and we are unable to figure out the
> problem...
>
> Need an urgent help.
>
> Thanks and Regards
> Vanitha
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>


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


Re: velocity log is not getting created

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
On 5/15/02 6:28 PM, "Barbara Baughman" <ba...@utdallas.edu> wrote:

> +1 to having a default VelocityServlet that assumes the root path for the
> velocity serlet files is the root path for the web application.  Those who
> want a more sophisticated implementation will be more sophisticated users
> who won't mind delving into the loadConfiguration() method.  Meanwhile,
> newbies will be impressed at how well Velocity works out of the box.

Ok.  Yep - we can make it work nicely ootb, and put this all behind us with
those two things. 

> 
> Barbara Baughman
> X2157
> 
> On Wed, 15 May 2002, Geir Magnusson Jr. wrote:
> 
>> On 5/15/02 1:32 AM, "Vanitha.S@lntinfotech.com" <Va...@lntinfotech.com>
>> wrote:
>> 
>>> Hi,
>>> 
>>>   we had done a project using velocity and tomcat 3.3. when we tried to
>>> invoke a servlet  we got...
>>> 
[SNIP]

>> Alternatively, you can use the Webapp loader and logger from the
>> jakarta-velocity-tools/view project, and load directly from within the
>> webapp and log to the servlet log.
>> 
>> This is getting to be a common problem - if no one has any opposition, I'd
>> like to bring those two classes into the Vel core and make them the default
>> config for VelocityServlet - makes it even easier to "just use".
>> 
>> -- 
>> Geir Magnusson Jr.
>> Research & Development, Adeptra Inc.
>> geirm@adeptra.com
>> +1-203-247-1713
>> 
>> 
>> 
>> --
>> To unsubscribe, e-mail:
>> <ma...@jakarta.apache.org>
>> For additional commands, e-mail:
>> <ma...@jakarta.apache.org>
>> 
>> 
> 
> 
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 

-- 
Geir Magnusson Jr.
Research & Development, Adeptra Inc.
geirm@adeptra.com
+1-203-247-1713



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


Re: velocity log is not getting created

Posted by Barbara Baughman <ba...@utdallas.edu>.
+1 to having a default VelocityServlet that assumes the root path for the
velocity serlet files is the root path for the web application.  Those who
want a more sophisticated implementation will be more sophisticated users
who won't mind delving into the loadConfiguration() method.  Meanwhile,
newbies will be impressed at how well Velocity works out of the box.

Barbara Baughman
X2157

On Wed, 15 May 2002, Geir Magnusson Jr. wrote:

> On 5/15/02 1:32 AM, "Vanitha.S@lntinfotech.com" <Va...@lntinfotech.com>
> wrote:
> 
> > Hi,
> > 
> >   we had done a project using velocity and tomcat 3.3. when we tried to
> > invoke a servlet  we got...
> > 
> > [ resource not found exception  and the resource file name. ]
> > 
> > The path for the templates in velocity.properties file is right
> > 
> > file.resource.loader.path = /WEB-INF/templates
> > runtime.log = WEB-INF/velocity.log
> > 
> > 
> > 
> > in tomcat log file we found this exception..
> > 
> > 
> >  PANIC : Error configuring AvalonLogSystem :
> > java.io.FileNotFoundException: C:\Program
> > Files\Hitachi\CIFE1.0\WEB-INF\velocity.log (Access Denied)
> > java.lang.Exception: Unable to configure AvalonLogSystem :
> > java.io.FileNotFoundException: C:\Program
> > Files\Hitachi\CIFE1.0\WEB-INF\velocity.log (Access Denied)
> >    
> [SNIP]
> 
> > 
> > velocity log file is not created and we are unable to figure out the
> > problem...
> 
> From the looks of it, it's a permissioning issue - the logger is trying to
> create a file to log to, and can't.  Can you check to see if all permissions
> are inorder for that directory :
> 
>  C:\Program Files\Hitachi\CIFE1.0\WEB-INF\
> 
> You might want to reconsider the configuration strategy.  Take a look at the
> example in examples/servlet_example2 to see how to use the ServletContext to
> ensure that your template and log directories are relative to the webapp
> root.
> 
> Alternatively, you can use the Webapp loader and logger from the
> jakarta-velocity-tools/view project, and load directly from within the
> webapp and log to the servlet log.
> 
> This is getting to be a common problem - if no one has any opposition, I'd
> like to bring those two classes into the Vel core and make them the default
> config for VelocityServlet - makes it even easier to "just use".
> 
> -- 
> Geir Magnusson Jr.
> Research & Development, Adeptra Inc.
> geirm@adeptra.com
> +1-203-247-1713
> 
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 
> 


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


Re: velocity log is not getting created

Posted by "Geir Magnusson Jr." <ge...@adeptra.com>.
On 5/15/02 1:32 AM, "Vanitha.S@lntinfotech.com" <Va...@lntinfotech.com>
wrote:

> Hi,
> 
>   we had done a project using velocity and tomcat 3.3. when we tried to
> invoke a servlet  we got...
> 
> [ resource not found exception  and the resource file name. ]
> 
> The path for the templates in velocity.properties file is right
> 
> file.resource.loader.path = /WEB-INF/templates
> runtime.log = WEB-INF/velocity.log
> 
> 
> 
> in tomcat log file we found this exception..
> 
> 
>  PANIC : Error configuring AvalonLogSystem :
> java.io.FileNotFoundException: C:\Program
> Files\Hitachi\CIFE1.0\WEB-INF\velocity.log (Access Denied)
> java.lang.Exception: Unable to configure AvalonLogSystem :
> java.io.FileNotFoundException: C:\Program
> Files\Hitachi\CIFE1.0\WEB-INF\velocity.log (Access Denied)
>    
[SNIP]

> 
> velocity log file is not created and we are unable to figure out the
> problem...

>From the looks of it, it's a permissioning issue - the logger is trying to
create a file to log to, and can't.  Can you check to see if all permissions
are inorder for that directory :

 C:\Program Files\Hitachi\CIFE1.0\WEB-INF\

You might want to reconsider the configuration strategy.  Take a look at the
example in examples/servlet_example2 to see how to use the ServletContext to
ensure that your template and log directories are relative to the webapp
root.

Alternatively, you can use the Webapp loader and logger from the
jakarta-velocity-tools/view project, and load directly from within the
webapp and log to the servlet log.

This is getting to be a common problem - if no one has any opposition, I'd
like to bring those two classes into the Vel core and make them the default
config for VelocityServlet - makes it even easier to "just use".

-- 
Geir Magnusson Jr.
Research & Development, Adeptra Inc.
geirm@adeptra.com
+1-203-247-1713



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