You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Sebastiano Vigna <vi...@dsi.unimi.it> on 2008/05/06 23:45:15 UTC

Migration from VelocitySerlvlet to VelocityViewServlet

I'm running the Lilypond Snippet Repository using Velocity since few  
years. It's a simple installation. Everything worked fine until I  
upgraded to the new VelocityViewServlet stuff. I did the "obvious"  
updates to my servlets, and now there's no way Velocity will load my  
templates. My properties say:

resource.loader = file, class
file.resource.loader.class =  
org.apache.velocity.runtime.resource.loader.FileResourceLoader
file.resource.loader.path = /WEB-INF/templates
file.resource.loader.cache = false
file.resource.loader.modificationCheckInterval = 2
class.resource.loader.class =  
org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
input.encoding=UTF-8
output.encoding=UTF-8
default.contentType=text/html; charset=UTF-8

as they always had. From the log, Velocity sees the path:

INFO  [/LSR]                          -  Velocity  [debug] Do unicode  
file recognition:  false
INFO  [/LSR]                          -  Velocity   [info]  
FileResourceLoader : adding path '/usr/share/tomcat5/webapps/LSR/WEB- 
INF/templates'

But then, there's no way to load a single template:

org.apache.velocity.exception.ResourceNotFoundException: Unable to  
find resource 'query.vm'

Something must have dramatically changed in a backward incompatible  
way, and, sincerely, after two hours of struggling I haven't the  
faintest idea of what's happening. Everything has always worked  
without a glitch.

I googled for migration problems between the old and the new setup,  
but I found nothing--not even a simple explanation about how to migrate.

Please, please help me.

Ciao,

				seba



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


Re: Migration from VelocitySerlvlet to VelocityViewServlet

Posted by Nathan Bubna <nb...@gmail.com>.
On Tue, May 6, 2008 at 2:45 PM, Sebastiano Vigna <vi...@dsi.unimi.it> wrote:
> I'm running the Lilypond Snippet Repository using Velocity since few years.
> It's a simple installation. Everything worked fine until I upgraded to the
> new VelocityViewServlet stuff. I did the "obvious" updates to my servlets,
> and now there's no way Velocity will load my templates. My properties say:
>
>  resource.loader = file, class
>  file.resource.loader.class =
> org.apache.velocity.runtime.resource.loader.FileResourceLoader

if '/WEB-INF/templates' is your resource loader path, why aren' you using
org.apache.velocity.tools.view.servlet.WebappLoader ?  The only way
the FileResourceLoader config you have will work is if the webapp root
is what the JVM considers to be its root path, and that seems very
unlikely.

>  file.resource.loader.path = /WEB-INF/templates
>  file.resource.loader.cache = false
>  file.resource.loader.modificationCheckInterval = 2
>  class.resource.loader.class =
> org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
>  input.encoding=UTF-8
>  output.encoding=UTF-8
>  default.contentType=text/html; charset=UTF-8
>
>  as they always had. From the log, Velocity sees the path:
>
>  INFO  [/LSR]                          -  Velocity  [debug] Do unicode file
> recognition:  false
>  INFO  [/LSR]                          -  Velocity   [info]
> FileResourceLoader : adding path
> '/usr/share/tomcat5/webapps/LSR/WEB-INF/templates'
>
>  But then, there's no way to load a single template:
>
>  org.apache.velocity.exception.ResourceNotFoundException: Unable to find
> resource 'query.vm'
>
>  Something must have dramatically changed in a backward incompatible way,
> and, sincerely, after two hours of struggling I haven't the faintest idea of
> what's happening. Everything has always worked without a glitch.
>
>  I googled for migration problems between the old and the new setup, but I
> found nothing--not even a simple explanation about how to migrate.
>
>  Please, please help me.
>
>  Ciao,
>
>                                 seba
>
>
>
>  ---------------------------------------------------------------------
>  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: Migration from VelocitySerlvlet to VelocityViewServlet

