You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Magne Skjeret <ma...@broadpark.no> on 2003/09/10 07:55:17 UTC

velocity.properties

Hi

I have been working with velocity for some months now, and it is just a
beauty.
It has actually lifted some weight of my shoulders, because now if is
feasible for other people in the team, to change the html without
knowing any java. So the request of type: 'pad the image 1px to the
left' has stopped. 1 such request isnt much but when there are 50 it is
just anoying.

Well, enough sucking up.

The real problem is that now when I have used it for some time, I have
come to a prouction(?) state of my app. So I boldly deployed my war in
jboss+tomcat. But it cant find the velocity.properties. It is placed at
document root for that app. Standalone tomcat finds it. I have tried
moving it around to classes and lib in WEB-INF updating the web.xml
accordingly. But still no joy.

I then unpacked the war by hand in the depkoy dir (no war), then it
found it.
Has anyone had similar problems? Am I doing something wrong? A setting
in jboss. I am pretty sure it cant be a setting in velocity.properties
:-)

Keep up the jolly good work
Magne



Re: velocity.properties

Posted by Nathan Bubna <na...@esha.com>.
Magne Skjeret said:
> Well, the problem is that it cant find velocity.properties. I havent tried
> the templates yet, due to that it cant load the velocity.properties and
> dont know how to retrieve the templates yet.

agreed.

> The velocity.properties is found when I manually unpack the war file, but
> not deploy as war. Is the velocity using the absolute path to the file to
> load it?

are you using the VelocityServlet or the VelocityViewServlet (from
velocity-tools)?

if the former, then the answer to your question is "yes."

http://issues.apache.org/bugzilla/show_bug.cgi?id=17455
http://issues.apache.org/bugzilla/show_bug.cgi?id=17058

this behavior has been changed in the VelocityViewServlet to load the
configuration via ServletContext.getResourceAsStream().  i believe that should
work (though i've not tried it with jboss+tomcat myself.  i just use tomcat.).
also, if you are using the FileResourceLoader, then when you get around to
loading templates in an unpacked war situation, you're likely to have problems
again.  the WebappResourceLoader in velocity-tools should be able to remedy
that.

basically, if you're doing webapps with velocity, velocity-tools is the way to
go.  if you're already using it, then i dunno what the problem is, but i want
to find out and fix it. :)

Nathan Bubna
nathan@esha.com


Re: velocity.properties

Posted by Magne Skjeret <ma...@broadpark.no>.
At 12:08 10.09.2003 +0300, you wrote:
>Magne,

Well, the problem is that it cant find velocity.properties. I havent tried 
the templates yet, due to that it cant load the velocity.properties and 
dont know how to retrieve the templates yet.

The velocity.properties is found when I manually unpack the war file, but 
not deploy as war. Is the velocity using the absolute path to the file to 
load it?


Magne



