diff --git a/jarlotte-jettyinitializer/pom.xml b/jarlotte-jettyinitializer/pom.xml index e83be31..6100113 100644 --- a/jarlotte-jettyinitializer/pom.xml +++ b/jarlotte-jettyinitializer/pom.xml @@ -34,6 +34,11 @@ apache-jsp ${jetty.version} + + org.eclipse.jetty + jetty-jmx + ${jetty.version} + de.metacoder jarlotte-api diff --git a/jarlotte-jettyinitializer/src/main/java/de/metacoder/jarlotte/jettyinitializer/Initializer.java b/jarlotte-jettyinitializer/src/main/java/de/metacoder/jarlotte/jettyinitializer/Initializer.java index bf34475..dfa62d9 100644 --- a/jarlotte-jettyinitializer/src/main/java/de/metacoder/jarlotte/jettyinitializer/Initializer.java +++ b/jarlotte-jettyinitializer/src/main/java/de/metacoder/jarlotte/jettyinitializer/Initializer.java @@ -15,12 +15,15 @@ package de.metacoder.jarlotte.jettyinitializer; import de.metacoder.jarlotte.api.JarlotteInitializer; +import org.eclipse.jetty.jmx.MBeanContainer; import org.eclipse.jetty.server.Server; +import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.webapp.Configuration; import org.eclipse.jetty.webapp.WebAppClassLoader; import org.eclipse.jetty.webapp.WebAppContext; import java.io.File; +import java.lang.management.ManagementFactory; public class Initializer implements JarlotteInitializer { @@ -42,6 +45,11 @@ public void initialize(File webAppDir) { server = new Server(jettyPort); + MBeanContainer mbContainer=new MBeanContainer(ManagementFactory.getPlatformMBeanServer()); + server.addEventListener(mbContainer); + server.addBean(mbContainer); + server.addBean(Log.getLog()); + // required for working JSPs final Configuration.ClassList classlist = Configuration.ClassList.setServerDefault( server ); classlist.addBefore("org.eclipse.jetty.webapp.JettyWebXmlConfiguration", "org.eclipse.jetty.annotations.AnnotationConfiguration");