mock-server / mockserver-maven-plugin

A maven plugin to start and stop the MockServer http://www.mock-server.com
Apache License 2.0
11 stars 5 forks source link

[JMX] Difficulties to profile with VisualVM #3

Closed MahatmaFatalError closed 4 years ago

MahatmaFatalError commented 4 years ago

Describe the issue Something is wrong when you try to connect VisualVM to the Mockservers JVM when it is started via mockserver-maven-plugin.

What you are trying to do Profile a memory issue

MockServer version 5.10.0

To Reproduce Steps to reproduce the issue:

start via mvn mockserver:run and connect to this process with VisualVM 2.0.2

Expected behaviour VisualVM connects to the process

MockServer Log

❯ mvn mockserver:run
[INFO] Scanning for projects...
[INFO]
[INFO] --------------------< com.acme:my-mockserver >---------------------
[INFO] Building my-mockserver 0.0.1
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- mockserver-maven-plugin:5.10.0:run (default-cli) @ my-mockserver ---
[INFO] mockserver:run about to start MockServer on:  serverPort [8080]
[INFO] started on port: 8080
Can't load log handler "org.mockserver.logging.StandardOutConsoleHandler"
java.lang.ClassNotFoundException: org.mockserver.logging.StandardOutConsoleHandler
java.lang.ClassNotFoundException: org.mockserver.logging.StandardOutConsoleHandler
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
    at java.logging/java.util.logging.LogManager.createLoggerHandlers(LogManager.java:1000)
    at java.logging/java.util.logging.LogManager$4.run(LogManager.java:970)
    at java.logging/java.util.logging.LogManager$4.run(LogManager.java:966)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.logging/java.util.logging.LogManager.loadLoggerHandlers(LogManager.java:966)
    at java.logging/java.util.logging.LogManager.initializeGlobalHandlers(LogManager.java:2417)
    at java.logging/java.util.logging.LogManager$RootLogger.accessCheckedHandlers(LogManager.java:2511)
    at java.logging/java.util.logging.Logger.log(Logger.java:975)
    at java.logging/java.util.logging.Logger.doLog(Logger.java:1006)
    at java.logging/java.util.logging.Logger.logp(Logger.java:1172)
    at java.rmi/sun.rmi.runtime.Log$LoggerLog.log(Log.java:221)
    at java.rmi/sun.rmi.transport.tcp.TCPEndpoint.<clinit>(TCPEndpoint.java:141)
    at java.rmi/sun.rmi.transport.LiveRef.<init>(LiveRef.java:103)
    at java.rmi/sun.rmi.transport.LiveRef.<init>(LiveRef.java:85)
    at java.rmi/sun.rmi.server.UnicastServerRef2.<init>(UnicastServerRef2.java:92)
    at jdk.management.agent/sun.management.jmxremote.ConnectorBootstrap$PermanentExporter.exportObject(ConnectorBootstrap.java:201)
    at java.management.rmi/javax.management.remote.rmi.RMIJRMPServerImpl.export(RMIJRMPServerImpl.java:153)
    at java.management.rmi/javax.management.remote.rmi.RMIJRMPServerImpl.export(RMIJRMPServerImpl.java:138)
    at java.management.rmi/javax.management.remote.rmi.RMIConnectorServer.start(RMIConnectorServer.java:473)
    at jdk.management.agent/sun.management.jmxremote.ConnectorBootstrap.startLocalConnectorServer(ConnectorBootstrap.java:559)
    at jdk.management.agent/jdk.internal.agent.Agent.startLocalManagementAgent(Agent.java:318)

VisualVM hangs for a while (not responding several minutes) and then recovers and eventually connects to the process.

grafik
jamesdbloom commented 4 years ago

Can you please retest this issue in the latest version because I can't reproduce this with the following command and opening VisualVM.

./mvnw -Dmockserver.serverPort=1080 org.mock-server:mockserver-maven-plugin:5.11.1:run
jamesdbloom commented 4 years ago

Closing due to inactivity

wein98 commented 1 year ago

@jamesdbloom Can we revive this issue? We are currently facing this error whenever we compile and run as a .jar file. Can you help to look into this?

cah-kanagavelu-sugumar commented 10 months ago

Yes I am also facing this issue while running the jar file. And same like mentioned here https://stackoverflow.com/questions/72281701/java-lang-classnotfoundexception-org-mockserver-version-version