tomcat-dbcp Poolable connection is closed while connection is in ALLOCATED state

2018-09-15 Thread Aman Verma
Hi,
In the java application (using tomcat 7, JDK 7u51,
tomcat-dbcp-8.0.3.jar, ojdbc6.jar) there is a certain connection leak.
After the connection pool was exhausted (pool reached maxTotal active
connections), I took heap dump. On analyzing heap dump, as expected
maxTotal PoolableConnection and associated maxTotal DefaulPooledObject
was found. All the connection were associated with "ALLOCATED"
PooledObjectState as I would expect.

However, All the PoolableConnection (that seemed to leak) had
"_closed"  boolean as true.

When I decompiled tomcat-dbcp jar, It seems that every time a
PoolableConnection is closed, the code sets associated
PooledObjectState to IDLE and returns the connection to pool.

My doubt is, why did my heap dump capture PoolableConnection as
"closed" while still associated to ALLOCATED PooledObjectState.

image evidence at :
https://stackoverflow.com/questions/52347117/tomcat-dbcp-closed-poolableconnection-but-in-allocated-state

Regards,
Aman

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



jk_handler::mod_jk.c (2917): Could not get endpoint for worker ...

2018-09-15 Thread Clemens Wyss DEV
Hi all,
we are seeing quite a few:
"[Mon Sep 10 15:19:46 2018] [27562:140532026529536] [error] 
jk_handler::mod_jk.c (2917): Could not get endpoint for worker=testAPJ"

errors in our md_jk.log. Worker properties are as follwos:

...
worker.list=testAPJ

worker.testAPJ.port=8009
worker.testAPJ.host=127.0.0.1
worker.testAPJ.type=ajp13
worker.testAPJ.socket_keepalive=1
worker.testAJP.connection_pool_timeout=600
...

At that point Apache seems to be stuck/struggling (but our tomcat does not seem 
to be under pressure). Restarting Apache solves the issue ... till it pops up 
again ...

What is happening? What needs tob e tuned?

Apache 2.4.34, tried both event- and worker-MPM

Thx in advance
Clemens


Re: SSL Encryption for Cluster Conversations (NioReceiver and Members)

2018-09-15 Thread Mark Thomas




On 14/09/2018 16:01, Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Mark,

On 9/14/18 08:34, Mark Thomas wrote:

On 14/09/18 13:11, Tim K wrote:

Using latest Tomcat 9.0.11.  I'm using the securePort attribute
for both the NioReceiver and StaticMembers but when capturing and
inspecting the traffic over the secure ports with WireShark, I'm
seeing all my session data in clear text, even my username as
password (user principal)!  I tried removing the port attribute
from both, elements, leaving just the securePort there but this
does not encrypt the traffic.


To my knowledge, the port was added but TLS was never implemented.
It may be better if we remove that code entirely. Why you'd want a
secure port and an insecure port at the same time for a cluster
never did make much sense to me.

The typical TLS configuration is a poor choice for clusters It
would require quite a lot of configuration. Encryption based on a
pre-shared private key would be a better approach.


Why?


Long (and bitter) experience tells me that most folks have a hard time 
setting up TLS so it works. Generating a single file (for the shared 
secret - which we can easily provide a script to generate) and copying 
that one file to multiple machines is a much simpler process.



Each server with a server-cert and each client with a bag of
trusted certs doesn't seem that big of a deal. Even
mutual-authentication just adds another bag of trust on each server
and a client-cert on each client. If you set up a private signing
authority, it gets even easier.

But I agree, there shouldn't be two ports to configure. Just one, and
if we decide to add encryption, you should just be able to say "yes,
please" and have it work over the same port... assuming all nodes are
configured the same, of course.

Applying encryption shouldn't be too hard, code-wise, if all we wanted
to do was encrypt each message going over the (otherwise plaintext)
wire. Each node needs to know the encryption flavor in use (cipher,
padding, etc.) and a pre-shared key. That's just two configuration
elements in server.xml and one of them (the cipher) can default to
something reasonable such as AES/CBC/PKCS5Padding.

This would be a good Google Summer of Code project, though it wouldn't
actually take that long. Maybe Google Midsummer of Code :)


Worth adding a BZ enhancement for this.

Mark




- -chris
-BEGIN PGP SIGNATURE-
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlubzUkACgkQHPApP6U8
pFi8Sw/+McP0UxnqhcWKe+ErhWXX/AmiMdsvx1URDIw3GGec0P6p7zyIDldllnjr
/nbXDmYTRX3SUcXAd80h0p86HG44G0NKtRkzMwCbdUkKLtwHxASsYAnuzMSL7Xaf
Vh+ohgEfqjDurcor+xJZRFPweCFn+a7ID41jv5i42oYr0QC4o1xBCPzXYNcb6UnP
JYGBuxOVthaHnEBcGej3sQCNMNWQvoyQphvsprXUkHMjXZt3/esTRe0Nj0d9O+sQ
AEGli/gN4UQeIPU0yU1nZXyrKuHE/qupU4TLkIDlFE36XHMY8SHX3bEnVD23fEkk
goftmlsefu+SyXlemO0q9h2X/eL2GFKFJn0ALQUb4u354QKpyDYh4FTK8VJnnN/2
lOVjbCfq39gBnZ4wZntJUVN+4BB2elQs4PrLOrDAwrZYCNzvKgfmI6V0xEQCTrfO
7tiJ+YJnIgUuFqyfKi5b4RnvZC5LasZ0Uw/nWjlHyVd5xwrRgspdEDRRKapsnzb8
3y7vle6UM/nOdmbQ99cnERtQ8qdmiy6FGnaVm8Gt96Se4Gj3SlpwfHx1tO+py5Us
Gc3sxDiXzlhs79CqYwqJDaAzK5iQfATVUKJ1f8GT+Zc6RGbIUL/ERkTrJhDD0rbL
eZSSKArJj6DwzkjS8CjapJGs/UhmeShb0wX29KLploEofVqfRIc=
=JMu5
-END PGP SIGNATURE-

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



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



Error: Could not find or load main class set

2018-09-15 Thread Karen Goh
Hi,

I am now getting the above error.  There is no further error stacktrace from 
error log or console etc.

So far, I have deleted the server and created new instances but still getting 
the same error.

I have read the following solutions but they are not helpful

http://www.java67.com/2016/09/3-ways-to-solve-eclipse-main-class-not-found-error-java.html

https://www.researchgate.net/post/How_to_solve_Error_Could_not_find_or_load_main_class

Please help.

Tks,
Karen

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