Bug 55684 - WebappClassLoader.getThread want an access to root ThreadGroup
Summary: WebappClassLoader.getThread want an access to root ThreadGroup
Alias: None
Product: Tomcat 7
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 7.0.42
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2013-10-21 16:30 UTC by Gael Lalire
Modified: 2013-10-29 09:56 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Gael Lalire 2013-10-21 16:30:04 UTC
Tomcat may not have all permissions granted.
The method WebappClassLoader.getThread try to access the root ThreadGroup in order to list all threads.
You should either manage SecurityException or avoid to access the parent ThreadGroup of the thread which start Tomcat.
Comment 1 Christopher Schultz 2013-10-22 00:38:32 UTC
Stack trace?
Comment 2 Mark Thomas 2013-10-28 20:37:18 UTC
Tomcat is designed to work out of the box under a security manager. Calls to this particular code either originate from container code that has the necessary permissions or come via a appropriate PrivilegedAction code block.

If you change Tomcat's default security permissions then that is likely to break something.

Without a stack trace, this is going to get resolved as invalid.
Comment 3 Gael Lalire 2013-10-28 23:33:16 UTC

I run tomcat and other applications under the same JVM.
Each application has a thread group and cannot access to thread group of other application.
This is enforce by a modified SecurityManager.

I know I can authorize Tomcat to access all thread group (I do it in fact) however I would like to remove this permission.

Stacktrace just show my SecurityManager throwing a SecurityException to ThreadGroup.getParent().
Javadoc of ThreadGroup.getParent() indicates that a SecurityException can be thrown.
Comment 4 Gael Lalire 2013-10-28 23:45:36 UTC
A clean solution could be to have the possibility to set the root thread group in  WebappClassLoader.
So WebappClassLoader.getThread() can avoid to loop inside parent thread group while not null.
Comment 5 Mark Thomas 2013-10-29 09:56:13 UTC
Fixed in trunk for 8.0.0-RC6 and 7.0.x for 7.0.48.