VisualVM 无法使用 service:jmx:rmi:///jndi/rmi:///jmxrmi 连接到XX.xx.xx.xx

爱上一只狐 2015-12-03 04:21:37
背景:
本地能远程局域网内tomcat7,(centos6.4),远程不行
环境:
客户端:1.7.0_67jdk中的visualvm
服务器:centos6.4 ,jdk1.7.0_71
服务器端apache-tomcat-7.0.57的配置:
catalina.sh开头配置
JAVA_OPTS="
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=1099
-Dcom.sun.management.jmxremote.rmi.port=1099
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
-Djava.rmi.server.hostname=192.168.2.25"
1)hostname已经修改,如图:

2)直接连防火墙都关掉了
3)打开本地客户端,新建远程连接,无法连接,如图

查看本地连接如下:

查看服务端的连接如下:


4)查看本地客户端日志,如下:

INFO [com.sun.tools.visualvm.jmx.impl.JmxModelImpl]: connect(service:jmx:rmi:///jndi/rmi://42.62.70.188:1099/jmxrmi)
java.io.EOFException: SSL peer shut down incorrectly
at sun.security.ssl.InputRecord.read(InputRecord.java:482)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:927)
Caused: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:946)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1312)
at sun.security.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:702)
at sun.security.ssl.AppOutputStream.write(AppOutputStream.java:122)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
at java.io.DataOutputStream.flush(DataOutputStream.java:123)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:229)
Caused: java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:
javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:304)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:202)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:341)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:114)
Caused: javax.naming.CommunicationException [Root exception is java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:
javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake]
at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:118)
at com.sun.jndi.toolkit.url.GenericURLContext.lookup(GenericURLContext.java:203)
at javax.naming.InitialContext.lookup(InitialContext.java:411)
at javax.management.remote.rmi.RMIConnector.findRMIServerJNDI(RMIConnector.java:1929)
at javax.management.remote.rmi.RMIConnector.findRMIServer(RMIConnector.java:1896)
at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:286)
Caused: java.io.IOException: Failed to retrieve RMIServer stub
at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:369)
at com.sun.tools.visualvm.jmx.impl.JmxModelImpl$ProxyClient.tryConnect(JmxModelImpl.java:512)
[catch] at com.sun.tools.visualvm.jmx.impl.JmxModelImpl$ProxyClient.connect(JmxModelImpl.java:449)
at com.sun.tools.visualvm.jmx.impl.JmxModelImpl.connect(JmxModelImpl.java:203)
at com.sun.tools.visualvm.jmx.impl.JmxModelImpl.<init>(JmxModelImpl.java:192)
at com.sun.tools.visualvm.jmx.impl.JmxModelProvider.createModelFor(JmxModelProvider.java:40)
at com.sun.tools.visualvm.jmx.impl.JmxModelProvider.createModelFor(JmxModelProvider.java:21)
at com.sun.tools.visualvm.core.model.ModelFactory.getModel(ModelFactory.java:91)
at com.sun.tools.visualvm.tools.jmx.JmxModelFactory.getJmxModelFor(JmxModelFactory.java:49)
at com.sun.tools.visualvm.jmx.impl.JmxApplicationProvider.addJmxApplication(JmxApplicationProvider.java:261)
at com.sun.tools.visualvm.jmx.impl.JmxApplicationProvider.createJmxApplication(JmxApplicationProvider.java:170)
at com.sun.tools.visualvm.jmx.JmxApplicationsSupport.createJmxApplicationImpl(JmxApplicationsSupport.java:273)
at com.sun.tools.visualvm.jmx.JmxApplicationsSupport.createJmxApplicationInteractive(JmxApplicationsSupport.java:250)
at com.sun.tools.visualvm.jmx.impl.AddJMXConnectionAction$1.run(AddJMXConnectionAction.java:60)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1393)
at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2005)
...全文
20833 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
X元素 2017-07-12
  • 打赏
  • 举报
回复
记得把 链接vm的ip地址写上去。
qq_24431347 2017-07-05
  • 打赏
  • 举报
回复
没解决,求解决
Abby312 2017-06-06
  • 打赏
  • 举报
回复
把catalina.sh中的JAVA_OPTS有多个,把JAVA_OPTS里的内容合成到一个里面。重新启动服务就可以了
tianfang 2017-03-09
  • 打赏
  • 举报
回复 1
你配置中 -Dcom.sun.management.jmxremote.ssl=false 怎么还有用SSL方式连接?
fs900818 2017-03-04
  • 打赏
  • 举报
