Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Jetty response two http head in one request(Jetty response two http head in one request)
Jetty response two http head in one request [message #1803543] Mon, 04 March 2019 03:29 Go to next message
zhu liang is currently offline zhu liangFriend
Messages: 3
Registered: March 2019
Junior Member
Hi:

My project use Jetty as a HTTP server.Last year,a problem occurred.
Jetty response two HTTP head in one request,,
and it happened three times.

The first head is:
HTTP/1.1 200 OK
Content-Length: 0

Now ,I add some code in org.eclipse.jetty.io.nio.ChannelEndPoint.gatheringFlush()
while the data contains "Content-Length: 0" I invoke Thread.dumpstack().
The attachments are the network data capture.
How can i resolve the problem ?
thanks
Jetty version 8.1.9-20130131
JDK version 1.6.0.32
OS version Red Hat Enterprise Linux Server release 5.3
Here is my server code:(I use nio)
 Server server = new Server();
 SelectChannelConnector selectConnector = new SelectChannelConnector();
                    	 selectConnector.setSoLingerTime(0);
                         selectConnector.setReuseAddress(true);
                         selectConnector.setRequestBufferSize(2048);
                         selectConnector.setResponseBufferSize(2048);

                         selectConnector.setLowResourcesConnections(2000);
                         selectConnector.setAcceptQueueSize(2000);
                         selectConnector.setPort(portNumber);
//                         selectConnector.setAcceptors(3);
                         log.debug("defaut add servlet mapping with JettyThreadPool : " +  150);
                         selectConnector.setThreadPool( new JettyThreadPool(150) );
                         server.setConnectors(new Connector[]{selectConnector});
                 ServletContextHandler handler = new ServletContextHandler();
                 //contextHandler.setContextPath(contextPath);
                 handler.setContextPath("/");
                 server.setHandler(handler);
                 SessionHandler sessionHandler = new SessionHandler();
                 ServletHandler servletHandler = new ServletHandler();
                 sessionHandler.setHandler(servletHandler);
                 handler.setServletHandler(servletHandler);
                 server.setStopAtShutdown(true);
                 server.setSendServerVersion(sendServerVersion);
                 server.start();
         ServletHolder holder = new ServletHolder(servlet);

         servletHandler.addServlet(holder);

         ServletMapping mapping = new ServletMapping();
         mapping.setServletName(holder.getName());
         String path = uri.getPath();

         if (!path.startsWith("/")) {
             path = '/' + path;
         }

         if (!path.startsWith(contextPath)) {
             path = contextPath + path;
         }

         mapping.setPathSpec(path);
         servletHandler.addServletMapping(mapping);
  • Attachment: ddd.JPG
    (Size: 154.79KB, Downloaded 103 times)
  • Attachment: ssss.JPG
    (Size: 75.45KB, Downloaded 77 times)

[Updated on: Mon, 04 March 2019 04:42]

Report message to a moderator

Re: Jetty response two http head in one request [message #1803544 is a reply to message #1803543] Mon, 04 March 2019 05:19 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33133
Registered: July 2009
Senior Member
It's probably better to ask on the Jetty Users' mailing list as appears in the community section of https://www.eclipse.org/jetty/documentation/current/advanced-contributing.html#community

Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Jetty response two http head in one request [message #1803545 is a reply to message #1803544] Mon, 04 March 2019 05:25 Go to previous messageGo to next message
zhu liang is currently offline zhu liangFriend
Messages: 3
Registered: March 2019
Junior Member
I want to find a jetty 8 bug list,but I can't find it .Is there any body knows where it is ?
Re: Jetty response two http head in one request [message #1803547 is a reply to message #1803545] Mon, 04 March 2019 05:53 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33133
Registered: July 2009
Senior Member
Their home page has an Enter Bug link https://github.com/eclipse/jetty.project/issues/new and a Reported Bugs link https://github.com/eclipse/jetty.project/issues

Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Jetty response two http head in one request [message #1803549 is a reply to message #1803547] Mon, 04 March 2019 06:41 Go to previous messageGo to next message
zhu liang is currently offline zhu liangFriend
Messages: 3
Registered: March 2019
Junior Member
Thanks very much.Buthttps://github.com/eclipse/jetty.project/issuesonly has issues after 2016.Issues before 2016 maybe in other website, I think because of the Jetty project move to git in 2016
Re: Jetty response two http head in one request [message #1803560 is a reply to message #1803549] Mon, 04 March 2019 08:45 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33133
Registered: July 2009
Senior Member
Likely it used Bugzilla at an earlier point (bugs.eclipse.org). Best to ask the Jetty developers/users...

Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Exporting Runnable Jar
Next Topic:WindowsBuilder getClass exposure old version netbeans
Goto Forum:
  


Current Time: Thu Apr 18 09:06:55 GMT 2024

Powered by FUDForum. Page generated in 0.03390 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top