You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Manish <pr...@gmx.net> on 2009/08/26 00:36:35 UTC

Resorce not found -- again! :(

I had to format my local machine yesterday and then installed tomcat (moved 
from Tomcat 5.0 to tocat 5.5)  and built our source code froom scratch from 
our CVS. Everything is working fine - struts and all that. However, when I 
request the VTL file xxx.vm or a particular action - I encounter this 
dreaded "Resource Not Found" exception. The path name and everything else is 
same - nothing is chnaged in velocity.properties file. So what could be 
causing this exception?

Unable to find resource '/index.vm'

org.apache.velocity.exception.ResourceNotFoundException: Unable to find 
resource '/index.vm'
	at 
org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource(ResourceManagerImpl.java:458)
	at 
org.apache.velocity.runtime.resource.ResourceManagerImpl.getResource(ResourceManagerImpl.java:341)
	at 
org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:831)
	at 
org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:813)
	at 
org.apache.velocity.runtime.RuntimeSingleton.getTemplate(RuntimeSingleton.java:285)
	at 
org.apache.velocity.tools.view.servlet.VelocityViewServlet.getTemplate(VelocityViewServlet.java:540)
	at 
org.apache.velocity.tools.view.servlet.VelocityViewServlet.handleRequest(VelocityViewServlet.java:475)
	at 
org.apache.velocity.tools.view.servlet.VelocityViewServlet.doRequest(VelocityViewServlet.java:407)
	at 
org.apache.velocity.tools.view.servlet.VelocityViewServlet.doGet(VelocityViewServlet.java:373)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:627)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
	at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
	at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
	at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
	at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
	at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
	at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
	at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:873)
	at 
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
	at 
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
	at 
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
	at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
	at java.lang.Thread.run(Thread.java:619)
Is there a way I can log "webapp.resource.loader.path" from my struts 
action? How do I do that? Any pointers, help would be highly 
apreciated!TIA,- manish 



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


Re: Resorce not found -- again! :(

Posted by Nathan Bubna <nb...@gmail.com>.
On Wed, Aug 26, 2009 at 7:39 AM, Nathan Bubna<nb...@gmail.com> wrote:
> I'm not set up to easily test Tomcat 5 or 5.5 right now (this machine
> only has 6.0 at the moment).  Here's some standard questions:
>
> Are you sure that your properties are being loaded?
> What version of VelocityTools are you using?

Ah, i just saw, 1.1.  That's quite old...

> And a non-standard one:
>
> Perhaps Tomcat 5.5 isn't fond of '.' in paths.  Have you tried:
>
> webapp.resource.loader.path = /, /email
>
> On Wed, Aug 26, 2009 at 3:54 AM, Manish<pr...@gmx.net> wrote:
>> I had a very strange experience and few stressful hours after shifting to
>> Tomcat 5.5 recently. I still haven't understood the reasons, though I
>> resolved the problem myself. Here is an attempt to understand reasons behind
>> this dreaded ResourceNotFoundException when almost everything you have
>> configured seems to be fine, moreover it was working for good 5 years! :)
>>
>> This is what I have in velocity.proeprties file kept under WEB-INF -
>>
>> # $Id: velocity.properties 649 2005-02-18 07:32:03Z manishh $
>> velocimacro.library.autoreload=true
>> velocimacro.library=/VM_global_library.vm
>> velocimacro.permissions.allow.inline=true
>> file.resource.loader.cache=false
>>
>> # Filepath for error template,
>> #  relative to web application root directory
>> tools.view.servlet.error.template = default/error.vm
>>
>> # Directory for layout templates,
>> #  relative to web application root directory
>> tools.view.servlet.layout.directory = layout/
>>
>> # Filepath of the default layout template
>> #  relative to the layout directory
>> #  NOT relative to the root directory of the webapp!
>> tools.view.servlet.layout.default.template =  Default.vm
>>
>> # set some path properties now
>>
>> webapp.resource.loader.path = ., ./email
>>
>> The servlet is configured correctly -
>>
>>   <servlet>
>>       <servlet-name>velocity</servlet-name>
>>       <servlet-class>
>>           org.apache.velocity.tools.view.servlet.VelocityLayoutServlet
>>           </servlet-class>
>>       <init-param>
>>           <param-name>org.apache.velocity.toolbox</param-name>
>>           <param-value>/WEB-INF/toolbox.xml</param-value>
>>       </init-param>
>>       <init-param>
>>           <param-name>org.apache.velocity.properties</param-name>
>>           <param-value>/WEB-INF/velocity.properties</param-value>
>>       </init-param>
>>       <load-on-startup>1</load-on-startup>
>>   </servlet>
>>
>> All this was working fine under Tomcat 5.0.28 but when I switched to Tomcat
>> 5.5.28, it suddenly started showing "ResourceNotFoundException" for the VTL
>> files.  when I switched back to Tomcat 5.0.28, it worked fine!!!!!!!! What
>> exactly is happening here? I am running Win XP and Velocity tools 1.1.
>>
>> I am really surprised to see this behaviou r - clearly the issue is with
>> "velocity.proeprties" file, but I can't underatand **what** exactly is the
>> problem and what should be done to make it work under Tomcat 5.5???
>>
>> Any pointers, help would be highly appreciated.
>>
>> TIA,
>> - Manish
>>
>>
>>
>> ---------------------------------------------------------------------
>> 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