>I'm using Velocity and JBoss+Tomcat. The problem is that JBoss does not
>unpack the war file.
>My solution was that I now store my Velocity templates into a MySQL table
>and use DataSourceResourceLoader.
>In velocity.properties I have defined that templates are read from  data
>source.
>
>resource.loader = ds
>
>ds.resource.loader.public.name = DataSource
>ds.resource.loader.description = Velocity DataSource Resource Loader
>ds.resource.loader.class =
>org.apache.velocity.runtime.resource.loader.DataSourceResourceLoader
>ds.resource.loader.resource.datasource = java:/MySqlDS
>ds.resource.loader.resource.table = tb_velocity_template
>ds.resource.loader.resource.keycolumn = id
>ds.resource.loader.resource.templatecolumn = template_definition
>ds.resource.loader.resource.timestampcolumn = template_timestamp
>ds.resource.loader.cache = false
>ds.resource.loader.modificationCheckInterval = 60
>
>Hope this helps
>
>Harri
>
>
>----- Original Message -----
>From: "Magne Skjeret" <ma...@broadpark.no>
>To: "Velocity Users List" <ve...@jakarta.apache.org>
>Sent: Wednesday, September 10, 2003 11:25 AM
>Subject: RE: velocity.properties
>
>
> > At 11:32 10.09.2003 +0530, you wrote:
> > >Hi,
> > >
> > >         I think this is a setting in Velocity.properties.
> > >
> > >         Eventhough you have said that "it cant be a setting in
> > > velocity.properties",
> > >         I would like you to try the following as I had faced similar
> > > problem in one of
> > >my project and this was my solution.
> > >
> > >                 resource.loader = file
> > >                 file.resource.loader.path=<the full path> where the
> > > properties files is
> > >available.
> > >                 e.g., <full path> = D:/velocity/
> >
> > It just sounds strange to me that a setting in velocity.properties is
> > needed for the system to find velocity.properties.
> >
> > Magne
> >
> >
> >
> >
> >
> > >Thanks & Regards,
> > >Balasubramaniyan K
> > >Senior Software Engineer,
> > >Developer Platforms R&D,
> > >Developer Resources & Partner Enablement,
> > >ESG/SGBU/Adaptive Management,
> > >Hewlett Packard.
> > >
> > >Phone: 2051460 (Direct Line)
> > >
> > >
> > >-----Original Message-----
> > >From: Magne Skjeret [mailto:magne.skjeret@broadpark.no]
> > >Sent: Wednesday, September 10, 2003 11:25 AM
> > >To: Velocity Users List
> > >Subject: velocity.properties
> > >
> > >
> > >Hi
> > >
> > >I have been working with velocity for some months now, and it is just a
> > >beauty.
> > >It has actually lifted some weight of my shoulders, because now if is
> > >feasible for other people in the team, to change the html without
> > >knowing any java. So the request of type: 'pad the image 1px to the
> > >left' has stopped. 1 such request isnt much but when there are 50 it is
> > >just anoying.
> > >
> > >Well, enough sucking up.
> > >
> > >The real problem is that now when I have used it for some time, I have
> > >come to a prouction(?) state of my app. So I boldly deployed my war in
> > >jboss+tomcat. But it cant find the velocity.properties. It is placed at
> > >document root for that app. Standalone tomcat finds it. I have tried
> > >moving it around to classes and lib in WEB-INF updating the web.xml
> > >accordingly. But still no joy.
> > >
> > >I then unpacked the war by hand in the depkoy dir (no war), then it
> > >found it.
> > >Has anyone had similar problems? Am I doing something wrong? A setting
> > >in jboss. I am pretty sure it cant be a setting in velocity.properties
> > >:-)
> > >
> > >Keep up the jolly good work
> > >Magne
> > >
> > >
> > >
> > >---------------------------------------------------------------------
> > >To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> > >For additional commands, e-mail: velocity-user-help@jakarta.apache.org
> > >
> > >
> > >
> > >---------------------------------------------------------------------
> > >To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> > >For additional commands, e-mail: velocity-user-help@jakarta.apache.org
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: velocity-user-help@jakarta.apache.org
> >
> >
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: velocity.properties

Posted by Harri Lehtimaki <ha...@takioni.fi>.
Hi Nathan,
I didn't try WebAppLoader because I wanted to store the templates into a
database table. I use them as email templates and now I (or the admin users
of my web app) can easily edit them. So I really dont know if WebAppLoader
works with JBoss+Tomcat.

Harri

----- Original Message ----- 
From: "Nathan Bubna" <na...@esha.com>
To: "Velocity Users List" <ve...@jakarta.apache.org>
Sent: Wednesday, September 10, 2003 6:52 PM
Subject: Re: velocity.properties


> Harri Lehtimaki said:
> > I also have a VelocityViewServlet (which extends
> > org.apache.velocity.tools.view.servlet.VelocityViewServlet) defined in
the
> > web.xml like this
> ...
> > > I'm using Velocity and JBoss+Tomcat. The problem is that JBoss does
not
> > > unpack the war file.
> > > My solution was that I now store my Velocity templates into a MySQL
table
> > > and use DataSourceResourceLoader.
> > > In velocity.properties I have defined that templates are read from
data
> > > source.
> ...
>
> you're already using the VelocityViewServlet and that's good, but does the
> WebappLoader not work for you?  not that there's anything wrong with using
the
> DataSourceResourceLoader, i just want to know if there was a problem using
the
> WebappLoader with Jboss+Tomcat.  :)
>
> Nathan Bubna
> nathan@esha.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>
>



Re: velocity.properties

Posted by Nathan Bubna <na...@esha.com>.
Harri Lehtimaki said:
> I also have a VelocityViewServlet (which extends
> org.apache.velocity.tools.view.servlet.VelocityViewServlet) defined in the
> web.xml like this
...
> > I'm using Velocity and JBoss+Tomcat. The problem is that JBoss does not
> > unpack the war file.
> > My solution was that I now store my Velocity templates into a MySQL table
> > and use DataSourceResourceLoader.
> > In velocity.properties I have defined that templates are read from  data
> > source.
...

