Re: Not able to connect to Tomcat via jconsole
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 All, I stopped Tomcat, completely removed my web application, restarted Tomcat and I can connect without a problem. AFAIK, my application isn't doing anything with JMX. I'll try using my context.xml without any actual code involved. - -chris On 3/10/14, 12:46 PM, Christopher Schultz wrote: All, I have two instances of Tomcat 8 running locally. One of them happens to have a JNDI DataSource configured and the other does not. They are both out-of-the-box 8.0.3 installations. One of them has no problem connecting via jconsole to observe JMX beans, while the other one waits forever and then fails. No errors or warnings in either jconsole or Tomcat (other than the could not connect message in jconsole's GUI). I believe all of the tools are using the Attach API... I have not specifically configured anything for remote JMX connections. I also can't connect using YourKit, VisualVM, etc. (Technically, VisualVM does connect, but I can't access any of the JMX beans). YourKit tells me that Attach can't be used and tells me to re-start the JVM with their profiler agent running inside of it. I get a huge stack trace from VisualVM (below) which basically tells me that it can't Attach. Environment is Mac OS X 10.9, jdk1.7.0_51.jdk, and Tomcat 8.0.3 (and trunk also). Does anyone have any ideas why I might not be able to connect? Again, the other JVM has no problem at all. I'm not installing any of my own JMX beans or anything weird like that... just standard Tomcat stuff with my application running inside it. I'm running both Tomcat and jconsole/VisualVM/YourKit as the same user (me). I just checked, and I can't connect to the same application running under Tomcat 7.0.47, either. Here are the relevant parts of server.xml: GlobalNamingResources Resource name=UserDatabase auth=Container type=org.apache.catalina.UserDatabase description=User database that can be updated and saved factory=org.apache.catalina.users.MemoryUserDatabaseFactory pathname=conf/tomcat-users.xml / /GlobalNamingResources Service name=Catalina !--The connectors can use a shared executor, you can define one or more named thread pools-- Executor name=tomcatThreadPool namePrefix=catalina-exec- maxThreads=150 minSpareThreads=4/ Connector port=8215 redirectPort=443 protocol=org.apache.coyote.ajp.AjpNioProtocol URIEncoding=UTF-8 executor=tomcatThreadPool / Connector port=8217 protocol=org.apache.coyote.http11.Http11NioProtocol address=127.0.0.1 secure=false URIEncoding=UTF-8 executor=tomcatThreadPool / Connector port=9876 protocol=HTTP/1.1 SSLEnabled=true maxThreads=150 scheme=https secure=true keyAlias=tomcat keystorePass=mypass clientAuth=false sslProtocol=TLS / Engine name=Catalina defaultHost=localhost Host name=localhost appBase=webapps unpackWARs=true autoDeploy=true ... Thanks, -chris Stack trace from VisualVM: Support/VisualVM/7u14/var/log/heapdump.hprof Compiler: HotSpot 64-Bit Tiered Compilers Heap memory usage: initial 24.0MB maximum 227.5MB Non heap memory usage: initial 23.4MB maximum 144.0MB Garbage collector: PS Scavenge (Collections=8 Total time spent=0s) Garbage collector: PS MarkSweep (Collections=0 Total time spent=0s) Classes: loaded=4506 total loaded=4506 unloaded 0 INFO [org.netbeans.core.ui.warmup.DiagnosticTask]: Total memory 8,589,934,592 INFO [null]: Total physical memory 8,589,934,592 INFO [com.sun.tools.visualvm.attach.AttachModelImpl]: printFlag com.sun.tools.attach.AttachNotSupportedException: Unable to open socket file: target process not responding or HotSpot VM not loaded at sun.tools.attach.BsdVirtualMachine.init(BsdVirtualMachine.java:90) at sun.tools.attach.BsdAttachProvider.attachVirtualMachine(BsdAttachProvider.java:63) at com.sun.tools.attach.VirtualMachine.attach(VirtualMachine.java:213) at com.sun.tools.visualvm.attach.AttachModelImpl.getVirtualMachine(AttachModelImpl.java:104) Caused: java.io.IOException: Unable to open socket file: target process not responding or HotSpot VM not loaded at com.sun.tools.visualvm.attach.AttachModelImpl.getVirtualMachine(AttachModelImpl.java:106) [catch] at com.sun.tools.visualvm.attach.AttachModelImpl.printFlag(AttachModelImpl.java:69) at com.sun.tools.visualvm.jvm.JVMImpl.isDumpOnOOMEnabled(JVMImpl.java:200) at com.sun.tools.visualvm.heapdump.impl.HeapDumpOnOOMEAction.updateState(HeapDumpOnOOMEAction.java:63) at com.sun.tools.visualvm.heapdump.impl.HeapDumpOnOOMEAction.isEnabled(HeapDumpOnOOMEAction.java:57) at com.sun.tools.visualvm.heapdump.impl.HeapDumpOnOOMEAction.isEnabled(HeapDumpOnOOMEAction.java:26) at com.sun.tools.visualvm.core.ui.actions.SingleDataSourceAction.updateState(SingleDataSourceAction.java:57) at com.sun.tools.visualvm.heapdump.impl.HeapDumpOnOOMEAction.updateState(HeapDumpOnOOMEAction.java:78) at
Re: Not able to connect to Tomcat via jconsole
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 All, On 3/10/14, 12:52 PM, Christopher Schultz wrote: I stopped Tomcat, completely removed my web application, restarted Tomcat and I can connect without a problem. AFAIK, my application isn't doing anything with JMX. I'll try using my context.xml without any actual code involved. Okay, I've discovered that if I deploy my web application but remove WEB-INF/web.xml, I can still connect. Something my web application is doing is breaking something. I'll try to narrow-down what it is. (Again, AFAIK, I'm not mucking-around with any of Tomcat's internals... just a standard web application.)_ - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1 Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCAAGBQJTHe8mAAoJEBzwKT+lPKRYImUP/383s7nuRdFp5Jzafih1ZOue yh9/FpyIZ9ym+dKwH/rH3NMJKCgpOYAr6PmHWnoW7IuOTY5miVfCdqWZWkG4MvIz kuY6QsQqmSJU50FLk40A73bHk2TU5qbDnLKzBVvTmDnT9ptzQb6JoksteeOYKTQN fToXZSqeL+QhMjnV5m9IIkg1s37JoXQUmFiRXswb1AlXbuY5wZ3rrFV8DS9BQg/z +7mWE0MzjgNSE9gHZ5tFpQ/Pmz8bUMXeHEHa0ktdEiOqEEjjyzU38nmf+mM+Yiu/ JXC58AcZwKvFWrzpdAZy1qmSeYeYOjwDKNVdmhsBA3YnyzsxHF2EqWIrlqmaY3Pe VBZ2ZLstgpM7TVzbXY0LxHfHkVaMPod0MRStJObJDSvGPzWnzAhpFsxHvtlT5DCD gMydftpCQFjukbM8O7l4vIJfOAqOV5UqafX7L0z+VLjT990nNfdTV3NmZ6Ifmuor i1xbi31X1+PybBFi0jJw6lEP5AQwntzcCxlGSN3Maj7/JR716umdL0ius703nnIp oL+4Pt0sXfS1NqD4YsAfJE7EBEoVw7r9LJFn4x13kGXpc7kdUkMZTKBtzskrXIr+ WuX4MDj+9T9WXSAZx+gLvotn1fxw7BZrjf+52hSHB7r0Cd+9d+TQxATs9W+NinpJ xaNgSbI10SaJv6Y7W8R1 =z7sz -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Not able to connect to Tomcat via jconsole
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 All, On 3/10/14, 12:58 PM, Christopher Schultz wrote: All, On 3/10/14, 12:52 PM, Christopher Schultz wrote: I stopped Tomcat, completely removed my web application, restarted Tomcat and I can connect without a problem. AFAIK, my application isn't doing anything with JMX. I'll try using my context.xml without any actual code involved. Okay, I've discovered that if I deploy my web application but remove WEB-INF/web.xml, I can still connect. Something my web application is doing is breaking something. I'll try to narrow-down what it is. (Again, AFAIK, I'm not mucking-around with any of Tomcat's internals... just a standard web application.)_ It looks like I can reproduce this with just Velocity and Velocity Tools. I'll keep narrowing it down. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1 Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCAAGBQJTHfRmAAoJEBzwKT+lPKRYEtgP/RMi9jRMuhe+HClixTkORP+G 5zh0DpTaiZO8BzI8sT/xZVApPU7GeZWeyVtV3n+k29dEKmb1AJtkq3TBbYV8ikXM e/EGRkOW3qqcbNbjaiQ3KcIa8C9l6vfEuYtxB8Ieq/hMyIVMQoycYdops/ZY/tFT hCdbIv90kkOT1Ipg6obuwqmr4G6SnpZmSfGe49E3IU66V6299cVk46N4tXVDy5hu +PXE9ST07mPtXGNz22vpf58n7qKooa86VtIwTUIdi55HgsWq0Nc7i0IlRqwBsIUb oPKM0h8c3xmBKEgiW7vnUxPO5wn5tiu4Z8IsmC7UM5dzohQj5oqwCzqrU2Q6K3BS TbStKZGQ+VO/xwHqAN7cjlruwl+3JVKA36W1x/n4cQgLc4y6SVQZAhKnTzBviXR6 6kGw7c3Q1kIrEM1lPNoOKJoWJVbIGPzS1LaWICqfnS1xxLA0yITDfuU4PUp1x8UD BrghOcMmlCvMAP5AjhTY66lzzRazE0HIXaVCrybInBb4AkpDG0EFRcDHZ0xurF00 hPn0Yl/ettQ1kVTmiuYEjZPu4IK3hhZORkew5bQqnzHAR7/i145dTCxrPEUtXevb LVPNFhSVE96ck9rWBEuDi8ag7veh9djVZif+aJ+rrus1NiGzuznNKNCgukkEU68W Lnoe1sCfL5d+Up7oPMIU =HNtQ -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Not able to connect to Tomcat via jconsole
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 All, On 3/10/14, 1:20 PM, Christopher Schultz wrote: All, On 3/10/14, 12:58 PM, Christopher Schultz wrote: All, On 3/10/14, 12:52 PM, Christopher Schultz wrote: I stopped Tomcat, completely removed my web application, restarted Tomcat and I can connect without a problem. AFAIK, my application isn't doing anything with JMX. I'll try using my context.xml without any actual code involved. Okay, I've discovered that if I deploy my web application but remove WEB-INF/web.xml, I can still connect. Something my web application is doing is breaking something. I'll try to narrow-down what it is. (Again, AFAIK, I'm not mucking-around with any of Tomcat's internals... just a standard web application.)_ It looks like I can reproduce this with just Velocity and Velocity Tools. I'll keep narrowing it down. I have a minimal test which I've attached (sort of) to this Bugzilla issue: https://issues.apache.org/bugzilla/show_bug.cgi?id=56242 If anyone could give me some pointers at this stage, it would be greatly appreciated. Thanks, - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1 Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCAAGBQJTHgA8AAoJEBzwKT+lPKRYh/UP/ikpCvl2rrmJK2+gnHuiYEgx rlIyJOzQDzECutbj5lwB/FEbTWwj3vmBGuakkn3BfZp1P77J9LqZiWx180Jvfo5n Mu4m1qUobOAo6yjwc4sLQ77GDDm+g7wWZMFlW6icMbaoQu7U6DMY8cPK1ESlwJRr KbE5TvsAAlDBEL1h6UsY0k3nTWzDbXGG/cN1q0JunypLQPdGOeueh+75z/R3q+sq N+IBFGiVDg/YaKgYiu6skhbYMgnlbnSZTzsPD7DomrQDpoWUWp7rAUov4jYERIG2 W4TIq1jlYdwbLDZqrZS2eOHA+D9UU0FTacbTcCgY65VQbxpn4ozmeo8+3jI7Kia1 BOmSPJJuxsgi80QN4d+nkQQBw3lfH46g1zEuM4coyMLCSBVZYOBFQFCp/4n0dtvS hEyaB9MmManv5dSwKEBjGTCJxZUps9eoKGzA/aiI9Jt4IK1IDxKduFzX/GN3Qt0O v+ADKYfWtCFKezol2Db/hgDVa5avmihE86KcZFGVB48i4b8+QkeRzdesa3P17YmQ BjwnNz4yowwcTOMXZR2BYh2XDEjScjA5LdS6iA5noiE1sQ4TWTsM9OH+t9XHerss e92hMN4pj7xJFXK1hYsAjrNP0iEW4ETffoHFAuAStGUuDw1zuhKyvmHABcpjRrI8 MZXZQuvJbBlLJw/SsqAf =Kv5J -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Not able to connect to Tomcat via jconsole
2014-03-10 22:11 GMT+04:00 Christopher Schultz On 3/10/14, 1:20 PM, Christopher Schultz wrote: On 3/10/14, 12:58 PM, Christopher Schultz wrote: All, On 3/10/14, 12:52 PM, Christopher Schultz wrote: I stopped Tomcat, completely removed my web application, restarted Tomcat and I can connect without a problem. AFAIK, my application isn't doing anything with JMX. I'll try using my context.xml without any actual code involved. Okay, I've discovered that if I deploy my web application but remove WEB-INF/web.xml, I can still connect. Something my web application is doing is breaking something. I'll try to narrow-down what it is. (Again, AFAIK, I'm not mucking-around with any of Tomcat's internals... just a standard web application.)_ It looks like I can reproduce this with just Velocity and Velocity Tools. I'll keep narrowing it down. I have a minimal test which I've attached (sort of) to this Bugzilla issue: https://issues.apache.org/bugzilla/show_bug.cgi?id=56242 If anyone could give me some pointers at this stage, it would be greatly appreciated. Win7, 32-bit JDK 7u51 Tomcat 8.0.3 If I connect with jconsole, it displays an odd error message with the following title, text and two buttons (I suppose some resource is missing, so it displays message keys instead of actual text): ConnectionFailedSSL1 ConnectionFailedSSL2 [Insecure] [Cancel] If I press Insecure button, it connects successfully and shows Catalina JMX beans. The above happens regardless of whether your web application is deployed or not. Best regards, Konstantin Kolinko - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Not able to connect to Tomcat via jconsole
2014-03-10 23:51 GMT+04:00 Konstantin Kolinko knst.koli...@gmail.com: 2014-03-10 22:11 GMT+04:00 Christopher Schultz On 3/10/14, 1:20 PM, Christopher Schultz wrote: On 3/10/14, 12:58 PM, Christopher Schultz wrote: All, On 3/10/14, 12:52 PM, Christopher Schultz wrote: I stopped Tomcat, completely removed my web application, restarted Tomcat and I can connect without a problem. AFAIK, my application isn't doing anything with JMX. I'll try using my context.xml without any actual code involved. Okay, I've discovered that if I deploy my web application but remove WEB-INF/web.xml, I can still connect. Something my web application is doing is breaking something. I'll try to narrow-down what it is. (Again, AFAIK, I'm not mucking-around with any of Tomcat's internals... just a standard web application.)_ It looks like I can reproduce this with just Velocity and Velocity Tools. I'll keep narrowing it down. I have a minimal test which I've attached (sort of) to this Bugzilla issue: https://issues.apache.org/bugzilla/show_bug.cgi?id=56242 If anyone could give me some pointers at this stage, it would be greatly appreciated. Win7, 32-bit JDK 7u51 Tomcat 8.0.3 If I connect with jconsole, it displays an odd error message with the following title, text and two buttons (I suppose some resource is missing, so it displays message keys instead of actual text): ConnectionFailedSSL1 ConnectionFailedSSL2 [Insecure] [Cancel] If I press Insecure button, it connects successfully and shows Catalina JMX beans. The above happens regardless of whether your web application is deployed or not. The same SSL attachment failure happens with JDK 7u51 + Tomcat 7.0.52. Those meaningless messages are a known bug https://bugs.openjdk.java.net/browse/JDK-8030878 but it does not explain why it fails in the first place. I guess they somehow broke/tightened AttachAPI? Removing -Djava.io.tmpdir from catalina.bat does not help. 2014-03-10 20:52 GMT+04:00 Christopher Schultz ch...@christopherschultz.net: I stopped Tomcat, completely removed my web application, restarted Tomcat and I can connect without a problem. AFAIK, my application isn't doing anything with JMX. What is the state of Tomcat when you completely removed my web application? Were there other web applications deployed on Tomcat? I my test I had standard webapps (at least docs, manager, ROOT) there. AFAIK, my application isn't doing anything with JMX. From a quick view, velocity 1.7 and velocity-tools 2.0 do not deal with JMX either. The only imports of javax.* are those of Servlet API. I wonder whether your issue is reproducible with Java 8 release candidates, that some Oracle people were advertising on dev mailing list. Best regards, Konstantin Kolinko - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Not able to connect to Tomcat via jconsole
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Konstantin, On 3/10/14, 4:47 PM, Konstantin Kolinko wrote: 2014-03-10 23:51 GMT+04:00 Konstantin Kolinko knst.koli...@gmail.com: 2014-03-10 22:11 GMT+04:00 Christopher Schultz On 3/10/14, 1:20 PM, Christopher Schultz wrote: On 3/10/14, 12:58 PM, Christopher Schultz wrote: All, On 3/10/14, 12:52 PM, Christopher Schultz wrote: I stopped Tomcat, completely removed my web application, restarted Tomcat and I can connect without a problem. AFAIK, my application isn't doing anything with JMX. I'll try using my context.xml without any actual code involved. Okay, I've discovered that if I deploy my web application but remove WEB-INF/web.xml, I can still connect. Something my web application is doing is breaking something. I'll try to narrow-down what it is. (Again, AFAIK, I'm not mucking-around with any of Tomcat's internals... just a standard web application.)_ It looks like I can reproduce this with just Velocity and Velocity Tools. I'll keep narrowing it down. I have a minimal test which I've attached (sort of) to this Bugzilla issue: https://issues.apache.org/bugzilla/show_bug.cgi?id=56242 If anyone could give me some pointers at this stage, it would be greatly appreciated. Win7, 32-bit JDK 7u51 Tomcat 8.0.3 If I connect with jconsole, it displays an odd error message with the following title, text and two buttons (I suppose some resource is missing, so it displays message keys instead of actual text): ConnectionFailedSSL1 ConnectionFailedSSL2 [Insecure] [Cancel] If I press Insecure button, it connects successfully and shows Catalina JMX beans. The above happens regardless of whether your web application is deployed or not. The same SSL attachment failure happens with JDK 7u51 + Tomcat 7.0.52. Those meaningless messages are a known bug https://bugs.openjdk.java.net/browse/JDK-8030878 but it does not explain why it fails in the first place. No, I have to attach insecurely no matter what. What happens to me is *after* falling back to an insecure connection. I gave up using jconsole after a while and used VisualVM exclusively to track-down the cause because it would give me better information (would connect with a mild error, JMX didn't work). I was able to reproduce it with the small test case I attached to the BZ issue. I guess they somehow broke/tightened AttachAPI? Removing -Djava.io.tmpdir from catalina.bat does not help. I'll see if I can get a Windows VM running to try another environment. It's entirely possible this is a Mac / Oracle VM thing. 2014-03-10 20:52 GMT+04:00 Christopher Schultz ch...@christopherschultz.net: I stopped Tomcat, completely removed my web application, restarted Tomcat and I can connect without a problem. AFAIK, my application isn't doing anything with JMX. What is the state of Tomcat when you completely removed my web application? Were there other web applications deployed on Tomcat? I removed everything in the webapps/ directory and restarted. I may or may not have cleaned-out the work directory. There were no web applications deployed at all. I can confirm that other web applications (written by my team) can be deployed without causing this problem. I my test I had standard webapps (at least docs, manager, ROOT) there. AFAIK, my application isn't doing anything with JMX. From a quick view, velocity 1.7 and velocity-tools 2.0 do not deal with JMX either. The only imports of javax.* are those of Servlet API. I wouldn't have expected that they would. The only thing I could think of was that maybe there was some kind of non-serializable object that the remote client (jconsole) was attempting to access that for some reason caused the whole thing to die. I would have expected a nicer error... not something like can't connect using Attach API and having both jconsole and YourKit fail utterly and VisualVM connecting yet without JMX support. I wonder whether your issue is reproducible with Java 8 release candidates, that some Oracle people were advertising on dev mailing list. I could give that a try. I can also fall-back to Java 6, as Apple still has packages for Java 6 i386 and x86_64 (both of which I have installed and available). - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1 Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCAAGBQJTHijxAAoJEBzwKT+lPKRY4vAQAJXROFkP430767lmFqA1TB8k hQYoFvvj51MUYVt9Xoyv9GW0TYFWcBkVXeGRp5YhDMMr1pgueFaxcXmSEBwccTV3 OvIdqDm+eZFQcFGSm/6kzFMXIwJRcC0tym7PsmvUFYSAUkWGGGDpxpjbU5Yk79ZZ 4KB4c6DcAEUwxcaLi3TTcS6YB1/cZ6VoTy4onjqgMprQ6DhWFieWkfQKIlryamEi APpw407K/qBt79YPoKBrld1Kcbvn3aKDFuJjs4JHMDLtjKRcrWITZXXCStAMe8rk ugIXch0RP25H+XvK3nfmF8kw6MLNNSS3g7rDsYnIPIsQltD0HucL8+c7IoID8842 OuURHAUw1n+Cd6pW3wE+Av9Zivo3iPw72iAI8kZYn/z9T1lbc0M6w4/3e8bKysST /gkExlj+CZ6SPy+qpl47ojX07ZktVosW4zJi7P+KtjxYOzLEnag+0tz0nTeB6kRs