|
28 | 28 | import org.jivesoftware.openfire.http.HttpBindManager; |
29 | 29 |
|
30 | 30 | import java.io.File; |
| 31 | +import java.util.*; |
31 | 32 |
|
32 | 33 | import org.slf4j.Logger; |
33 | 34 | import org.slf4j.LoggerFactory; |
34 | 35 |
|
| 36 | +import org.eclipse.jetty.apache.jsp.JettyJasperInitializer; |
| 37 | +import org.eclipse.jetty.plus.annotation.ContainerInitializer; |
35 | 38 | import org.eclipse.jetty.server.handler.ContextHandlerCollection; |
36 | 39 | import org.eclipse.jetty.webapp.WebAppContext; |
37 | 40 | import org.eclipse.jetty.util.security.*; |
|
46 | 49 | import com.javamonitor.openfire.mbeans.Openfire; |
47 | 50 | import com.javamonitor.openfire.mbeans.PacketCounter; |
48 | 51 |
|
| 52 | +import org.apache.tomcat.InstanceManager; |
| 53 | +import org.apache.tomcat.SimpleInstanceManager; |
49 | 54 |
|
50 | 55 | public class JmxWebPlugin implements Plugin { |
51 | 56 |
|
@@ -115,10 +120,19 @@ public void initializePlugin(PluginManager manager, File pluginDirectory) { |
115 | 120 | try { |
116 | 121 | Log.info( "["+ NAME + "] starting jolokia"); |
117 | 122 | WebAppContext context = new WebAppContext(contexts, pluginDirectory.getPath(), "/jolokia"); |
| 123 | + |
| 124 | + final List<ContainerInitializer> initializers = new ArrayList<>(); |
| 125 | + initializers.add(new ContainerInitializer(new JettyJasperInitializer(), null)); |
| 126 | + context.setAttribute("org.eclipse.jetty.containerInitializers", initializers); |
| 127 | + context.setAttribute(InstanceManager.class.getName(), new SimpleInstanceManager()); |
118 | 128 | context.setWelcomeFiles(new String[]{"index.html"}); |
119 | 129 |
|
120 | 130 | Log.info( "["+ NAME + "] starting hawtio"); |
121 | 131 | WebAppContext context2 = new WebAppContext(contexts, pluginDirectory.getPath() + "/hawtio", "/hawtio"); |
| 132 | + final List<ContainerInitializer> initializers2 = new ArrayList<>(); |
| 133 | + initializers2.add(new ContainerInitializer(new JettyJasperInitializer(), null)); |
| 134 | + context2.setAttribute("org.eclipse.jetty.containerInitializers", initializers2); |
| 135 | + context2.setAttribute(InstanceManager.class.getName(), new SimpleInstanceManager()); |
122 | 136 | context2.setWelcomeFiles(new String[]{"index.html"}); |
123 | 137 |
|
124 | 138 | if (JiveGlobals.getBooleanProperty("xmpp.jmx.secure", true)) |
|
0 commit comments