Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-dev] Jetty Server Migration from 5.1.1 to Jetty 9

Hi Greg,

I'm migrating the application from Jetty 6.1.19 to Jetty-9.1.1. I have few doubts in the code used to start the server. The existing code in Jetty6 uses webAppDeployer to deploy but the same class is replaced by webAppProvider in jetty-9.

In the below code from Jetty6 , when I change to Jetty 9, I have few doubts written near to code lines,

    this.jettyWebServer = new Server(); --->

        ThreadPool threadPool = new ThreadPool(threadPoolSize); -> ThreadPool class not available .    .         only ThreadPool interface in Jetty9( can we use QueueThreadPool in jetty9)

        jettyWebServer.setThreadPool(threadPool);
      
        Connector connector = new SelectChannelConnector(); --> SelectChannelConnector not avialble in jetty9, any alternative for this class ?

        connector.setPort(port);  --> connector will be ServerConnector ?

        this.jettyWebServer.setConnectors(new Connector[]{connector});

 

        WebAppDeployer webAppDeployer = new WebAppDeployer(); -> webAppProvider  ?

        webAppDeployer.setContexts(this.jettyWebServer);

        webAppDeployer.setWebAppDir(warpath); --> no method in webAppProvider  to set WebAppDir

        webAppDeployer.setExtract(true);

        webAppDeployer.setParentLoaderPriority(true);

        webAppDeployer.start();

        this.jettyWebServer.setStopAtShutdown(true);

        this.jettyWebServer.setSendServerVersion(false);
       
       this.jettyWebServer.start();

        this.jettyWebServer.join();

Is the code above is enough to start Jetty-9 ?. or anything missing ?.

Thanks,
Arun

On Tue, Aug 4, 2015 at 2:28 AM, Greg Wilkins <gregw@xxxxxxxxxxx> wrote:
HttpServer -> org/eclipse/jetty/server/Server
HttpContext -> org/eclipse/jetty/server/handler/ContextHandler
SocketListener -> org/eclipse/jetty/server/ServerConnector

cheers


On 4 August 2015 at 01:33, Arun Kumar <arunkumarstay@xxxxxxxxx> wrote:
Hi Greg,

Thanks for the reply. I'm referring the link you shared. But the main issue I'm facing is unable to replace the package "org.mortbay.html ". The existing code using classes from html package.
Could you please help to find out these html classes in Jetty 9. Any alternative on this.

Also some classes in like HttpContext, HttpServer, SocketListener are not found in "org.eclipse.jetty.http" package. Please help me on this .

Thanks,
Arun

On Mon, Aug 3, 2015 at 7:49 AM, Greg Wilkins <gregw@xxxxxxxxxxx> wrote:

Arun,

have a look at the doco for porting from jetty 6 to jetty 7, as that has the big name changes in it:

 https://wiki.eclipse.org/Jetty/Starting/Porting_to_Jetty_7

So while a port from 5 to 9 will be different, the bulk of the changes needed will be described in the 6 to 7 transformation.

cheers



On 3 August 2015 at 03:12, Arun Kumar <arunkumarstay@xxxxxxxxx> wrote:
Hi Friends,

I'm migrating a Java application from Jetty Server 5.1.1 to Jetty 9. In the existing project I can see only one jar file related to
Jetty 5(org.mortbay.Jetty 5.1.1) .

I have downloaded Jetty-all -9.0 jar and build the project. But some of the packages in existing code shows compile error since the packages in org.mortbay.Jetty in 5.1 changed to org.eclipse,jetty in version 9.

My code is using some imports like org.mortbay.http.HttpServer, org.mortbay.http.HttpContext. I'm unable to see the similar packages in Jetty-all-9.0.jar.

Also package  'org.mortbay.html'  needs to replace with similar classes in Jetty 9.

Could someone help me to fix these compile errors ?. Which are the new classes and packages in Jetty9?.

Is the procedure I'm following is correct for Jetty 9 ?.


Thanks,
Arun

_______________________________________________
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


_______________________________________________
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


_______________________________________________
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


_______________________________________________
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