tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <ma...@apache.org>
Subject Re: Error deploying web application
Date Tue, 25 Jun 2013 14:32:21 GMT
On 25/06/2013 15:01, Nickalaus A Painter wrote:
> Thank you very much for your quick response!  Here are the previous error 
> messages:

It would have been helpful to include all the error messages the first
time around. I then wouldn't have had to waste time working through the
code checking that there should have been an error message and telling
you what to look for.

Unless you are absolutely sure the errors are for an unrelated problem
then don't exclude what could be useful information.

> INFO: Deploying configuration descriptor 
> /usr/local/tomcat/apache-tomcat-7.0.37/conf/Catalina/localhost/MyApp.xml
> Jun 25, 2013 9:49:53 AM org.apache.catalina.startup.HostConfig 
> deployDescriptor
> SEVERE: Error deploying configuration descriptor 
> /usr/local/tomcat/apache-tomcat-7.0.37/conf/Catalina/localhost/MyApp.xml

So there is a pretty big hint that there is something wrong with MyApp.xml

> java.lang.NullPointerException
>         at 
> org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:625)

Hmm. Odd. That means the digester parsed the file without error but
failed to create a Context instance.

> INFO: Deploying configuration descriptor 
> /usr/local/tomcat/apache-tomcat-7.0.37/conf/Catalina/localhost/host-manager.xml

Another app starts without issue.

> Jun 25, 2013 9:49:53 AM org.apache.catalina.startup.HostConfig 
> deployDescriptors
> SEVERE: Error waiting for multi-thread deployment of context descriptors 
> to complete

More fall-out from the original error.

> INFO: Deploying configuration descriptor 
> /usr/local/tomcat/apache-tomcat-7.0.37/conf/Catalina/localhost/manager.xml

Another app starting normally.

> Jun 25, 2013 9:49:53 AM org.apache.catalina.startup.HostConfig deployWAR
> INFO: Deploying web application archive 
> /usr/local/tomcat/apache-tomcat-7.0.37/webapps/MyApp.war
> Jun 25, 2013 9:49:53 AM org.apache.tomcat.util.digester.Digester 
> endElement
> WARNING:   No rules found matching 'application/Context/Resource'.
> Jun 25, 2013 9:49:53 AM org.apache.tomcat.util.digester.Digester 
> endElement
> WARNING:   No rules found matching 'application/Context'.
> Jun 25, 2013 9:49:53 AM org.apache.tomcat.util.digester.Digester 
> endElement
> WARNING:   No rules found matching 'application'.
> Jun 25, 2013 9:49:53 AM org.apache.catalina.core.ContainerBase 
> addChildInternal

OK. That isn't good. That indicates the context.xml file is very wrong
along with some hints as to what the problem is.

> So does this mean that I have to reconfigure MyApp.xml in that directory? 

No.

> Shouldn't Tomcat look in the directory of MyApp once it explodes the .war 
> file?

Also no.

>  Also, for completeness, here is MyApp.xml:

And there we have the problem.
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE Context>
> <application xmlns="http://java.sun.com/xml/ns/j2ee"
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>     xsi:schemaLocation="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd 
> http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd"
>     version="2.5">

WTF? Where does it suggest that this is valid for a context.xml file?

This is a context.xml file, not a web.xml file. This application element
(and the matching closing element) needs to be deleted.

> <!-- Only one of these "Resource name" blocks may be uncommented at a 
> single time.
>       Altering the commented value will force the system to use that 
> back-end JDBC driver,
>       and thus impacts which database instance you will connect to.
> -->
> 
> <Context path="/MyApp" docBase="MyApp" debug="5" reloadable="true" 
> crossContext="true">

Have you even read the documentation for Context elements?

path - not permitted in this use case
docBase - not permitted in this use case
debug - remove several versions ago and deprecated even longer ago

The remaining elements are valid but I have to wonder if they are
necessary / correct in your environment.

>           <Resource name="jdbc/dbconn" auth="Container"
>                   type="javax.sql.DataSource" 
> driverClassName="com.mysql.jdbc.Driver"
>                   url="jdbc:mysql://localhost:3306/mydatabase"
>                   username="root" password="root" maxActive="50" 
> maxIdle="15" maxWait="-1"/>

I really, really hope those aren't the real values. You should never
connect to a database as root, even for development.

> </Context>
> </application>
> 
> Do you need anything else?

Nope.

Mark


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message