| Author |
ContextListener starting twice
|
Allen Williams
Ranch Hand
Joined: Sep 04, 2006
Posts: 136
|
|
I have a very simple context listener that just sets a context variable at initialization. The action is here: Note the "log.write" at the very end. In addition, the dbUtils constructor has a print statement. Here is the deployment descriptor from the web.xml (and I did a search to make sure it is the only one): When this listener is run at initialization, here is what I get in the log file:
SEVERE: No Store configured, persistence disabled ************ dbConPoolListener::ContextInitialized Jun 23 16:40:45: Got db name: infoisland Initializing dbUtils with sc; sc, ds= org.apache.catalina.core.ApplicationContextFacade@ed662d null Jun 23 16:40:45: dbUtils::initPool Jun 23 16:40:45: dbConPoolListener::Seems to have run OK ****************** Jun 23, 2007 4:40:45 PM org.apache.catalina.session.PersistentManagerBase start SEVERE: No Store configured, persistence disabled ************ dbConPoolListener::ContextInitialized Jun 23 16:40:45: Got db name: infoisland Initializing dbUtils with sc; sc, ds= org.apache.catalina.core.ApplicationContextFacade@b122a1 null Jun 23 16:40:45: dbUtils::initPool Jun 23 16:40:45: dbConPoolListener::Seems to have run OK ******************* Jun 23, 2007 4:40:46 PM org.apache.coyote.http11.Http11BaseProtocol start
In other words, it looks like it is running twice. Any ideas why this would be? In my server.xml, I do have two Contexts with the same docbase. Is that what's causing this? TIA, anw
|
-------<br />Thanks & regards,<br />anw
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56185
|
|
|
Well, yeah. Two contexts means two web apps.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
|
|
|
A typical cause for this is an app that is both configured in either server.xml or with a context fragment; and that is located in the tomcat/webapps directory (where it will be auto deployed).
|
Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
|
 |
 |
|
|
subject: ContextListener starting twice
|
|
|