tc Server instance failed to start with error
WARNING: Unable to load server configuration from [<CATALINA_BASE>/conf/server.xml]
org.xml.sax.SAXParseException; systemId: file:<CATALINA_BASE>/conf/server.xml; lineNumber: 14; columnNumber: 31; Error at line [14] column [31]: [com.springsource.tcserver.serviceability.rmi.JmxSocketListener]
at org.apache.tomcat.util.digester.Digester.createSAXException(Digester.java:1953)
at org.apache.tomcat.util.digester.Digester.createSAXException(Digester.java:1985)
at org.apache.tomcat.util.digester.Digester.startElement(Digester.java:1267)
at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:518)
at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:183)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1387)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2726)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:605)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:542)
at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:889)
at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:825)
at java.xml/com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1224)
at java.xml/com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:637)
at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1522)
at org.apache.catalina.startup.Catalina.parseServerXml(Catalina.java:642)
at org.apache.catalina.startup.Catalina.load(Catalina.java:732)
at org.apache.catalina.startup.Catalina.load(Catalina.java:769)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
at java.base/java.lang.reflect.Method.invoke(Method.java:578)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:307)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:477)
Caused by: java.lang.ClassNotFoundException: com.springsource.tcserver.serviceability.rmi.JmxSocketListener
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
at org.apache.tomcat.util.digester.ObjectCreateRule.begin(ObjectCreateRule.java:102)
at org.apache.catalina.startup.ListenerCreateRule.begin(ListenerCreateRule.java:68)
at org.apache.tomcat.util.digester.Digester.startElement(Digester.java:1264)
... 19 more
tc Server 5.0.x - End of General Support date of December 31, 2024
tc Server 10.1.x or Later
.
This error is encountered after upgrading from tc Server 4.x.x to 5.0.x or later.
The JMXSocketListener class used by previous versions of VMware tc Server have been removed. This was removed starting with tc Server 5.0.x.
Note by default no JMX listener is provided with tc Server 5.0 or later.
1. Verify if JmxSocketListener is present in server.xml. If it is remove JMX configuration from server.xml (please see configuration line below)
<Listener accessFile="${catalina.base}/conf/jmxremote.access" address="127.0.0.1" authenticate="true" className="com.springsource.tcserver.serviceability.rmi.JmxSocketListener" passwordFile="${catalina.base}/conf/jmxremote.password" port="${base.jmx.port}" useSSL="false"/>
2. Add JMX configuration to catalina.properties via the templates
Use one the templates below to add the JMX configuration
For tc Server 5.0.x - End of General Support date of December 31, 2024
./tcserver apply-template -t <TEMPLATE> <INSTANCE_NAME>
For tc Server 10.1.x
./tc-server-10.1 apply-template -t <TEMPLATE> <INSTANCE_NAME>
For tc Server 11.0.x
./tc-server-11.0 apply-template -t <TEMPLATE> <INSTANCE_NAME>
Sample:
tanzu-tc-server-10.1.33.C $ ./tcserver-10.1 apply-template -t jmx-jaas test-jmx
Applying template 'jmx-jaas' to instance 'test-jmx'...
Creating bin/setenv.sh
Applying template 'jmx-jaas'
Setting permissions
Template applied
Connector summary
Port: 8080 Type: Non-Blocking IO Secure: false
The following lines are added to catalina.properties. Change values as needed.
#jmx-jaas
com.sun.management.jmxremote.port = 6969
com.sun.management.jmxremote.host = localhost
com.sun.management.jmxremote.rmi.port = 0
com.sun.management.jmxremote.local.port = 0
com.sun.management.jmxremote.local.only = true
com.sun.management.jmxremote.ssl = false
##Do not change this line, used my jmx-jaas template
com.sun.management.jmxremote.login.config = TcServerDecodeLoginModule
##Do not change this line, used my jmx-jaas template
java.security.auth.login.config = conf/tc-server-jmx-jaas-decode.config
tanzu-tc-server-10.1.33.C $ ./tcserver-10.1 apply-template -t jmx-jaas-ssl test-jmx-ssl
Applying template 'jmx-jaas-ssl' to instance 'test-jmx-ssl'...
Creating bin/setenv.sh
Applying template 'jmx-jaas-ssl'
Creating SSL artifacts
Generating SSL certificate and private key
Creating conf/tc-server-jmx-jaas-ssl.keystore
Setting permissions
Template applied
Connector summary
Port: 8080 Type: Non-Blocking IO Secure: false
The following lines are added to catalina.properties. Change values as needed.
#jmx-jaas
com.sun.management.jmxremote.port = 6969
com.sun.management.jmxremote.rmi.port = 6969
com.sun.management.jmxremote.local.port = 0
com.sun.management.jmxremote.local.only = false
com.sun.management.jmxremote.ssl = true
com.sun.management.jmxremote.registry.ssl = true
##Do not change this line, used my jmx-jaas template
com.sun.management.jmxremote.login.config = TcServerDecodeLoginModule
##Do not change this line, used my jmx-jaas template
java.security.auth.login.config = conf/tc-server-jmx-jaas-decode.config
com.sun.management.jmxremote.ssl.need.client.auth = true
javax.net.ssl.keyStore = conf/tc-server-jmx-jaas-ssl.keystore
javax.net.ssl.keyStorePassword = <password>
javax.net.ssl.trustStore = conf/tc-server-jmx-jaas-ssl.keystore
javax.net.ssl.trustStorePassword = <password>
Note: Please configure the keystore to use your own certificates as needed.
3. Review and remove old jmx configuration from catalina.properties i.e base.jmx.port
4. Delete jmx Password File located at ${catalina.base}/conf/jmxremote.password