I got this message logging as user1 with X11 forwarding with putty, then sudo su - user2, then run JConsole
solution:
login as user1
xauth list
(you get here a list of entries, say line1, line2...)
sudo su - user2
xauth add line1
xauth add line2
It works!
solution:
login as user1
xauth list
(you get here a list of entries, say line1, line2...)
sudo su - user2
xauth add line1
xauth add line2
It works!