设置端口时Tomcat RMI出现问题

时间:2014-10-12 09:10:53

标签: java tomcat

尝试在虚拟主机公司的tomcat 8服务器上设置RMI。得到一些奇怪的问题。

所以第一位是JAVAOPT设置,将以下内容添加到setenv.sh rw-r - r-- 1 tentogive tentogive 2040 Sep 24 20:03 configtest.bat

export JAVA_OPTS="-Djava.awt.headless=true -server -Xms48m -Xmx256m\
                        -Dcom.sun.management.jmxremote=true \
                        -Dcom.sun.management.jmxremote.ssl=false \
                        -Dcom.sun.management.jmxremote.port=14648 \
                        -Dcom.sun.management.jmxremote.authenticate=false \
                        -Djava.rmi.server.hostname=XX.XXX.XX.XXX"

Tomcat提供了这些设置,但我无法连接到jmx。

JMX需要两个端口(已打开它们),在这种情况下它是端口14648和23208,因此将它们作为监听器添加到server.xml,如下所示:

<Listener className="org.apache.catalina.mbeans.JmxRemoteLifecycleListener" rmiRegistryPortPlatform="14648" rmiServerPortPlatform="23208" />

然后我在catalina.log中收到以下错误

12-Oct-2014 08:57:43.764 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:
  2.6.32-531.17.1.lve1.2.60.el6.x86_64
12-Oct-2014 08:57:43.764 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:
  amd64
12-Oct-2014 08:57:43.764 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:
  1.8.0_05-b13
12-Oct-2014 08:57:43.765 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:
  Oracle Corporation
12-Oct-2014 08:57:43.766 SEVERE [main] org.apache.tomcat.util.digester.Digester.startElement Begin event
threw exception
 java.lang.ClassNotFoundException: org.apache.catalina.mbeans.JmxRemoteLifecycleListener
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at org.apache.tomcat.util.digester.ObjectCreateRule.begin(ObjectCreateRule.java:116)
    at org.apache.tomcat.util.digester.Digester.startElement(Digester.java:1184)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Sour
ce)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknow
n Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.n
ext(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown So
urce)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
    at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1457)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:551)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:613)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:351)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:485)

12-Oct-2014 08:57:43.767 WARNING [main] org.apache.catalina.startup.Catalina.load Catalina.start using co
nf/server.xml: Error at (34, 67) : org.apache.catalina.mbeans.JmxRemoteLifecycleListener
12-Oct-2014 08:57:43.767 SEVERE [main] org.apache.catalina.startup.Catalina.start Cannot start server. Se
rver instance is not configured.

0 个答案:

没有答案