You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by Alejandro Reyero <ar...@e-netfinger.com> on 2001/03/20 18:50:23 UTC

Velocity and Iplanet Web Server

Hi all.

I'm trying to configure velocity to work with Iplanet Web Server 4.1 SP6
(NES with new name ;-) ), but i have a serious problem with the properties
file: I don't know how to set my IWS to get that properties file, and it
doesn't seem to work with init(...) (maybe i'm doing it in the wrong way, i
do:  Velocity.init("/export/home/ifema/velocity.properties"); ).

I always get this with my servlets:

VelocityServlet : Error processing the template
java.lang.Exception: Cannot find the template!
java.lang.Exception: Cannot find the template! at
java.lang.Throwable.fillInStackTrace(Native Method) at
java.lang.Throwable.fillInStackTrace(Compiled Code) at
java.lang.Throwable.(Compiled Code) at java.lang.Exception.(Compiled Code)
at
org.apache.velocity.servlet.VelocityServlet.doRequest(VelocityServlet.java:3
32) at
org.apache.velocity.servlet.VelocityServlet.doGet(VelocityServlet.java:285)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:701) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:826) at
com.netscape.server.http.servlet.NSServletRunner.Service(NSServletRunner.jav
a:504)


In the "documentation" of velocity you can find how to configure it to work
with Apache, but there is nothing about other servers. Isn't it intended to
work with other servers ???

Thanks in advance.
Alejandro.


Re: Velocity and Iplanet Web Server

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
Alejandro Reyero wrote:
> 
> > First, can you turn of what I assume is JIT to get a better stack trace?
> >
> I use JDK 1.2.2 as Java "compiler" for my IWS, so i assume there is no JIT.

Hm.  do you have an environment variable JAVA_COMPILER set?  I am going
to offer a solution, but I am still worried about the ugly stack trace
you are seeing.

> > Second, where are you doing the init(file)?  There is an init() in the
> > VelocityServlet base class, so any follwing inits don't do anything....
> >
> I'm doing it at my servlet (just SampleServlet with few modifications).
> 
> > Have you overridden the servlets init()?
> >
> Nope...

Ok - that's related to the issue - the VelocityServlet init(
ServletConfig ) (base class of SampleServlet) will call Velocity's
init(), so your call to Velocity's init() does nothing.

Add the following method :

    protected Properties loadConfiguration(ServletConfig config )
        throws IOException, FileNotFoundException
    {
        Properties p = new Properties();
        
	p.setProperty( "file.resource.loader.path",
"/export/home/ifema/velocity.properties");
	p.setProperty( "runtime.log", "/export/home/ifema/velocity.log");

        return p;
    }

And see what happens.  You should get a log file in the same place as
your properties file.  We need to know what that says if the problem
persists.

> In resume, what i need to know is how to configure Velocity to work with
> NES/IWS or how to say "My templates are HERE", where HERE is the directory,
> from my servlets...
> 

I know nothing about how to properly configure the Nintendo ;)  but lets
see if we can get the thing working this way - after that, there will be
a better way than this hardcoding...

geir

-- 
Geir Magnusson Jr.                               geirm@optonline.net
Developing for the web?  See http://jakarta.apache.org/velocity/

RE: Velocity and Iplanet Web Server

Posted by Alejandro Reyero <ar...@e-netfinger.com>.
>
> NES == Nintendo Entertainment System ? ;)
>
Hehehhee yep, i know i should migrate to PlayStation 2 but no $$$$$ ;-)

> First, can you turn of what I assume is JIT to get a better stack trace?
>
I use JDK 1.2.2 as Java "compiler" for my IWS, so i assume there is no JIT.

> Second, where are you doing the init(file)?  There is an init() in the
> VelocityServlet base class, so any follwing inits don't do anything....
>
I'm doing it at my servlet (just SampleServlet with few modifications).

> Have you overridden the servlets init()?
>
Nope...

> Of course.  Tomcat is just closest to home, and the one you *should* be
> using :)

I wish... I have Apache + Tomcat working for another site (more than 100000
hits daily) but for this project i have to use just Solaris + NES/IWS...

In resume, what i need to know is how to configure Velocity to work with
NES/IWS or how to say "My templates are HERE", where HERE is the directory,
from my servlets...

Thanks in advance :-)

Alejandro.


Re: Velocity and Iplanet Web Server

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
Alejandro Reyero wrote:
> 
> Hi all.
> 
> I'm trying to configure velocity to work with Iplanet Web Server 4.1 SP6
> (NES with new name ;-) ), but i have a serious problem with the properties

NES == Nintendo Entertainment System ? ;)

> file: I don't know how to set my IWS to get that properties file, and it
> doesn't seem to work with init(...) (maybe i'm doing it in the wrong way, i
> do:  Velocity.init("/export/home/ifema/velocity.properties"); ).
> 
> I always get this with my servlets:
> 
> VelocityServlet : Error processing the template
> java.lang.Exception: Cannot find the template!
> java.lang.Exception: Cannot find the template! at
> java.lang.Throwable.fillInStackTrace(Native Method) at
> java.lang.Throwable.fillInStackTrace(Compiled Code) at
> java.lang.Throwable.(Compiled Code) at java.lang.Exception.(Compiled Code)
> at
> org.apache.velocity.servlet.VelocityServlet.doRequest(VelocityServlet.java:3
> 32) at
> org.apache.velocity.servlet.VelocityServlet.doGet(VelocityServlet.java:285)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:701) at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:826) at
> com.netscape.server.http.servlet.NSServletRunner.Service(NSServletRunner.jav
> a:504)
> 

First, can you turn of what I assume is JIT to get a better stack trace?

Second, where are you doing the init(file)?  There is an init() in the
VelocityServlet base class, so any follwing inits don't do anything....

Have you overridden the servlets init()?

> In the "documentation" of velocity you can find how to configure it to work
> with Apache, but there is nothing about other servers. Isn't it intended to
> work with other servers ???

Of course.  Tomcat is just closest to home, and the one you *should* be
using :)

geir

-- 
Geir Magnusson Jr.                               geirm@optonline.net
Developing for the web?  See http://jakarta.apache.org/velocity/

Re: commit freeze!

Posted by Jon Stevens <jo...@latchkey.com>.
on 3/20/01 7:40 PM, "Jon Stevens" <jo...@latchkey.com> wrote:

> hey all,
> 
> i'm going to tag cvs as V_1_0_b_1
> 
> please don't commit anything until i give the ok.
> 
> -jon
> 

ok, i made it V_1_0B1

I'm uploading the release files right now. should be done in about 10
minutes.

-jon


commit freeze!

Posted by Jon Stevens <jo...@latchkey.com>.
hey all,

i'm going to tag cvs as V_1_0_b_1

please don't commit anything until i give the ok.

-jon