tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pid <...@pidster.com>
Subject Re: automatic deployment without server.xml - bad request
Date Thu, 02 Dec 2010 19:40:51 GMT
On 12/2/10 12:23 PM, Justin Case wrote:
>> From: Pid <pid@pidster.com>
>> This is either because your  application is not deployed, or because the
>> request path you're using does  not match the actual request path deployed.
>>
>> When you start Tomcat, is  there a message in the logs saying:
>>
>> 02-Dec-2010 10:44:17  org.apache.catalina.startup.HostConfig deployDirectory
>> INFO: Deploying web  application directory com.mycompany.myapp
>> OR
>> 02-Dec-2010  10:44:17 org.apache.catalina.startup.HostConfig deployDirectory
>> INFO:  Deploying web application directory myapp
>> ?
>> What is the  exact URL (you may omit the actual domain if you wish) that
>> you then  request?
> 
> Hmmm, it says "Deploying web  application directory com.mycompany.myapp" which 
> is somehow what I was expecting (it IS in that directory under wtpwebapps), then 
> I'm calling it with http://localhost:8080/myapp (I need it that way)

The app is under /com.mycompany.myapp not /myapp.

That's the problem, Tomcat is then trying to find an app to serve that
URL, can't so sends 400.

> Now that you mention, I notice this difference: 
> - when I put it in the server.xml and it gets deployed automatically, Tomcat 
> creates under "work/Catalina/localhost" the directory myapp. All fine. 

Because you can specify the path in server.xml.

Otherwise it's dependant on the app directory/war file name, unless you
do some trickery with the conf/Catalina/localhost/myapp.xml file.

 
> - when I use the standalone context.xml it creates under 
> "work/Catalina/localhost" a directory com.mycompany.myapp - which stays empty 
> afterwards.
> I still don't know what and why it happens, but I feel it's getting closer to 
> the root cause :)

Easy solution: rename the dir from "com.mycompany.myapp" to "myapp".
WAR files are not packages, give them a sensible name.


p

Mime
View raw message