You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Keith Vance <kv...@n-link.net> on 2001/05/21 23:45:48 UTC

can't load my own properties file using tomcat

I am having a difficult time getting Velocity to read my properties file
using tomcat.
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
2.2//EN"
 "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">

here is my web.xml file for the SampleServlet
<web-app>
  <servlet>
    <servlet-name>Velocity Sample</servlet-name>
    <description>Sample</description>
    <servlet-class>SampleServlet</servlet-class>
    <init-param>
      <param-name>properties</param-name>
      <param-value>velocity.properties</param-value>
    </init-param>
  </servlet>
</web-app>
END web.xml

my velocity.properties file which is located in
/usr/local/jakarta-tomcat/webapps/kiowa

file.resource.loader.path = /usr/local/jakarta-tomcat/webapps/kiowa/templates
runtime.log=/usr/local/jakarta-tomcat/webapps/kiowa/logs/servlets.log

END velocity.properties


Basically the only place the I put my sample.vm file is
/usr/local/jakarta-tomcat/bin

Any tips to troubleshoot why tomcat is not processing the init-params?


-- 
K E I T H  V A N C E
Software Engineer
n-Link Corporation


Re: can't load my own properties file using tomcat

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
Keith Vance wrote:
> 
> I am having a difficult time getting Velocity to read my properties file
> using tomcat.
> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
> 2.2//EN"
>  "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
> 
> here is my web.xml file for the SampleServlet
> <web-app>
>   <servlet>
>     <servlet-name>Velocity Sample</servlet-name>
>     <description>Sample</description>
>     <servlet-class>SampleServlet</servlet-class>
>     <init-param>
>       <param-name>properties</param-name>
>       <param-value>velocity.properties</param-value>
>     </init-param>
>   </servlet>
> </web-app>
> END web.xml
> 
> my velocity.properties file which is located in
> /usr/local/jakarta-tomcat/webapps/kiowa
> 
> file.resource.loader.path = /usr/local/jakarta-tomcat/webapps/kiowa/templates
> runtime.log=/usr/local/jakarta-tomcat/webapps/kiowa/logs/servlets.log
> 
> END velocity.properties
> 
> Basically the only place the I put my sample.vm file is
> /usr/local/jakarta-tomcat/bin
> 
> Any tips to troubleshoot why tomcat is not processing the init-params?
> 

Yikes :)

Are you using the new 1.1-rc1 release?

everything looks reasonable except for that bit about the tempate in bin
- that means that the file.resource.loader.path is *not* getting set,
and remains as it's default.

I have a feeling you aren't using the latest SampleServlet.java from the
1.1-rc1?

geir


-- 
Geir Magnusson Jr.                           geirm@optonline.net
System and Software Consulting
Developing for the web?  See http://jakarta.apache.org/velocity/
"still climbing up to the shoulders..."