From: Chuck Caldarale <n82...@gmail.com> Sent: Saturday, August 16, 2025 1:33 PM To: Tomcat Users List <users@tomcat.apache.org> Subject: Re: [EXTERNAL EMAIL] How to access a REST service
> On 2025 Aug 16, at 12:21, Daniel Schwartz > <d...@danielgschwartz.com<mailto:d...@danielgschwartz.com>> wrote: > > I just > sent a code fragment where I retrieve a list of countries from the DB, so > won't repeat this here. However, I did find that I was mistaken NkdkJdXPPEBannerStart Be Careful With This Message >From (Chuck Caldarale ><n82...@gmail.com>)<https://godaddy1.cloud-protect.net/email-details/?k=k1&payload=53616c7465645f5ffab89210efad9b957b503d2c7757e4c4dc7e5dc6cdf307022ef6ec039d2dab5436a20969caafccaef778a3287724416a8f17767fb01350cdf780beee54344117d85c6b54d82e9c0342155b579f291dd499772a2b1fb601f21864e80de3b03445150df3ed0ea3a7381e32e1d6f9bd241c20217f5446446f771d02e2405a1a58df7c3aef39d01e88fc9a051c9138bb3c12ad55ddb9302b25466ab3442b4b9ab3c5ffcf743c945135c12f5d0c957d5994d2f89a182ad9fac85bcd71c64bec17f5019edc5b4d21c43bf1f9bd487d6817712584f976c5b52d3dbedb83ab2d3f5169b17bea452febd1621a> Learn More<https://godaddy1.cloud-protect.net/email-details/?k=k1&payload=53616c7465645f5ffab89210efad9b957b503d2c7757e4c4dc7e5dc6cdf307022ef6ec039d2dab5436a20969caafccaef778a3287724416a8f17767fb01350cdf780beee54344117d85c6b54d82e9c0342155b579f291dd499772a2b1fb601f21864e80de3b03445150df3ed0ea3a7381e32e1d6f9bd241c20217f5446446f771d02e2405a1a58df7c3aef39d01e88fc9a051c9138bb3c12ad55ddb9302b25466ab3442b4b9ab3c5ffcf743c945135c12f5d0c957d5994d2f89a182ad9fac85bcd71c64bec17f5019edc5b4d21c43bf1f9bd487d6817712584f976c5b52d3dbedb83ab2d3f5169b17bea452febd1621a> Potential Impersonation The sender's identity could not be verified and someone may be impersonating the sender. Take caution when interacting with this message. NkdkJdXPPEBannerEnd > On 2025 Aug 16, at 12:21, Daniel Schwartz > <d...@danielgschwartz.com<mailto:d...@danielgschwartz.com>> wrote: > > I just sent a code fragment where I retrieve a list of countries from the DB, > so won't repeat this here. However, I did find that I was mistaken in saying > that Glassfish won't accept a minimum pool size less than 8. I don't know > what happened before, but today I was able to set both the minimum and > maximum to 1. Good. > Immediately after doing this, the message copied below started appearing > repeatedly in the server.log and my website stopped working---the DB > evidently became inaccessible. However, Glassfish was still running, and as > soon as I set the maximum pool size back to 1000, these messages stopped > coming and the website started working again. Indicative of an orphaned connection (resource leak). DGS: Why is this? What do those messages have to do with a resource leak? > I have no idea what all this means, but I think that the message copied below > was generated each time some web crawler was submitting a query. These come > quite frequently. > > By the way, I don't know how they do this, but the web crawlers somehow > figured out that I submit queries to the web service using Get requests, with > parameters for "country", "state", "city", "year", and are creating bogus > queries by randomly filling these in, usually with values that don't make any > sense, like "country=England", "state=England", "city=Scotland", and > "year=2087". These queries won't return any results, but they do initiate a > DB connection. These are happening many times every day. So this is very interesting, and points to a possible line of investigation. If the web crawlers are throwing garbage at your app, that could possibly be resulting in losing track of connections, statements, result sets, etc. You should carefully check your error paths and make sure that all DB-related resources are being properly disposed of when invalid input is received. DGS: I'm fairly sure that all connections and prepared statements are being closed, but will look again. This would be happening in the code fragment that tries to retrieve the list of holidays with calculated dates (not the countries). This is somewhat complex and could have problems. > ------------------------------------------------------------------------------- > > [2025-08-16T16:54:23.735+0000] [glassfish 4.1] [WARNING] > [poolmgr.get_connection_failure] > [javax.enterprise.resource.resourceadapter.com.sun.enterprise.connectors] > [tid: _ThreadID=30 _ThreadName=http-listener-1(4)] [timeMillis: > 1755363263735] [levelValue: 900] [[ > RAR5117 : Failed to obtain/create connection from connection pool [ > HolidaysConnectionPool ]. Reason : > com.sun.appserv.connectors.internal.api.PoolingException: In-use connections > equal max-pool-size and expired max-wait-time. Cannot allocate more > connections.]] > > [2025-08-16T16:54:23.735+0000] [glassfish 4.1] [WARNING] [jdbc.exc_get_conn] > [javax.enterprise.resource.resourceadapter.com.sun.gjc.spi] [tid: > _ThreadID=30 _ThreadName=http-listener-1(4)] [timeMillis: 1755363263735] > [levelValue: 900] [[ > RAR5114 : Error allocating connection : [Error in allocating a connection. > Cause: In-use connections equal max-pool-size and expired max-wait-time. > Cannot allocate more connections.]]] > > [2025-08-16T16:54:23.735+0000] [glassfish 4.1] [INFO] [] [] [tid: > _ThreadID=30 _ThreadName=Thread-8] [timeMillis: 1755363263735] [levelValue: > 800] [[ > [Ljava.lang.StackTraceElement;@2545fa37]] - Chuck