Commit ed7f4af
committed
Fix JMX MBean leak during Jetty restart cycle
Call MBeanContainer.destroy() in MBeanServerTracker.removedService() to
unregister all JMX MBeans before removing the event listener. Also move
the MBeanServerTracker cleanup in stopJetty() to before server.stop()
so MBeans are unregistered while the Server instance is still valid.
Without this fix, restarting Jetty leaves stale MBean registrations
(e.g. org.eclipse.jetty.server:type=server,id=0) in the platform
MBeanServer, causing an InstanceAlreadyExistsException on the next
startup cycle.1 parent 5d90911 commit ed7f4af
4 files changed
Lines changed: 14 additions & 12 deletions
File tree
- http
- jetty12/src/main/java/org/apache/felix/http/jetty/internal
- jetty/src/main/java/org/apache/felix/http/jetty/internal
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
245 | 245 | | |
246 | 246 | | |
247 | 247 | | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
248 | 254 | | |
249 | 255 | | |
250 | 256 | | |
| |||
255 | 261 | | |
256 | 262 | | |
257 | 263 | | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | 264 | | |
265 | 265 | | |
266 | 266 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
| |||
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
255 | 255 | | |
256 | 256 | | |
257 | 257 | | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
258 | 264 | | |
259 | 265 | | |
260 | 266 | | |
| |||
265 | 271 | | |
266 | 272 | | |
267 | 273 | | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | 274 | | |
275 | 275 | | |
276 | 276 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
| |||
0 commit comments