https://bz.apache.org/bugzilla/show_bug.cgi?id=68858

            Bug ID: 68858
           Summary: version.sh only working if tomcat is stopped
           Product: Tomcat 9
           Version: 9.0.86
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: minor
          Priority: P2
         Component: Util
          Assignee: dev@tomcat.apache.org
          Reporter: stephan.weintr...@gmail.com
  Target Milestone: -----

version.sh only shows the version if, the server is stopped:


$ /opt/tomcat/bin/version.sh
Using CATALINA_BASE:   /opt/tomcat
Using CATALINA_HOME:   /opt/tomcat
Using CATALINA_TMPDIR: /opt/tomcat/temp
Using JRE_HOME:        /usr/lib/jvm/jre-1.8.0-openjdk
Using CLASSPATH:      
/opt/tomcat/log4j2/lib/*:/opt/tomcat/log4j2/conf:/opt/tomcat/bin/bootstrap.jar:/opt/tomcat/bin/tomcat-juli.jar
Using CATALINA_OPTS:    -Djava.awt.headless=true -server -XX:+UseParallelGC
Exception in thread "main" java.lang.reflect.InvocationTargetException
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
                at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                at java.lang.reflect.Method.invoke(Method.java:498)
                at
sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:386)
                at
sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:401)
Caused by: java.net.BindException: Address already in use
                at sun.nio.ch.Net.bind0(Native Method)
                at sun.nio.ch.Net.bind(Net.java:461)
                at sun.nio.ch.Net.bind(Net.java:453)
                at
sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:222)
                at
sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:85)
                at sun.net.httpserver.ServerImpl.<init>(ServerImpl.java:141)
                at
sun.net.httpserver.HttpServerImpl.<init>(HttpServerImpl.java:50)
                at
sun.net.httpserver.DefaultHttpServerProvider.createHttpServer(DefaultHttpServerProvider.java:35)
                at
com.sun.net.httpserver.HttpServer.create(HttpServer.java:130)
                at
io.prometheus.jmx.shaded.io.prometheus.client.exporter.HTTPServer$Builder.build(HTTPServer.java:365)
                at
io.prometheus.jmx.common.http.HTTPServerFactory.createHTTPServer(HTTPServerFactory.java:123)
                at io.prometheus.jmx.JavaAgent.premain(JavaAgent.java:60)
                ... 6 more
FATAL ERROR in native method: processing of -javaagent failed
/opt/tomcat/bin/catalina.sh: line 659: 2368874 Aborted                 (core
dumped) "/usr/lib/jvm/jre-1.8.0-openjdk/bin/java" -Xms2048M -Xmx2048M
-Djava.net.preferIPv4Stack=true -Djava.security.egd=file:/dev/./urandom
-javaagent:/opt/jmx_exporter/jmx_exporter-0.20.0.jar=9404:/opt/jmx_exporter/jmx_exporter.yaml
-Djdk.tls.ephemeralDHKeySize=2048
-Djava.protocol.handler.pkgs=org.apache.catalina.webresources
-Dorg.apache.catalina.security.SecurityListener.UMASK=0027 -classpath
"/opt/tomcat/lib/catalina.jar" org.apache.catalina.util.ServerInfo

$ sudo systemctl stop tomcat.service
$ /opt/tomcat/bin/version.sh
Using CATALINA_BASE:   /opt/tomcat
Using CATALINA_HOME:   /opt/tomcat
Using CATALINA_TMPDIR: /opt/tomcat/temp
Using JRE_HOME:        /usr/lib/jvm/jre-1.8.0-openjdk
Using CLASSPATH:      
/opt/tomcat/log4j2/lib/*:/opt/tomcat/log4j2/conf:/opt/tomcat/bin/bootstrap.jar:/opt/tomcat/bin/tomcat-juli.jar
Using CATALINA_OPTS:    -Djava.awt.headless=true -server -XX:+UseParallelGC
Server version: Apache Tomcat/9.0.86
Server built:   Feb 14 2024 08:15:12 UTC
Server number:  9.0.86.0
OS Name:        Linux
OS Version:     5.14.0-362.24.1.el9_3.x86_64
Architecture:   amd64
JVM Version:    1.8.0_402-b06
JVM Vendor:     Red Hat, Inc.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to