Posted by John Randall <Jo...@parago.com>.
Check to make sure your using the VelocityViewServlet.getTemplate method and not Velocity.getTemplate in your servlets.

-----Original Message-----
From: White, Tim [mailto:Tim.White@qwest.com]
Sent: Wednesday, May 07, 2008 8:56 AM
To: Velocity Users List
Subject: RE: Migration from VelocitySerlvlet to VelocityViewServlet

Ha - by 'releaseloader', I meant 'resourceloader'...

-----Original Message-----
From: White, Tim [mailto:Tim.White@qwest.com]
Sent: Wednesday, May 07, 2008 7:54 AM
To: Velocity Users List
Subject: RE: Migration from VelocitySerlvlet to VelocityViewServlet

Sometimes I've seen this as a missing "/" problem.  The path you added
has no trailing slash, and the template you are looking for has no
leading slash.  Sometimes just adding a trailing "/" to the end of your
releaseloader path can fix this.

Tim

-----Original Message-----
From: Sebastiano Vigna [mailto:vigna@dsi.unimi.it]
Sent: Tuesday, May 06, 2008 3:45 PM
To: velocity-user@jakarta.apache.org
Subject: Migration from VelocitySerlvlet to VelocityViewServlet

I'm running the Lilypond Snippet Repository using Velocity since few
years. It's a simple installation. Everything worked fine until I
upgraded to the new VelocityViewServlet stuff. I did the "obvious"
updates to my servlets, and now there's no way Velocity will load my
templates. My properties say:

resource.loader = file, class
file.resource.loader.class =
org.apache.velocity.runtime.resource.loader.FileResourceLoader
file.resource.loader.path = /WEB-INF/templates
file.resource.loader.cache = false
file.resource.loader.modificationCheckInterval = 2
class.resource.loader.class =
org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
input.encoding=UTF-8
output.encoding=UTF-8
default.contentType=text/html; charset=UTF-8

as they always had. From the log, Velocity sees the path:

INFO  [/LSR]                          -  Velocity  [debug] Do unicode
file recognition:  false
INFO  [/LSR]                          -  Velocity   [info]
FileResourceLoader : adding path '/usr/share/tomcat5/webapps/LSR/WEB-
INF/templates'

But then, there's no way to load a single template:

org.apache.velocity.exception.ResourceNotFoundException: Unable to find
resource 'query.vm'

Something must have dramatically changed in a backward incompatible way,
and, sincerely, after two hours of struggling I haven't the faintest
idea of what's happening. Everything has always worked without a glitch.

I googled for migration problems between the old and the new setup, but
I found nothing--not even a simple explanation about how to migrate.

Please, please help me.

Ciao,

                                seba



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


This communication is the property of Qwest and may contain confidential
or privileged information. Unauthorized use of this communication is
strictly prohibited and may be unlawful.  If you have received this
communication in error, please immediately notify the sender by reply
e-mail and destroy all copies of the communication and any attachments.

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


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


RE: Migration from VelocitySerlvlet to VelocityViewServlet

Posted by "White, Tim" <Ti...@qwest.com>.
Ha - by 'releaseloader', I meant 'resourceloader'...

-----Original Message-----
From: White, Tim [mailto:Tim.White@qwest.com] 
Sent: Wednesday, May 07, 2008 7:54 AM
To: Velocity Users List
Subject: RE: Migration from VelocitySerlvlet to VelocityViewServlet

Sometimes I've seen this as a missing "/" problem.  The path you added
has no trailing slash, and the template you are looking for has no
leading slash.  Sometimes just adding a trailing "/" to the end of your
releaseloader path can fix this.

Tim 

-----Original Message-----
From: Sebastiano Vigna [mailto:vigna@dsi.unimi.it]
Sent: Tuesday, May 06, 2008 3:45 PM
To: velocity-user@jakarta.apache.org
Subject: Migration from VelocitySerlvlet to VelocityViewServlet

