Closed glassfishrobot closed 8 years ago
Reported by kristian.rosenvold
kristian.rosenvold said: The error message upon second registration is:
ava.lang.IllegalArgumentException: WARNING: GMBAL00609: Object org.glassfish.grizzly.http.server.jmx.HttpServer@3e53fbde is already registered as MBeanImpl[type=HttpServer,name=XXZZ,oname=org.glassfish.grizzly:pp=/gmbal-root,type=HttpServer,name=XXZZ]
Stack trace for failing second registration is:
at org.glassfish.gmbal.impl.MBeanTree.register(MBeanTree.java:366) at org.glassfish.gmbal.impl.ManagedObjectManagerImpl.register(ManagedObjectManagerImpl.java:707) at org.glassfish.gmbal.impl.ManagedObjectManagerImpl.registerAtRoot(ManagedObjectManagerImpl.java:721) at org.glassfish.grizzly.monitoring.jmx.DefaultJmxManager.registerAtRoot(DefaultJmxManager.java:79) at org.glassfish.grizzly.monitoring.jmx.DefaultJmxManager.registerAtRoot(DefaultJmxManager.java:53) at org.glassfish.grizzly.http.server.HttpServer.enableJMX(HttpServer.java:612) at org.glassfish.grizzly.http.server.HttpServer.start(HttpServer.java:272)
kristian.rosenvold said: Testcase to reproduce:
Ensure org.glassfish.grizzly.monitoring.jmx.DefaultJmxManager is on classpath:
@Test
public void startTwice() throws IOException {
HttpServer server = createServer();
server.start();
server.shutdown();
HttpServer server2 = createServer();
server2.start();
server2.shutdown();
}
private HttpServer createServer() {
HttpServer server2 = new HttpServer();
ServerConfiguration serverConfiguration2 = server2.getServerConfiguration();
serverConfiguration2.setName("fizzbuzz");
serverConfiguration2.setJmxEnabled(true);
return server2;
}
@rlubke said: The root of the issue is that the logic assumes there will be listeners which will be shutdown and ultimately call shutdownNow() on the HttpServer instance. In this case, there are no listeners, so the JMX tear-down logic isn't invoked.
This is certainly an edge case, but I've added logic to deal with it. Tests are running now. If all goes well, will commit the changes.
@rlubke said: Changes applied:
2.3.x: b04f6572b80593b65eb241b6fa01c3902756a35e master: 765f6917e9ac24b4cb9e43a90f979dac53de57ba
This issue was imported from java.net JIRA GRIZZLY-1835
Marked as fixed on Tuesday, June 14th 2016, 10:17:58 pm
Calling shutdownNow causes proper deregistration of JMX beans. Calling just "shutDown" will not deregister the beans, so if you try to restart the same application within the same JVM you will get an error.
Affected Versions
[2.3.24]