Google
Google
Mailing List
Home
Forum Home
JBoss - Java Application Server
Tomcat - JSP/Servlet container
Struts - A MVC web framework
iText - An open source PDF Java Library
JDOM - JDOM XML Parser
JSP - A mailing list about Java Server Pages specification and reference
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog
Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology
Struts & Hibernate
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Servlet : Session invalidate
Oracle Connection Pooling in 3 2 2
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Running a Simple JMS Example
Tomcat and webapplication specific java library path
Mapping in workers2 properties
org apache jasper JasperException
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action
   MESSAGE
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
Value attribute of <html:checkbox
url string for connecting jboss to oracle
javax servlet ServletException: BeanUtils populate
5 0 18: Windows XP Pro vs Windows 2000
HTTP Status 404 The requested resource is not available
 
-none-

-none-

2007-10-04       - By Mateusz Kijowski

 Back
Howdy list,


I've been messing with our site's tomcat installation (we are running 5.5.17
with BEA's 1.5.0_06-b05 JRockit JVM on 2.6 Linux) recently and wanted to
change our deployment process to use the manager application to upload and
deploy WAR files. Right now we copy the webapp tree to the right place in the
filesystem and reload the webapp via the manager interface. After some
testing we found out that deploying our main production WAR doesn't seem to
work. The error message we are getting is:


org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of
class '' for connect URL 'null'


After some googling we've come into conclusion that the resource descriptor
defined in the webapp's context.xml (located in
war_root/META-INF/context.xml) isn't read/initialised properly and the the
resource-ref defined in web.xml tries to connect to a resource with default,
null/empty values (does it seem correct?).

Well, that's where the magic starts. After some debugging we found out that it
does work *sometimes*. No error messages, and everything works as supposed.
The breakage seems random, not depending on any changes on our side.

The configuration layout we are using right now without any problems is almost
identical as the one in WAR files (the only difference being additional
resource-ref in web.xml). The I've been lurking this list for quite a while,
but I haven't seen anyone describe the problem I am experiecning.

The webapp archive is quite(?) big, weighing ~60 MB. One of the explanation we
are considering is that tomcat starts deploying the webapp before it is fully
uploaded/unpacked. Is that possible.

Below are relevant config files.

WAR_ROOT/META-INF/context.xml:

<Context debug="0" reloadable="false" crossContext="false">
       <Resource name="jdbc/qs"
               auth="Container"
               type="javax.sql.DataSource"
               factory="org.apache.commons.dbcp.BasicDataSourceFactory"
               driverClassName="org.postgresql.Driver"
               url="jdbc:postgresql://the_host:5432/qs"
               validationQuery="SELECT 1"
               loginTimeout="10"
               username="the_username"
               password="the_secret"
               initialSize="20"
               maxActive="70"
               minIdle="20"
               maxIdle="50"
               maxWait="-1"
               testWhileIdle="true"
               testOnBorrow="false"
               removeAbandoned="true"
               removeAbandonedTimeout="100"
               logAbandoned="true"
               timeBetweenEvictionRunsMillis="60000"
               minEvictableIdleTimeMillis="120000"/>
       <Resource name="jdbc/sof"
               auth="Container"
               type="javax.sql.DataSource"
               factory="org.apache.commons.dbcp.BasicDataSourceFactory"
               driverClassName="com.mysql.jdbc.Driver"
               url="jdbc:mysql://the_host/sof?characterEncoding=UTF-8 (See http://UTF-8.ora-code.com)"
               validationQuery="SELECT 1"
               loginTimeout="10"
               username="the_username"
               password="the_secret"
               initialSize="30"
               maxActive="100"
               minIdle="30"
               maxIdle="60"
               maxWait="-1"
               testWhileIdle="true"
               testOnBorrow="false"
               removeAbandoned="true"
               removeAbandonedTimeout="300"
               logAbandoned="true"
               timeBetweenEvictionRunsMillis="60000"
               minEvictableIdleTimeMillis="120000"/>
</Context>

WAR_ROOT/WEB-INF/web.xml:

       [snip]
       <resource-ref>
               <description>postgreSQL Datasource example</description>
               <res-ref-name>jdbc/qs</res-ref-name>
               <res-type>javax.sql.DataSource</res-type>
               <res-auth>Container</res-auth>
       </resource-ref>
       <resource-ref>
               <description>postgreSQL Datasource example</description>
               <res-ref-name>jdbc/sof</res-ref-name>
               <res-type>javax.sql.DataSource</res-type>
               <res-auth>Container</res-auth>
       </resource-ref>
  [snip]

CATALINA_HOME/conf/server.xml:

  [snip]
  <Host name="the_hostname" appBase="vhosts/program"
    unpackWARs="true" autoDeploy="false"
    xmlValidation="false" xmlNamespaceAware="false">

  [...some valves, aliases, doesn't seem relevent...]

  </Host>
  [snip]

The version working right now properly doesn't have the second resource-ref
(the webapp manages to use the jdbc/sof resource anyway), but some another
error message ("javax.naming.NameNotFoundException: Name sof is not bound in
this Context") made us put it in web.xml in the WAR file.

Does anyone have a clue what might be wrong with our setup?

I will happily provide more detailed logs and/or configuration files if
needed.

Regards,


Mateusz Kijowski