powered by Jive Software

HttpBindManger class getContexts() method removed

Hi all,
I am new to Openfire, working on openfire 3.10.3 later updated to 4.1.6 in this version i ran NoSuchMethod find error at HttpBindManager getContexts(). What is the alternate way to register my plugin with httpbindmanager
Currently my code is below

public void initializePlugin(PluginManager manager, File pluginDirectory) {
log.info(“Initializing NICE CLS DB Migration Plugin”);
ContextHandlerCollection contexts = HttpBindManager.getInstance().getContexts();

    try {
        WebAppContext context = new WebAppContext(contexts, pluginDirectory.getPath(), "/name");
        context.setWelcomeFiles(new String[]{"readme.html"});
        log.info(context.getContextPath());
    } catch (Exception e) {
        log.error("Error initializing webcontext for Migration Plugin", e);
    } 

is any one can help me how to register my plugin with HttpBindManager in latest version

Thanks in advance

Finally i got it my plugin working fine, The code is

ServletContextHandler contexts = new WebAppContext(null, pluginDirectory.getPath(), “/vraudit”);
contexts.setClassLoader(this.getClass().getClassLoader());

		// Ensure the JSP engine is initialized correctly (in order to be able to cope with Tomcat/Jasper precompiled JSPs).
		final List<ContainerInitializer> initializers2 = new ArrayList<>();
		initializers2.add(new ContainerInitializer(new JettyJasperInitializer(), null));
		contexts.setAttribute("org.eclipse.jetty.containerInitializers", initializers2);
		contexts.setAttribute(InstanceManager.class.getName(), new SimpleInstanceManager());
		contexts.setWelcomeFiles(new String[]{"index.jsp"});
		HttpBindManager.getInstance().addJettyHandler(contexts);