That's pretty strange. You are aware that the same configuration must be
shared by all servlets since they use the Velocity singleton, right?
You might try the VelocityViewServlet from the Velocity Tools subproject.
We're deprecating VelocityServlet in the next release. Among other benefits
of VelocityViewServlet is that it uses distinct instances of VelocityEngine.
So if you had multiple servlets you could have multiple configurations.
(not sure if that is better or worse in your situation).
WILL
----- Original Message -----
From: "Mark Smith" <[EMAIL PROTECTED]>
To: <velocity-user@jakarta.apache.org>
Sent: Friday, January 20, 2006 4:46 PM
Subject: too many servlets makes Velocity unhappy?
I have a bizarre problem using Velocity 1.4 in a Tomcat 5.0 webapp.
My web.xml has a bunch of <servlet-mapping> elements mapping Foo.vm URLs
to FooServlet controllers (subclasses of VelocityServlet). In my
InitServlet that's loaded on startup, I override loadConfiguration () to
set the value of the file.resource.loader.path property to point to the
directory containing my *.vm templates files. This has all been working
fine for over a year.
Now I'm finding that if I have more than 43 <servlet-mapping> elements in
web.xml, Velocity can't find its templates. I get the usual
can't-find-the-resource exception:
ResourceNotFoundException: Unable to find resource 'Foo.vm'.
I've verified that loadConfiguration() is still getting called and still
setting the loader path property correctly. If I comment out the 44th
<servlet-mapping> element in web.xml, it all works again. It doesn't
matter which one I comment out, it only seems to care about the total
number. I'm seeing the problem on Linux and on OS X.
I have another webapp in the same Tomcat instance with over 50
<servlet-mapping> elements in its web.xml and it works fine.
This has me totally stumped. Can anybody shed some light on it?
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]