Java stacktrace shows a blocked thread with no information about what is blocking it

Can someone explain to me why in the hotspot stacktrace captured by jstack I can see the thread is blocked without any information about the lock write blocking it.

3 "ajp-" daemon prio=10 tid=0x63721000 nid=0x2cba
waiting for monitor entry [0x4e619000]
4    java.lang.Thread.State: BLOCKED (on object monitor)
5         at java.lang.Class.forName0(Native Method)
6         at java.lang.Class.forName(
7         at$Rule.isAllowed(
8         at
9         at


10 in ... deleted because it is not relevant


source to share

1 answer

Somewhere in this stack, in the part you cut off, there is something like:

- waiting to lock <0xa3cd2188> (a java.lang.Object)


Try this simple app, which has a thread printed on the thread that it waits for and then waits for a while. You can kill -3 <pid>

(on linux) get a complete dump of a thread, including all the stacks, including the stack for the waiting thread.

public class TTest {
    public static void main(String[] args) throws Exception {
        final Object lock = new Object();
        Thread thread = new Thread() {
            public void run() {
                System.out.println("Locking on: " + Integer.toString(lock.hashCode(), 16));
                synchronized (lock) {
                    System.out.println("Hello, world!");
        synchronized (lock) {
            Thread.sleep(600 * 1000);




All Articles