Re: Tomcat9 silently ignores web application

2023-07-08 Thread Graham Leggett
On 08 Jul 2023, at 11:20, Graham Leggett  wrote:

> In summary, the client hits tomcat, tomcat returns 404 on the request, and 
> there is no trace in the access logfile that the client was ever there.

I've traced it to one level up - there is an httpd above this that was routing 
requests destined to this application to a second independent tomcat running on 
the same machine. This second tomcat was (correctly) returning 404.

When the logfile says no hits coming in, it means the hits are going somewhere 
else.

Now to pull apart httpd...

Regards,
Graham
—


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



Re: Tomcat9 silently ignores web application

2023-07-08 Thread Graham Leggett
On 08 Jul 2023, at 10:08, Graham Leggett  wrote:

> Another data point - when starting the application up under tomcat9 in 
> eclipse, there is also no mention in the logs of the web application having 
> been deployed, however I am able to hit the application with curl and receive 
> a sensible result. The application has been silently started.
> 
> On the target machine, we get no log line same as under eclipse, and no 
> application (404 Not Found). The application might have been silently started 
> at a different URL and with no log line we’ll never know, or it silently 
> failed to start and with no error we’ll never know.

Having switched from declaring a context in server.xml to Catalina/localhost we 
now get the startup line - it seems that applications defined in server.xml are 
silently deployed, but the behaviour hasn’t changed, we still get 404 on the 
application.

08-Jul-2023 11:59:59.016 INFO [main] 
org.apache.catalina.startup.HostConfig.deployDescriptor Deployment of 
deployment descriptor 
[/var/lib/tomcats/xxx-service-test/conf/Catalina/localhost/xxx-service-test.xml]
 has finished in [5,334] ms

A further data point - the access_log as defined by default under the Host is 
created but stays empty:

  







  

In summary, the client hits tomcat, tomcat returns 404 on the request, and 
there is no trace in the access logfile that the client was ever there.

Anyone seen behaviour like this before?

Regards,
Graham
—



Re: Tomcat9 silently ignores web application

2023-07-08 Thread Graham Leggett
On 07 Jul 2023, at 23:23, Graham Leggett  wrote:

>> When you start Tomcat, do you get a message about /foo/bar being 
>> deployed in catalina.out? For example, I get this for every deployment:
>> 
>> Jul 06, 2023 4:09:33 PM org.apache.catalina.startup.HostConfig 
>> deployDirectory
>> INFO: Deploying web application directory [/full/path/to/web/application]
>> Jul 06, 2023 4:09:39 PM org.apache.catalina.startup.HostConfig 
>> deployDirectory
>> INFO: Deployment of web application directory 
>> [/full/path/to/web/application] has finished in [6,007] ms
> 
> In tomcat7 I see that line logged, in tomcat9 I do not.

Another data point - when starting the application up under tomcat9 in eclipse, 
there is also no mention in the logs of the web application having been 
deployed, however I am able to hit the application with curl and receive a 
sensible result. The application has been silently started.

On the target machine, we get no log line same as under eclipse, and no 
application (404 Not Found). The application might have been silently started 
at a different URL and with no log line we’ll never know, or it silently failed 
to start and with no error we’ll never know.

In the absence of both an error message, and confirmation of web application 
deployment, we’re flying blind.

Digging into the source, we find three similar strings to say we’re finished 
deploying a web application. Setting a breakpoint on all three, none of them 
are hit (or I’m using jdb wrong):

main[1] stop
No breakpoints set.
main[1] stop in org.apache.catalina.startup.HostConfig.deployDirectory
Deferring breakpoint org.apache.catalina.startup.HostConfig.deployDirectory.
It will be set after the class is loaded.
main[1] stop in org.apache.catalina.startup.HostConfig.deployDescriptor
Deferring breakpoint org.apache.catalina.startup.HostConfig.deployDescriptor.
It will be set after the class is loaded.
main[1] stop in org.apache.catalina.startup.HostConfig.deployWAR
Deferring breakpoint org.apache.catalina.startup.HostConfig.deployWAR.
It will be set after the class is loaded.
main[1] resume
All threads resumed.
> Set deferred breakpoint org.apache.catalina.startup.HostConfig.deployWAR
Set deferred breakpoint org.apache.catalina.startup.HostConfig.deployDescriptor
Set deferred breakpoint org.apache.catalina.startup.HostConfig.deployDirectory

> 

Regards,
Graham
—