tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Case <>
Subject automatic deployment without server.xml - bad request
Date Wed, 01 Dec 2010 14:22:01 GMT
Hello all,

I'm on Tomcat 6.0.29 in Windows (XP or server 2003, same) and I'm trying to get 
an application to deploy automatically without putting it in server.xml - as the 
documentation strongly recommends. 

Just to note, if I put the context setting in server.xml like this all works 

            <Host appBase="wtpwebapps" autoDeploy="false" 
                name="localhost" unpackWARs="true" xmlNamespaceAware="false"
                <Valve className="org.apache.catalina.valves.AccessLogValve"
                    directory="logs" pattern="common" prefix="access_log."
                    resolveHosts="false" suffix=".txt" />
                <Context docBase="com.mycompany.myapp" path="/myapp"
                    reloadable="true" override="true">
                    <Manager pathname="" />
                    <Resource name="hibernate/MySessionFactory" auth="Container"
                        configuration="hibernate.cfg.xml" />

If I remove the context from server.xml and place a context.xml in my app's 
META-INF, then enable the two deploy params, the deployment happens succesfully 
- that's what the console says at least. The application even starts ok, I can 
see the logging of my classes.
Each request to the application will throw immediately a HTTP error 400 - bad 
request. Funny enough, this error will not even be logged anywhere, even when I 
enabled debug logging in Tomcat! (and got 100M of logs which I searched 
through). No record of the 400 whatsoever, while I can confirm the Host header 
IS there - I see it in Firebug (and with the other context it works anyway).

What I see different is that the Tomcat's work directory, the 
work/Catalina/localhost/com.mycomp.myapp directory it created automatically at 
startup is and stays EMPTY. Now normally there should be the compiled JSP's 
right? So there's SOMETHING not ok about this automatic deployment, and I'm 
unable to figure out what it is. There was in May an interesting discussion 
thread on this list called "Misunderstanding deployOnStartup actions", but that 
guy also ended up using server.xml so... I only see advice like "your config is 
wrong to start with", which might be very true (otherwise one wouldn't be 
posting), but I wasn't able to see anywhere sampled a CORRECT config.

Thanks A LOT for any hints/samples/links,


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message