Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-dev] how to downgrade jetty-9 to jetty-8?

There is no ServerConnector in Jetty 8, that was introduced in Jetty 9, in preparation for HTTP/2 (and it was a good decision that has paid dividends for us).

Jetty 8 has a completely different connector architecture, the XML files you have for Jetty 9 are not compatible with Jetty 8.

There's also a different XML DOCTYPE/DTD between Jetty 8 and Jetty 9.

You'll have to maintain 2 different XMLs, one for Jetty 8 and a different set for Jetty 9.


--
Joakim Erdfelt <joakim@xxxxxxxxxxx>
Expert advice, services and support from from the Jetty & CometD experts

On Mon, Dec 8, 2014 at 12:49 AM, Uk Jo <verystrongjoe@xxxxxxxxx> wrote:
I implemented the jetty server to load 3 web application contexts. But many clients' system are using JDK 6. So I have to downgrade jetty 8. 
But I have to hurry to achieving this. Please let me know the shortcut for this. I implemented to load 3 webapplication contexts using xml and java program with jetty 9 version.  The below is what I implemented my source code recently. These source code have to be replaced to the one of version 8.  Help me. 
Detaily, Right now, I can't find org.eclipse.jetty.server.ServerConnector in jetty 8. How can I replace the logis related to this class?


 XmlConfiguration configuration = null;
Server server = null;
WebAppContext wac = null;
if(jettyConfigPath == null){ // running classpath
if(jettyConfPathList.contains("context/server/context-jetty-server.xml")) {
Resource server_xml = Resource.newResource(getFileinJar("context/server/context-jetty-server.xml").getAbsolutePath()      );
configuration = new XmlConfiguration(server_xml.getInputStream());
server = (Server) configuration.configure();
}
if(jettyConfPathList.contains("context/server/context-jetty-wac.xml")) {
Resource wac_xml = Resource.newResource(getFileinJar("context/server/context-jetty-wac.xml").getAbsolutePath()      );
configuration =  new XmlConfiguration(wac_xml.getInputStream());
wac = (WebAppContext) configuration.configure();
}
} else{ // running from file / system property was set.
configuration = new XmlConfiguration(new URL("file:" + jettyConfigPath + "/context-jetty-server.xml"));
server = (Server) configuration.configure();
configuration =  new XmlConfiguration(new URL("file:" + jettyConfigPath + "/context-jetty-wac.xml"));
wac = (WebAppContext) configuration.configure();
wac.setExtractWAR(false);
wac.setWar(webAppDir);s
}
wac.setWar(webAppDir);

HandlerCollection hc = new  HandlerCollection();

WebAppContext derbyWebapp = new WebAppContext();
derbyWebapp.setContextPath("/derby");
derbyWebapp.setWar(derbyWebAppDir);

        WebAppContext pluginServerWebapp = new WebAppContext();
        
        pluginServerWebapp.setContextPath( "/plugin.server");
        pluginServerWebapp.setWar(pluginServerWebAppDir);
        
        HashLoginService login = new HashLoginService();
        login.setName("RedcaRealm");
        login.setConfig("conf/jetty-realm.properties");
        login.setRefreshInterval(0);
        server.addBean(login);
    
hc.addHandler(wac);
hc.addHandler(derbyWebapp);
hc.addHandler(pluginServerWebapp);
server.setHandler(hc);

server.start();
server.join();

--
Success is a long continuous journey..
                                     - From Arnold

_______________________________________________
jetty-dev mailing list
jetty-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-dev


Back to the top