you're already using the VelocityViewServlet and that's good, but does the
WebappLoader not work for you?  not that there's anything wrong with using the
DataSourceResourceLoader, i just want to know if there was a problem using the
WebappLoader with Jboss+Tomcat.  :)

Nathan Bubna
nathan@esha.com


Re: velocity.properties

Posted by Harri Lehtimaki <ha...@takioni.fi>.
I also have a VelocityViewServlet (which extends
org.apache.velocity.tools.view.servlet.VelocityViewServlet) defined in the
web.xml like this

<servlet>
<servlet-name>velocity</servlet-name>
<display-name>Takioni Velocity View Servlet</display-name>
<servlet-class>com.takioni.intra.server.web.servlet.VelocityViewServlet</ser
vlet-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>10</load-on-startup>
</servlet>


----- Original Message ----- 
From: "Harri Lehtimaki" <ha...@takioni.fi>
To: "Velocity Users List" <ve...@jakarta.apache.org>
Sent: Wednesday, September 10, 2003 12:08 PM
Subject: Re: velocity.properties


> Magne,
> I'm using Velocity and JBoss+Tomcat. The problem is that JBoss does not
> unpack the war file.
> My solution was that I now store my Velocity templates into a MySQL table
> and use DataSourceResourceLoader.
> In velocity.properties I have defined that templates are read from  data
> source.
>
> resource.loader = ds
>
> ds.resource.loader.public.name = DataSource
> ds.resource.loader.description = Velocity DataSource Resource Loader
> ds.resource.loader.class =
> org.apache.velocity.runtime.resource.loader.DataSourceResourceLoader
> ds.resource.loader.resource.datasource = java:/MySqlDS
> ds.resource.loader.resource.table = tb_velocity_template
> ds.resource.loader.resource.keycolumn = id
> ds.resource.loader.resource.templatecolumn = template_definition
> ds.resource.loader.resource.timestampcolumn = template_timestamp
> ds.resource.loader.cache = false
> ds.resource.loader.modificationCheckInterval = 60
>
> Hope this helps
>
> Harri
>
>
> ----- Original Message ----- 
> From: "Magne Skjeret" <ma...@broadpark.no>
> To: "Velocity Users List" <ve...@jakarta.apache.org>
> Sent: Wednesday, September 10, 2003 11:25 AM
> Subject: RE: velocity.properties
>
>
> > At 11:32 10.09.2003 +0530, you wrote:
> > >Hi,
> > >
> > >         I think this is a setting in Velocity.properties.
> > >
> > >         Eventhough you have said that "it cant be a setting in
> > > velocity.properties",
> > >         I would like you to try the following as I had faced similar
> > > problem in one of
> > >my project and this was my solution.
> > >
> > >                 resource.loader = file
> > >                 file.resource.loader.path=<the full path> where the
> > > properties files is
> > >available.
> > >                 e.g., <full path> = D:/velocity/
> >
> > It just sounds strange to me that a setting in velocity.properties is
> > needed for the system to find velocity.properties.
> >
> > Magne
> >
> >
> >
> >
> >
> > >Thanks & Regards,
> > >Balasubramaniyan K
> > >Senior Software Engineer,
> > >Developer Platforms R&D,
> > >Developer Resources & Partner Enablement,
> > >ESG/SGBU/Adaptive Management,
> > >Hewlett Packard.
> > >
> > >Phone: 2051460 (Direct Line)
> > >
> > >
> > >-----Original Message-----
> > >From: Magne Skjeret [mailto:magne.skjeret@broadpark.no]
> > >Sent: Wednesday, September 10, 2003 11:25 AM
> > >To: Velocity Users List
> > >Subject: velocity.properties
> > >
> > >
> > >Hi
> > >
> > >I have been working with velocity for some months now, and it is just a
> > >beauty.
> > >It has actually lifted some weight of my shoulders, because now if is
> > >feasible for other people in the team, to change the html without
> > >knowing any java. So the request of type: 'pad the image 1px to the
> > >left' has stopped. 1 such request isnt much but when there are 50 it is
> > >just anoying.
> > >
> > >Well, enough sucking up.
> > >
> > >The real problem is that now when I have used it for some time, I have
> > >come to a prouction(?) state of my app. So I boldly deployed my war in
> > >jboss+tomcat. But it cant find the velocity.properties. It is placed at
> > >document root for that app. Standalone tomcat finds it. I have tried
> > >moving it around to classes and lib in WEB-INF updating the web.xml
> > >accordingly. But still no joy.
> > >
> > >I then unpacked the war by hand in the depkoy dir (no war), then it
> > >found it.
> > >Has anyone had similar problems? Am I doing something wrong? A setting
> > >in jboss. I am pretty sure it cant be a setting in velocity.properties
> > >:-)
> > >
> > >Keep up the jolly good work
> > >Magne
> > >
> > >
> > >
> > >---------------------------------------------------------------------
> > >To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> > >For additional commands, e-mail: velocity-user-help@jakarta.apache.org
> > >
> > >
> > >
> > >---------------------------------------------------------------------
> > >To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> > >For additional commands, e-mail: velocity-user-help@jakarta.apache.org
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: velocity-user-help@jakarta.apache.org
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>



