You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Koes, Derrick" <De...@smith-nephew.com> on 2003/08/29 17:04:56 UTC

Tomcat startup with JDBC Realm

I have a timing issue where both my database and tomcat are being run as
Windows services.  If my server reboots for some reason, even though I have
startup dependencies (tomcat depends on db), tomcat often doesn't start my
web app because it failed the initial JDBC check it does for a database when
there is a JDBC realm configured.  I presume this is because Windows reports
the db service as started so the tomcat service attempts to start.  However,
the db isn't fully up when the service is "started".
 
Have others witnessed this issue?  Workarounds?
 
 
Thanks,
Derrick
 
 
 
 
This electronic transmission is strictly confidential to Smith & Nephew and
intended solely for the addressee.  It may contain information which is
covered by legal, professional or other privilege.  If you are not the
intended addressee, or someone authorized by the intended addressee to
receive transmissions on behalf of the addressee, you must not retain,
disclose in any form, copy or take any action in reliance on this
transmission.  If you have received this transmission in error, please
notify the sender as soon as possible and destroy this message.

Re: Tomcat startup with JDBC Realm

Posted by Tim Funk <fu...@joedog.org>.
I have committed a patch for tomcat 5 that fixes this. It is available with 
HEAD or tomcat 5.0.10 (which doesn't exist yet).

If people test can test 5 and it is OK - I can back port it to tomcat 4.1.X.

If your impatient, the code for JDBCRealm from 5 would be the same as 4.1 so 
you can:
- Get the version from 5 
(http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/realm/JDBCRealm.java?rev=1.2&content-type=text/vnd.viewcvs-markup)
- Compile it with $CATALINA_HOME/server/lib/*.jar and 
$CATALINA_HOME/common/lib/*.jar in your classpath
- Place the resulting class file as 
$CATALINA_HOME/server/classes/org/apache/catalina/realm/JDBCRealm.class
- Last but not least ... Hope that the above works (It should)

-Tim

Koes, Derrick wrote:

> I have a timing issue where both my database and tomcat are being run as
> Windows services.  If my server reboots for some reason, even though I have
> startup dependencies (tomcat depends on db), tomcat often doesn't start my
> web app because it failed the initial JDBC check it does for a database when
> there is a JDBC realm configured.  I presume this is because Windows reports
> the db service as started so the tomcat service attempts to start.  However,
> the db isn't fully up when the service is "started".
>  
> Have others witnessed this issue?  Workarounds?
>  
>  
> Thanks,
> Derrick
>  
>