On 31/07/2025 05:10, Daniel Schwartz wrote:
I have a REST webservice written in Java that runs on the Glassfish server, but 
I started having problems with the JDBC pooling system.  It kept crashing, 
saying that it was unable to allocate any more connection objects.  This made 
no sense to me, as I had set the maximum pool size to 1000, and I surely was 
not getting that many simultaneous connections.  Also, I consulted with some 
Glassfish experts at a company called OmniFish, and this didn't help.

So I decided to shift to Tomcat, which doesn't require connection pooling.

Umm...

The requirement for connection pooling comes from your application, not the container. Like Glassfish, Tomcat supports connection pooling if you want to use it.

The chances are you do want to use connection pooling as it will improve your application's performance.

From your description of your application's behaviour on Glassfish, it sounds like the application has a connection leak. You might find it is a better use of your time working on finding and fixing that leak rather than porting the application to Tomcat (where the leak will still be present).

 I have implemented my system in both IntelliJ IDEA and VSCode, with suitable 
changes to make a direct connection to MySQL.  Both of these produce a file 
called HolidaysRESTJSON-1.0-SNAPSHOT.war.  This deploys in Tomcat (I'm using 
tomcat-9.0.107), but when I try to access it with my test URL,

    
http://localhost:8080/HolidaysRESTJSON-1.0-SNAPSHOT/webresources/holidaysandevents/countries

I get a 404 error.  It is supposed to return a list of countries.  This did 
work with my Glassfish version, however.  So it should work with Tomcat.

The question is: Why not?

Insufficient information to provide a definitive answer. We can guess, but it is little more than that.

Is there something wrong with my URL?

Probably.

How would I know?

You wrote the application so you defined the URL mapping for your servlet.

At a guess, you need to remove "/webresources" from the URL.

Things you could provide that might help us help you:
- clean logs of Tomcat starting and you making a single request
- the web.xml for you application
- any information related to defining the URL that is meant to return the list of countries.

Mark


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

Reply via email to