Re: Resorce not found -- again! :(

Posted by Nathan Bubna <nb...@gmail.com>.
I'm not set up to easily test Tomcat 5 or 5.5 right now (this machine
only has 6.0 at the moment).  Here's some standard questions:

Are you sure that your properties are being loaded?
What version of VelocityTools are you using?

And a non-standard one:

Perhaps Tomcat 5.5 isn't fond of '.' in paths.  Have you tried:

webapp.resource.loader.path = /, /email

On Wed, Aug 26, 2009 at 3:54 AM, Manish<pr...@gmx.net> wrote:
> I had a very strange experience and few stressful hours after shifting to
> Tomcat 5.5 recently. I still haven't understood the reasons, though I
> resolved the problem myself. Here is an attempt to understand reasons behind
> this dreaded ResourceNotFoundException when almost everything you have
> configured seems to be fine, moreover it was working for good 5 years! :)
>
> This is what I have in velocity.proeprties file kept under WEB-INF -
>
> # $Id: velocity.properties 649 2005-02-18 07:32:03Z manishh $
> velocimacro.library.autoreload=true
> velocimacro.library=/VM_global_library.vm
> velocimacro.permissions.allow.inline=true
> file.resource.loader.cache=false
>
> # Filepath for error template,
> #  relative to web application root directory
> tools.view.servlet.error.template = default/error.vm
>
> # Directory for layout templates,
> #  relative to web application root directory
> tools.view.servlet.layout.directory = layout/
>
> # Filepath of the default layout template
> #  relative to the layout directory
> #  NOT relative to the root directory of the webapp!
> tools.view.servlet.layout.default.template =  Default.vm
>
> # set some path properties now
>
> webapp.resource.loader.path = ., ./email
>
> The servlet is configured correctly -
>
>   <servlet>
>       <servlet-name>velocity</servlet-name>
>       <servlet-class>
>           org.apache.velocity.tools.view.servlet.VelocityLayoutServlet
>           </servlet-class>
>       <init-param>
>           <param-name>org.apache.velocity.toolbox</param-name>
>           <param-value>/WEB-INF/toolbox.xml</param-value>
>       </init-param>
>       <init-param>
>           <param-name>org.apache.velocity.properties</param-name>
>           <param-value>/WEB-INF/velocity.properties</param-value>
>       </init-param>
>       <load-on-startup>1</load-on-startup>
>   </servlet>
>
> All this was working fine under Tomcat 5.0.28 but when I switched to Tomcat
> 5.5.28, it suddenly started showing "ResourceNotFoundException" for the VTL
> files.  when I switched back to Tomcat 5.0.28, it worked fine!!!!!!!! What
> exactly is happening here? I am running Win XP and Velocity tools 1.1.
>
> I am really surprised to see this behaviou r - clearly the issue is with
> "velocity.proeprties" file, but I can't underatand **what** exactly is the
> problem and what should be done to make it work under Tomcat 5.5???
>
> Any pointers, help would be highly appreciated.
>
> TIA,
> - Manish
>
>
>
> ---------------------------------------------------------------------
> 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


Resorce not found -- again! :(

Posted by Manish <pr...@gmx.net>.
I had a very strange experience and few stressful hours after shifting to
Tomcat 5.5 recently. I still haven't understood the reasons, though I
resolved the problem myself. Here is an attempt to understand reasons behind
this dreaded ResourceNotFoundException when almost everything you have
configured seems to be fine, moreover it was working for good 5 years! :)