Re: velocity.properties

Posted by Harri Lehtimaki <ha...@takioni.fi>.
Magne,
I'm using Velocity and JBoss+Tomcat. The problem is that JBoss does not
unpack the war file.
My solution was that I now store my Velocity templates into a MySQL table
and use DataSourceResourceLoader.
In velocity.properties I have defined that templates are read from  data
source.

resource.loader = ds

ds.resource.loader.public.name = DataSource
ds.resource.loader.description = Velocity DataSource Resource Loader
ds.resource.loader.class =
org.apache.velocity.runtime.resource.loader.DataSourceResourceLoader
ds.resource.loader.resource.datasource = java:/MySqlDS
ds.resource.loader.resource.table = tb_velocity_template
ds.resource.loader.resource.keycolumn = id
ds.resource.loader.resource.templatecolumn = template_definition
ds.resource.loader.resource.timestampcolumn = template_timestamp
ds.resource.loader.cache = false
ds.resource.loader.modificationCheckInterval = 60

Hope this helps

Harri


----- Original Message ----- 
From: "Magne Skjeret" <ma...@broadpark.no>
To: "Velocity Users List" <ve...@jakarta.apache.org>
Sent: Wednesday, September 10, 2003 11:25 AM
Subject: RE: velocity.properties


> At 11:32 10.09.2003 +0530, you wrote:
> >Hi,
> >
> >         I think this is a setting in Velocity.properties.
> >
> >         Eventhough you have said that "it cant be a setting in
> > velocity.properties",
> >         I would like you to try the following as I had faced similar
> > problem in one of
> >my project and this was my solution.
> >
> >                 resource.loader = file
> >                 file.resource.loader.path=<the full path> where the
> > properties files is
> >available.
> >                 e.g., <full path> = D:/velocity/
>
> It just sounds strange to me that a setting in velocity.properties is
> needed for the system to find velocity.properties.
>
> Magne
>
>
>
>
>
> >Thanks & Regards,
> >Balasubramaniyan K
> >Senior Software Engineer,
> >Developer Platforms R&D,
> >Developer Resources & Partner Enablement,
> >ESG/SGBU/Adaptive Management,
> >Hewlett Packard.
> >
> >Phone: 2051460 (Direct Line)
> >
> >
> >-----Original Message-----
> >From: Magne Skjeret [mailto:magne.skjeret@broadpark.no]
> >Sent: Wednesday, September 10, 2003 11:25 AM
> >To: Velocity Users List
> >Subject: velocity.properties
> >
> >
> >Hi
> >
> >I have been working with velocity for some months now, and it is just a
> >beauty.
> >It has actually lifted some weight of my shoulders, because now if is
> >feasible for other people in the team, to change the html without
> >knowing any java. So the request of type: 'pad the image 1px to the
> >left' has stopped. 1 such request isnt much but when there are 50 it is
> >just anoying.
> >
> >Well, enough sucking up.
> >
> >The real problem is that now when I have used it for some time, I have
> >come to a prouction(?) state of my app. So I boldly deployed my war in
> >jboss+tomcat. But it cant find the velocity.properties. It is placed at
> >document root for that app. Standalone tomcat finds it. I have tried
> >moving it around to classes and lib in WEB-INF updating the web.xml
> >accordingly. But still no joy.
> >
> >I then unpacked the war by hand in the depkoy dir (no war), then it
> >found it.
> >Has anyone had similar problems? Am I doing something wrong? A setting
> >in jboss. I am pretty sure it cant be a setting in velocity.properties
> >:-)
> >
> >Keep up the jolly good work
> >Magne
> >
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: velocity-user-help@jakarta.apache.org
> >
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>