I'm running the Lilypond Snippet Repository using Velocity since few
years. It's a simple installation. Everything worked fine until I
upgraded to the new VelocityViewServlet stuff. I did the "obvious"  
updates to my servlets, and now there's no way Velocity will load my
templates. My properties say:

resource.loader = file, class
file.resource.loader.class =
org.apache.velocity.runtime.resource.loader.FileResourceLoader
file.resource.loader.path = /WEB-INF/templates
file.resource.loader.cache = false
file.resource.loader.modificationCheckInterval = 2
class.resource.loader.class =
org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
input.encoding=UTF-8
output.encoding=UTF-8
default.contentType=text/html; charset=UTF-8

as they always had. From the log, Velocity sees the path:

INFO  [/LSR]                          -  Velocity  [debug] Do unicode  
file recognition:  false
INFO  [/LSR]                          -  Velocity   [info]  
FileResourceLoader : adding path '/usr/share/tomcat5/webapps/LSR/WEB-
INF/templates'

But then, there's no way to load a single template:

org.apache.velocity.exception.ResourceNotFoundException: Unable to find
resource 'query.vm'

Something must have dramatically changed in a backward incompatible way,
and, sincerely, after two hours of struggling I haven't the faintest
idea of what's happening. Everything has always worked without a glitch.

I googled for migration problems between the old and the new setup, but
I found nothing--not even a simple explanation about how to migrate.

Please, please help me.

Ciao,

				seba



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


This communication is the property of Qwest and may contain confidential
or privileged information. Unauthorized use of this communication is
strictly prohibited and may be unlawful.  If you have received this
communication in error, please immediately notify the sender by reply
e-mail and destroy all copies of the communication and any attachments.

---------------------------------------------------------------------
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: Migration from VelocitySerlvlet to VelocityViewServlet

Posted by "White, Tim" <Ti...@qwest.com>.
Sometimes I've seen this as a missing "/" problem.  The path you added
has no trailing slash, and the template you are looking for has no
leading slash.  Sometimes just adding a trailing "/" to the end of your
releaseloader path can fix this.

Tim 

-----Original Message-----
From: Sebastiano Vigna [mailto:vigna@dsi.unimi.it] 
Sent: Tuesday, May 06, 2008 3:45 PM
To: velocity-user@jakarta.apache.org
Subject: Migration from VelocitySerlvlet to VelocityViewServlet

I'm running the Lilypond Snippet Repository using Velocity since few
years. It's a simple installation. Everything worked fine until I
upgraded to the new VelocityViewServlet stuff. I did the "obvious"  
updates to my servlets, and now there's no way Velocity will load my
templates. My properties say:

resource.loader = file, class
file.resource.loader.class =
org.apache.velocity.runtime.resource.loader.FileResourceLoader
file.resource.loader.path = /WEB-INF/templates
file.resource.loader.cache = false
file.resource.loader.modificationCheckInterval = 2
class.resource.loader.class =
org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
input.encoding=UTF-8
output.encoding=UTF-8
default.contentType=text/html; charset=UTF-8

as they always had. From the log, Velocity sees the path:

INFO  [/LSR]                          -  Velocity  [debug] Do unicode  
file recognition:  false
INFO  [/LSR]                          -  Velocity   [info]  
FileResourceLoader : adding path '/usr/share/tomcat5/webapps/LSR/WEB-
INF/templates'

But then, there's no way to load a single template:

org.apache.velocity.exception.ResourceNotFoundException: Unable to find
resource 'query.vm'

Something must have dramatically changed in a backward incompatible way,
and, sincerely, after two hours of struggling I haven't the faintest
idea of what's happening. Everything has always worked without a glitch.

I googled for migration problems between the old and the new setup, but
I found nothing--not even a simple explanation about how to migrate.

Please, please help me.

Ciao,

				seba



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


This communication is the property of Qwest and may contain confidential or
privileged information. Unauthorized use of this communication is strictly 
prohibited and may be unlawful.  If you have received this communication 
in error, please immediately notify the sender by reply e-mail and destroy 
all copies of the communication and any attachments.

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