This is what I have in velocity.proeprties file kept under WEB-INF -

# $Id: velocity.properties 649 2005-02-18 07:32:03Z manishh $
velocimacro.library.autoreload=true
velocimacro.library=/VM_global_library.vm
velocimacro.permissions.allow.inline=true
file.resource.loader.cache=false

# Filepath for error template,
#  relative to web application root directory
tools.view.servlet.error.template = default/error.vm

# Directory for layout templates,
#  relative to web application root directory
tools.view.servlet.layout.directory = layout/

# Filepath of the default layout template
#  relative to the layout directory
#  NOT relative to the root directory of the webapp!
tools.view.servlet.layout.default.template =  Default.vm

# set some path properties now

webapp.resource.loader.path = ., ./email

The servlet is configured correctly -

    <servlet>
        <servlet-name>velocity</servlet-name>
        <servlet-class>
            org.apache.velocity.tools.view.servlet.VelocityLayoutServlet
            </servlet-class>
        <init-param>
            <param-name>org.apache.velocity.toolbox</param-name>
            <param-value>/WEB-INF/toolbox.xml</param-value>
        </init-param>
        <init-param>
            <param-name>org.apache.velocity.properties</param-name>
            <param-value>/WEB-INF/velocity.properties</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>

All this was working fine under Tomcat 5.0.28 but when I switched to Tomcat
5.5.28, it suddenly started showing "ResourceNotFoundException" for the VTL
files.  when I switched back to Tomcat 5.0.28, it worked fine!!!!!!!! What
exactly is happening here? I am running Win XP and Velocity tools 1.1.

I am really surprised to see this behaviou r - clearly the issue is with
"velocity.proeprties" file, but I can't underatand **what** exactly is the
problem and what should be done to make it work under Tomcat 5.5???

Any pointers, help would be highly appreciated.

TIA,
- Manish



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


Re: Resorce not found -- again! :(

Posted by Manish <pr...@gmx.net>.
Any inputs?

- Manish

----- Original Message ----- 
From: "Manish" <pr...@gmx.net>
To: "Velocity Users List" <us...@velocity.apache.org>
Sent: Wednesday, August 26, 2009 4:06 AM
Subject: Resorce not found -- again! :(


>I had to format my local machine yesterday and then installed tomcat (moved 
>from Tomcat 5.0 to tocat 5.5)  and built our source code froom scratch from 
>our CVS. Everything is working fine - struts and all that. However, when I 
>request the VTL file xxx.vm or a particular action - I encounter this 
>dreaded "Resource Not Found" exception. The path name and everything else 
>is same - nothing is chnaged in velocity.properties file. So what could be 
>causing this exception?
>
> Unable to find resource '/index.vm'
>
> org.apache.velocity.exception.ResourceNotFoundException: Unable to find 
> resource '/index.vm'
> at 
> org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource(ResourceManagerImpl.java:458)
> at 
> org.apache.velocity.runtime.resource.ResourceManagerImpl.getResource(ResourceManagerImpl.java:341)
> at 
> org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:831)
> at 
> org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:813)
> at 
> org.apache.velocity.runtime.RuntimeSingleton.getTemplate(RuntimeSingleton.java:285)
> at 
> org.apache.velocity.tools.view.servlet.VelocityViewServlet.getTemplate(VelocityViewServlet.java:540)
> at 
> org.apache.velocity.tools.view.servlet.VelocityViewServlet.handleRequest(VelocityViewServlet.java:475)
> at 
> org.apache.velocity.tools.view.servlet.VelocityViewServlet.doRequest(VelocityViewServlet.java:407)
> at 
> org.apache.velocity.tools.view.servlet.VelocityViewServlet.doGet(VelocityViewServlet.java:373)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:627)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
> at 
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
> at 
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
> at 
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
> at 
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
> at 
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
> at 
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
> at 
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
> at 
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
> at 
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:873)
> at 
> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
> at 
> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
> at 
> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
> at 
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
> at java.lang.Thread.run(Thread.java:619)
> Is there a way I can log "webapp.resource.loader.path" from my struts 
> action? How do I do that? Any pointers, help would be highly 
> apreciated!TIA,- manish
>
>
> ---------------------------------------------------------------------
> 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