RE: velocity.properties

Posted by Magne Skjeret <ma...@broadpark.no>.
At 11:32 10.09.2003 +0530, you wrote:
>Hi,
>
>         I think this is a setting in Velocity.properties.
>
>         Eventhough you have said that "it cant be a setting in 
> velocity.properties",
>         I would like you to try the following as I had faced similar 
> problem in one of
>my project and this was my solution.
>
>                 resource.loader = file
>                 file.resource.loader.path=<the full path> where the 
> properties files is
>available.
>                 e.g., <full path> = D:/velocity/

It just sounds strange to me that a setting in velocity.properties is 
needed for the system to find velocity.properties.

Magne





>Thanks & Regards,
>Balasubramaniyan K
>Senior Software Engineer,
>Developer Platforms R&D,
>Developer Resources & Partner Enablement,
>ESG/SGBU/Adaptive Management,
>Hewlett Packard.
>
>Phone: 2051460 (Direct Line)
>
>
>-----Original Message-----
>From: Magne Skjeret [mailto:magne.skjeret@broadpark.no]
>Sent: Wednesday, September 10, 2003 11:25 AM
>To: Velocity Users List
>Subject: velocity.properties
>
>
>Hi
>
>I have been working with velocity for some months now, and it is just a
>beauty.
>It has actually lifted some weight of my shoulders, because now if is
>feasible for other people in the team, to change the html without
>knowing any java. So the request of type: 'pad the image 1px to the
>left' has stopped. 1 such request isnt much but when there are 50 it is
>just anoying.
>
>Well, enough sucking up.
>
>The real problem is that now when I have used it for some time, I have
>come to a prouction(?) state of my app. So I boldly deployed my war in
>jboss+tomcat. But it cant find the velocity.properties. It is placed at
>document root for that app. Standalone tomcat finds it. I have tried
>moving it around to classes and lib in WEB-INF updating the web.xml
>accordingly. But still no joy.
>
>I then unpacked the war by hand in the depkoy dir (no war), then it
>found it.
>Has anyone had similar problems? Am I doing something wrong? A setting
>in jboss. I am pretty sure it cant be a setting in velocity.properties
>:-)
>
>Keep up the jolly good work
>Magne
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: velocity-user-help@jakarta.apache.org


RE: velocity.properties

Posted by Balasubramaniyan K <ba...@india.hp.com>.
Hi,

	I think this is a setting in Velocity.properties.

	Eventhough you have said that "it cant be a setting in velocity.properties",
	I would like you to try the following as I had faced similar problem in one of
my project and this was my solution.

		resource.loader = file
		file.resource.loader.path=<the full path> where the properties files is
available.
		e.g., <full path> = D:/velocity/



Thanks & Regards,
Balasubramaniyan K
Senior Software Engineer,
Developer Platforms R&D,
Developer Resources & Partner Enablement,
ESG/SGBU/Adaptive Management,
Hewlett Packard.

Phone: 2051460 (Direct Line)


-----Original Message-----
From: Magne Skjeret [mailto:magne.skjeret@broadpark.no]
Sent: Wednesday, September 10, 2003 11:25 AM
To: Velocity Users List
Subject: velocity.properties


Hi

I have been working with velocity for some months now, and it is just a
beauty.
It has actually lifted some weight of my shoulders, because now if is
feasible for other people in the team, to change the html without
knowing any java. So the request of type: 'pad the image 1px to the
left' has stopped. 1 such request isnt much but when there are 50 it is
just anoying.

Well, enough sucking up.

The real problem is that now when I have used it for some time, I have
come to a prouction(?) state of my app. So I boldly deployed my war in
jboss+tomcat. But it cant find the velocity.properties. It is placed at
document root for that app. Standalone tomcat finds it. I have tried
moving it around to classes and lib in WEB-INF updating the web.xml
accordingly. But still no joy.

I then unpacked the war by hand in the depkoy dir (no war), then it
found it.
Has anyone had similar problems? Am I doing something wrong? A setting
in jboss. I am pretty sure it cant be a setting in velocity.properties
:-)

Keep up the jolly good work
Magne



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