This week's book giveaway is in the Server-Side JavaScript and NodeJS forum.
We're giving away four copies of Micro Frontends in Action and have Michael Geers on-line!
See this thread for details.
Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!

Quincy Schmidt

Greenhorn
+ Follow
since Jul 29, 2014
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
3
Received in last 30 days
0
Total given
9
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Quincy Schmidt

Hoping someone can tell me what I am missing with this.  I added maxAge to the resource name for 100 minutes as seen below; but the log file comes back with:

catalina.out
o.apache.tomcat.dbcp.dbcp2.BasicDataSourceFactory - Name = RadiusDataSource Ignoring unknown property: value of "600000" for "maxAge" property

server.xml


I have also tried max-age max-Age and different values. "60" "600" "6000" etc etc.
6 months ago

Tim Holloway wrote:Unless you are planning to share that connection pool between multiple webapps, you would define it in the context.xml file, not the server.xml file.

And actually, I'm kind of confused here, since it looks like you have 2 pool definitions, one with a long JNDI resource pathname and one with a more conventional one.

Plus I didn't actually see a logAbandoned setting in the server.xml defined pool, although maybe it wrapped out of sight.

You will not see any extra logs telling you about having abandoned connections logged. Instead what happens is that when your application pulls a Connection from the monitored pool, an Exception object is created, marking the callback stack at the moment the connection was obtained. This Exception is then saved in a secret hiding place.

Periodically, the pool will check its checked-out Connections to see if they have been held longer than the allowable time. If so, then that saved Exception will be reported in the Tomcat stdout (catalina,out) log. The effect would be something like this:


Actual connection pool error-handling code and message text will vary, but the net effect is like that.




Thank you for the reply Tim!

These webapp servers are in a farm.  

In the server.xml you can see logabanded bolded below.  Or am I missing another piece to it?

<Resource auth="Container" connectionProperties="includeSynonyms=true" factory="org.apache.tomcat.jdbc.pool.DataSourceFactory" >
       driverClassName="oracle.jdbc.OracleDriver" maxActive="25" maxIdle="3" maxTotal="25" logAbandoned="true"


Also does the statementfinalizer in the context.xml look correct?  And can I do all this with the generic ojdbc7.jar driver or if I need the oracle logging enabled driver?

1 year ago
Hello fellow ranchers!   Trying to track down an Oracle open cursor issue with statementfinalizer and logabandonded=true logging.  I added the logging to context.xml and server.xml. But I am not seeing any new logs or additional logging.  Hoping someone can help me out.

Context.xml


server.xml




1 year ago

Matthew Keller wrote:Look at your application and make sure you are properly closing all open connections in a finally statement.  Also, generally a database pool in tomcat has a maximum number of connections specified.  Your application should borrow a connection from the tomcat pool and then return it.  If you are piling up database pool connections like it sounds your are, then there is something wrong with how your application is written and freeing up resources.



Thank you for the reply. I do not believe it is the app as we have the exact same application in multiple environments with the only difference being the version of Oracle.
1 year ago

Tim Holloway wrote:Try turning on the "orphan" connection detection option in your JDBC connection pool definition for Tomcat. That will cause a stack checkpoint to be taken when a Connection is checked out of the pool. If that Connection isn't closed (returned to the pool) within a reasonable amount of time, the saved stacktrace will be dumped out to the Tomcat log so that you can look for reasons why the Connection didn't close - and thus neither did the cursor.

That's assuming that Connection.close() for a pool Connection closes Statements, ResultSets and similar things attached to it - which I hadn't really considered before - except that putting a Connection back in a pool with active bits hanging off it would be trouble in its own right.

Generally, orphan connections come from sloppy programming (it only takes one mistake if you run enough connections long enough!), having an Exception thrown past the close() statement ("finally" is your friend!) or improper practices like trying to pass a Connection from one Http service request to the next (Connections are NOT Serializable/session-safe!).



Thank you for the reply!  Is the orphan connection option configured in the server.xml or in the tomcatw.exe gui under the java tab?  Or better yet can you point me to a doc or url that explains the setup parameters?

1 year ago
I upgraded the ojdbc7.jar in the tomcat\lib directory to ojdbc8.jar to see if that helps.
1 year ago
Hello Code Ranch! I have multiple Tomcat applications configured with various versions of Oracle and the Oracle Cursors rarely go above 50.  We have since Upgraded to Oracle 12.2 RAC in one of the env's and our cursors are exceeding 5000+ and do not go back down until we restart Tomcat.  Looking in Oracle we can see the Cursors are coming from our Tomcat DB user.  After multiple calls and SR's with Oracle they are telling us it is our application running on Tomcat that is the issue.

My question is if there are any config changes or lib's etc that need to be changed when upgrading from Oracle 12c to 12.2 RAC with ASM? Do I need to set maxAge or another variable to kill the stale cursors?

1 year ago
Is it possible to encrypt the JDBC connection between tomcat and oracle? I have been "duckduckgo'ing" it but everything I am finding is for the tomcat to web browser.  Hoping someone can please point me to  a doc or web page or forum post and any gotchas.

T
2 years ago

Tim Holloway wrote:It's still a timeout message. Which means that either the URL is wrong, there's a firewall problem, or the remote server is down.



It would seem that way.. However, the exact same url (copy and pasted) into IE brings up a wsdl page.  The server is using a proxy.. Maybe I need to configure the proxy in tomcat?
2 years ago

Tim Holloway wrote:The error message says it timed out looking for URL 'https://"URL".com/input/v1?wsdl'

That's not a valid URL. You need to put in the same servername that you used with IE.



Lol yeah.. I removed the actually url since this is a public forum..
2 years ago
Another thought, is there a way to test the wsdl through JAVA outside of tomcat?
2 years ago
Hello, all!   I am getting the time out message below.  However, I can bring the wsdl page up in IE.  Is there a reason why Tomcat/Java would not be able to connect to the url while IE can?  I have also tried setting a proxy in JAVA network settings with no luck.   *Tomcat works fine if I remove the url.

2 years ago

Rob Spoor wrote:

Quincy Schmidt wrote:From the log file:


That means that something is already running on the same port (8443). Did you shutdown any previous instance of Tomcat?

To find out what's running on that port you can run netstat -ban as Administator (on Linux it's netstat -plan), then search for the port.



Thank you for the reply!  I changed port 8080 to 8443 as a test. Having changed it back the bind error no longer comes up.




Finally got it figured out!

Tomcat7:
 


Tomcat8:

Not sure if this is needed or not, but after reading another forum post I commented out line 28: <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on"/>

SSL Config:
 


3 years ago
From the log file:
3 years ago