Steffen,

As soon as I start using 2 coyote connectors together with <load-on-startup>
tomcat initializes the database pools twice.
Interestingly it keeps initializing things twice even if I add a third
coyote.

In about two minutes, Yoav Shapira is going to tell you this:


"Don't use a servlet to initialize your stuff. Instead, use a ContextListener. IT's cleaner, more flexible, and only gets loaded when it should get loaded."

I used to have InitServlet-style initialization, but now I use ContextListeners.

They're pretty easy: create a new class that implements javax.servlet.ServletContextListener.

Once you move your code from your old InitServlet, you have to install it into the web.xml file like this:

    <listener>
        <listener-class>fully.qualified.InitListener</listener-class>
    </listener>

Put this section right before any <servlet> definitions but after any <filter> and <filter-mapping> sections you have.

-chris


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to