回复
楼主解决了么
zhiqy_12 2016-08-23
  • 打赏
  • 举报
回复
楼主解决这个问题了吗? 求解决方案
qq_31511037 2016-08-02
  • 打赏
  • 举报
回复
我也遇到了今天,怎么解决的啊
DivnerWang 2016-07-27
  • 打赏
  • 举报
回复
问题解决了吗,我也遇到 了这个问题
wind035 2016-04-12
  • 打赏
  • 举报
回复
你换个端口 1099 jstatd在用了。
漩_free 2016-01-19
  • 打赏
  • 举报
回复
无法使用XX连接XX,我也遇到了。一下午最后发现是防火墙的问题。 iptables里已经开放对应端口,也能telnet通。就是连不上VitualVM。开了防火墙好了。还需学习~~
爱上一只狐 2015-12-21
  • 打赏
  • 举报
回复
咋没人遇到过吗。。求高手
Java Platform Standard Edition 7 Documentation What's New Documentation Release Notes Tutorials and Training The Java Tutorials Java Training More Information Java SE 7 Names and Versions Java SE White Papers Documentation Accessibility Specifications Installation Instructions Supported Systems Configurations Java SE 7 and JDK 7 Compatibility JDK 7 Adoption Guide Troubleshooting Java SE About Test / Sample Applications and Code Resources Oracle Java SE Advanced and Oracle Java SE Suite Open JDK Bugs Database Downloads Java SE Downloads Community Forums Blogs User Groups Wikis Newsletters Events Other Technologies Java EE Java ME Java FX GlassFish NetBeans Oracle has two products that implement Java Platform Standard Edition (Java SE) 7: Java SE Development Kit (JDK) 7 and Java SE Runtime Environment (JRE) 7. JDK 7 is a superset of JRE 7, and contains everything that is in JRE 7, plus tools such as the compilers and debuggers necessary for developing applets and applications. JRE 7 provides the libraries, the Java Virtual Machine (JVM), and other components to run applets and applications written in the Java programming language. The following conceptual diagram illustrates Java component technologies: JDK Java Language Java Language ` Tools & Tool APIs java javac javadoc jar javap JPDA JConsole Java VisualVM Java DB Security Int'l RMI IDL Deploy Monitoring Troubleshoot Scripting JVM TI JRE RIAs Java Web Start Applet / Java Plug-in User Interface Toolkits AWT Swing Java 2D Accessibility Drag n Drop Input Methods Image I/O Print Service Sound Java SE API Integration Libraries IDL JDBC JNDI RMI RMI-IIOP Scripting Other Base Libraries Beans Int'l Support Input/Output JMX JNI Math Networking Override Mechanism Security Serialization Extension Mechanism XML JAXP lang and util Base Libraries lang and util Collections Concurrency Utilities JAR Logging Management Preferences API Ref Objects Reflection Regular Expressions Versioning Zip Instrumentation Java Virtual Machine Java HotSpot Client and Server VM Description of Java Conceptual Diagram What's New in Documentation Documentation is regularly updated to provide developers with in-depth information about new features in the Java platform. Some recent updates include: Swing The JLayer class has been added, which is a flexible and powerful decorator for Swing components; see How to Decorate Components with JLayer. The Nimbus Look and Feel has been moved from the com.sun.java.swing package to the javax.swing package; see the javax.swing.plaf.nimbus package. Mixing Heavyweight and Lightweight Components is easier to accomplish. Windows with transparency and non-rectangular shape are supported; see How to Create Translucent and Shaped Windows An HSV tab has been added to the JColorChooser class. Java I/O The java.nio.file package and its related package, java.nio.file.attribute, provide comprehensive support for file I/O and for accessing the file system; see File I/O (featuring NIO.2). NIO stands for non-blocking I/O. The directory /sample/nio/chatserver/ contains samples that demonstrate the new APIs contained in the java.nio.file package. The directory /demo/nio/zipfs/ contains samples that demonstrate the NIO.2 NFS (Network File System) file system. Networking The URLClassLoader.close method has been added; see Closing a URLClassLoader. The Sockets Direct Protocol (SDP) provides access to high performance network connections; see Understanding the Sockets Direct Protocol. Security A new native provider has been added that provides several ECC-based algorithms (ECDSA/ECDH); see Sun PKCS#11 Provider's Supported Algorithms in Java PKCS#11 Reference Guide. Weak cryptographic algorithms can now be disabled; see Appendix D: Disabling Cryptographic Algorithms in Java PKI Programmer's Guide and Disabled Cryptographic Algorithms in Java Secure Socket Extension (JSSE) Reference Guide. Various enhancements related to SSL/TLS have been added to Java Secure Socket Extension. Collections The TransferQueue interface has been added, which is a refinement of the BlockingQueue interface. The class LinkedTransferQueue implements the TransferQueue interface. Concurrency The fork/join framework, which is based on the ForkJoinPool class, is an implementation of the Executor interface. It is designed to efficiently run a large number of tasks using a pool of worker threads. A work-stealing technique is used to keep all the worker threads busy, to take full advantage of multiple processors. See Fork/Join in The Java Tutorials. The directory /sample/forkjoin/ contains samples that demonstrate the fork/join framework. The ThreadLocalRandom class eliminates contention among threads using pseudo-random numbers; see Concurrent Random Numbers. The Phaser class is a new synchronization barrier, similar to CyclicBarrier. Rich Internet Applications (RIA) and Deployment The window of a dragged applet can be decorated with a default or custom title; see Requesting and Customizing Applet Decoration in Draggable Applets. The following enhancements have been made to the syntax of JNLP files; see JNLP File Syntax: The os attribute in the information and resources elements can now contain specific versions of Windows, such as Windows Vista or Windows 7. Applications can use the install attribute in the shortcut element to specify their desire to be installed. Installed applications are not removed when the Java Web Start cache is cleared, but can be explicitly removed using the Java Control Panel. Java Web Start applications can be deployed without specifying the codebase attribute; see Deploying Without Codebase A JNLP file can be embedded into an HTML page; see Embedding JNLP File in Applet Tag. You can check the status variable of the applet while it is loading to determine if the applet is ready to handle requests from JavaScript code; see Handling Initialization Status With Event Handlers. You now have control of the window decoration style and title of an applet launched from a shortcut or dragged out of the browser; see Requesting and Customizing Applet Decoration in Developing Draggable Applets. Java 2D A new XRender-based Java 2D rendering pipeline is supported for modern X11-based desktops, offering improved graphics performance; see the xrender flag in System Properties for Java 2D Technology. The JDK now enumerates and displays installed OpenType/CFF fonts through methods such as GraphicsEnvironment.getAvailableFontFamilyNames; these fonts are also recognized by the Font.createFont method. See Selecting a Font. The TextLayout class supports Tibetan script. libfontconfig, a font configuration API, is used to select fonts to use for the logical fonts for some implementations of Linux; see Fontconfig. Java XML This release contains Java API for XML Processing (JAXP) 1.4.5, supports Java Architecture for XML Binding (JAXB) 2.2.3, and supports Java API for XML Web Services (JAX-WS) 2.2.4. Internationalization Unicode 6.0.0 is supported; see Unicode in The Java Tutorials. The directory /demo/jfc/Font2DTest/ contains samples that demonstrate Java support for Unicode 6.0. Java SE 7 can accommodate new currencies that are identified by their ISO 4217 codes; see the Currency class. java.lang Package Potential deadlocks were eliminated for multithreaded, non-hierarchically delegating custom class loaders; see Multithreaded Custom Class Loaders in Java SE 7. Java Programming Language The following enhancements have been added to the Java language: Binary Literals Underscores in Numeric Literals Strings in switch Statements Type Inference for Generic Instance Creation Improved Compiler Warnings and Errors When Using Non-Reifiable Formal Parameters with Varargs Methods The try-with-resources Statement Catching Multiple Exception Types and Rethrowing Exceptions with Improved Type Checking Java Virtual Machine Java Virtual Machine Support for Non-Java Languages: Java SE 7 introduces a new JVM instruction that simplifies the implementation of dynamically typed programming languages on the JVM. Garbage-First Collector is a server-style garbage collector that replaces the Concurrent Mark-Sweep Collector (CMS). Java HotSpot Virtual Machine Performance Enhancements JDBC 4.1 JDBC 4.1 introduces the following features: The ability to use a try-with-resources statement to automatically close resources of type Connection, ResultSet, and Statement; see Closing Connections in Processing SQL Statements. RowSet 1.1: The introduction of the RowSetFactory interface and the RowSetProvider class, which enable you to create all types of row sets supported by your JDBC driver; see Using the RowSetFactory Interface in Using JdbcRowSet Objects.

25,985

社区成员

发帖
与我相关
我的任务
社区描述
高性能WEB开发
社区管理员
  • 高性能WEB开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