Skip to main content



      Home
Home » Newcomers » Newcomers » How to set connection timeout with Jetty 9.2.10?(Unable to set connection timeout using Jetty and Scalatra)
How to set connection timeout with Jetty 9.2.10? [message #1712629] Mon, 26 October 2015 19:21 Go to next message
Eclipse UserFriend
I am using Scalatra 2.4 with Jetty 9.2.10 and I am unable to set the connection timeout to 60 seconds.

I have tried both by adding the following to the web.xml

<session-config>
  <session-timeout>60</session-timeout>
</session-config>

and by using connector.setIdleTimeout

def main(args: Array[String]) {
    val server: Server = new Server
    val http_config: HttpConfiguration = new HttpConfiguration
    val connector: ServerConnector = new ServerConnector(server, new HttpConnectionFactory(http_config))
    val context: WebAppContext = new WebAppContext
    connector.setPort(8099)
    connector.setIdleTimeout(60000)
    context setContextPath "/"
    context.setResourceBase("src/main/webapp")
    context.addEventListener(new ScalatraListener)
    context.addServlet(classOf[DefaultServlet], "/")
    server.setConnectors(Array(connector))
    server.setHandler(context)
    server.start()
    server.join()
  }

still, the connection with return Gateway timeout after 30 seconds.

Can somebody tell me what am I doing wrong? Thanks!
Re: How to set connection timeout with Jetty 9.2.10? [message #1712945 is a reply to message #1712629] Thu, 29 October 2015 09:50 Go to previous messageGo to next message
Eclipse UserFriend
Jetty has a mailing group for support. Check them out. They could
probably help.

On 10/26/2015 08:02 PM, Roberto Arnetoli wrote:
> I am using Scalatra 2.4 with Jetty 9.2.10 and I am unable to set the
> connection timeout to 60 seconds.
>
> I have tried both by adding the following to the web.xml
>
> <session-config>
> <session-timeout>60</session-timeout>
> </session-config>
> and by using connector.setIdleTimeout
>
> def main(args: Array[String]) {
> val server: Server = new Server
> val http_config: HttpConfiguration = new HttpConfiguration
> val connector: ServerConnector = new ServerConnector(server, new
> HttpConnectionFactory(http_config))
> val context: WebAppContext = new WebAppContext
> connector.setPort(8099)
> connector.setIdleTimeout(60000)
> context setContextPath "/"
> context.setResourceBase("src/main/webapp")
> context.addEventListener(new ScalatraListener)
> context.addServlet(classOf[DefaultServlet], "/")
> server.setConnectors(Array(connector))
> server.setHandler(context)
> server.start()
> server.join()
> }
> still, the connection with return Gateway timeout after 30 seconds.
>
> Can somebody tell me what am I doing wrong? Thanks!
Re: How to set connection timeout with Jetty 9.2.10? [message #1713032 is a reply to message #1712945] Fri, 30 October 2015 00:02 Go to previous message
Eclipse UserFriend
Thanks. I will try
Previous Topic:why the plugins info is kept even the IDE is removed
Next Topic:changing a project's location w/o moving it
Goto Forum:
  


Current Time: Wed May 07 09:06:13 EDT 2025

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

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

Back to the top