Folks,

Thanks to Greg Wilkins (Jetty author) who helped out with this, the
RunWebApp.scala file should look like:
import _root_.org.mortbay.jetty.Connector
import _root_.org.mortbay.jetty.Server
import _root_.org.mortbay.jetty.webapp.WebAppContext
import org.mortbay.jetty.nio._

object RunWebApp extends Application {
  val server = new Server
  val scc = new SelectChannelConnector
  scc.setPort(8080)
  server.setConnectors(Array(scc))

  val context = new WebAppContext()
  context.setServer(server)
  context.setContextPath("/")
  context.setWar("src/main/webapp")

  server.addHandler(context)

  try {
    println(">>> STARTING EMBEDDED JETTY SERVER, PRESS ANY KEY TO STOP")
    server.start()
    while (System.in.available() == 0) {
      Thread.sleep(5000)
    }
    server.stop()
    server.join()
  } catch {
    case exc : Exception => {
      exc.printStackTrace()
      System.exit(100)
    }
  }
}

Using the SelectChangeConnector fixes the problem.

I've updated the Lift source.

Thanks,

David

2009/6/4 David Pollak <feeder.of.the.be...@gmail.com>

>
>
> 2009/6/4 feelgood <asseliva...@gmail.com>
>
>>
>> How can I share my sources? By the way, I use 1.1-SNAPSHOT version of
>> Lift
>>
>
> You can mail them to me off-list or post a project on GitHub
>
>
>>
>>
>> On 4 июн, 02:15, David Pollak <feeder.of.the.be...@gmail.com> wrote:
>> > I just tested against 6.1.18 and it works just fine.
>> >
>> > Can you post the source of your failing app and a link to your version
>> of
>> > Jetty and I'll track it down?
>> >
>> > Thanks,
>> >
>> > David
>> >
>> > On Wed, Jun 3, 2009 at 12:19 PM, feelgood <asseliva...@gmail.com>
>> wrote:
>> >
>> > > I just copied comet sample named "Clock" from the p. 142 of the
>> > > liftbook into my app. It doesn't work. First time it renders timestamp
>> > > normally, but since 10 seconds:
>> >
>> > > WARN - Request for /comet_request/58946720417/1ha35q9iqp4el failed
>> > > Bail
>> > > java.lang.Exception: Bail
>> > >        at
>> net.liftweb.http.LiftRules$.doContinuation(LiftRules.scala:436)
>> > >        at
>> net.liftweb.http.LiftServlet.setupContinuation(LiftServlet.scala:
>> > > 352)
>> > >        at
>> net.liftweb.http.LiftServlet.handleComet(LiftServlet.scala:363)
>> > >        at net.liftweb.http.LiftServlet.net$liftweb$http$LiftServlet$
>> > > $dispatchStatefulRequest(LiftServlet.scala:232)
>> > >        at
>> net.liftweb.http.LiftServlet$$anonfun$2.apply(LiftServlet.scala:
>> > > 155)
>> > >        at
>> net.liftweb.http.LiftServlet$$anonfun$2.apply(LiftServlet.scala:
>> > > 155)
>> > >        at
>> net.liftweb.http.S$.net$liftweb$http$S$$wrapQuery(S.scala:908)
>> > >        at
>> > > net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_nest2InnerInit$1$
>> > > $anonfun$apply$18.apply(S.scala:1026)
>> > >        at
>> net.liftweb.http.S$.net$liftweb$http$S$$doAround(S.scala:845)
>> > >        at
>> net.liftweb.http.S$$anonfun$net$liftweb$http$S$$doAround$1.apply
>> > > (S.scala:846)
>> > >        at net.liftweb.mapper.DB$$anon$1.net
>> > > $liftweb$mapper$DB$$anon$$doWith
>> > > (DB.scala:117)
>> > >        at
>> > > net.liftweb.mapper.DB$$anon$1$$anonfun$net$liftweb$mapper$DB$$anon$
>> > > $doWith$1.apply(DB.scala:118)
>> > >        at
>> > > net.liftweb.mapper.DB$$anon$1$$anonfun$net$liftweb$mapper$DB$$anon$
>> > > $doWith$1.apply(DB.scala:118)
>> > >        at net.liftweb.mapper.DB$.use(DB.scala:305)
>> > >        at net.liftweb.mapper.DB$$anon$1.net
>> > > $liftweb$mapper$DB$$anon$$doWith
>> > > (DB.scala:118)
>> > >        at net.liftweb.mapper.DB$$anon$1.apply(DB.scala:124)
>> > >        at
>> net.liftweb.http.S$.net$liftweb$http$S$$doAround(S.scala:846)
>> > >        at
>> net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_nest2InnerInit
>> > > $1.apply(S.scala:1024)
>> > >        at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
>> > >        at
>> net.liftweb.http.S$.net$liftweb$http$S$$_nest2InnerInit(S.scala:
>> > > 1023)
>> > >        at
>> net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit$1$
>> > > $anonfun$apply$21$$anonfun$apply$22$$anonfun$apply$23$$anonfun$apply
>> > > $24$$anonfun$apply$25$$anonfun$apply$26.apply(S.scala:1044)
>> > >        at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
>> > >        at
>> net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit$1$
>> > > $anonfun$apply$21$$anonfun$apply$22$$anonfun$apply$23$$anonfun$apply
>> > > $24$$anonfun$apply$25.apply(S.scala:1043)
>> > >        at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
>> > >        at
>> net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit$1$
>> > > $anonfun$apply$21$$anonfun$apply$22$$anonfun$apply$23$$anonfun$apply
>> > > $24.apply(S.scala:1042)
>> > >        at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
>> > >        at
>> net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit$1$
>> > > $anonfun$apply$21$$anonfun$apply$22$$anonfun$apply$23.apply(S.scala:
>> > > 1041)
>> > >        at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
>> > >        at
>> net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit$1$
>> > > $anonfun$apply$21$$anonfun$apply$22.apply(S.scala:1040)
>> > >        at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
>> > >        at
>> net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit$1$
>> > > $anonfun$apply$21.apply(S.scala:1039)
>> > >        at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
>> > >        at
>> > > net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit$1.apply
>> > > (S.scala:1038)
>> > >        at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
>> > >        at
>> net.liftweb.http.S$.net$liftweb$http$S$$_innerInit(S.scala:1037)
>> > >        at
>> net.liftweb.http.S$$anonfun$_init$1$$anonfun$apply$29$$anonfun
>> > > $apply$30$$anonfun$apply$31$$anonfun$apply$32.apply(S.scala:1068)
>> > >        at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
>> > >        at
>> net.liftweb.http.S$$anonfun$_init$1$$anonfun$apply$29$$anonfun
>> > > $apply$30$$anonfun$apply$31.apply(S.scala:1067)
>> > >        at net.liftweb.http.RequestVarHandler$.apply(Vars.scala:191)
>> > >        at
>> net.liftweb.http.S$$anonfun$_init$1$$anonfun$apply$29$$anonfun
>> > > $apply$30.apply(S.scala:1066)
>> > >        at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
>> > >        at net.liftweb.http.S$$anonfun$_init$1$$anonfun$apply$29.apply
>> > > (S.scala:1065)
>> > >        at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
>> > >        at net.liftweb.http.S$$anonfun$_init$1.apply(S.scala:1064)
>> > >        at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
>> > >        at net.liftweb.http.S$._init(S.scala:1063)
>> > >        at net.liftweb.http.S$.init(S.scala:779)
>> > >        at
>> net.liftweb.http.LiftServlet.doService(LiftServlet.scala:154)
>> > >        at net.liftweb.http.LiftServlet$$anonfun$doIt$1$1.apply
>> > > (LiftServlet.scala:83)
>> > >        at net.liftweb.http.LiftServlet$$anonfun$doIt$1$1.apply
>> > > (LiftServlet.scala:83)
>> > >        at
>> > > net.liftweb.util.TimeHelpers$class.calcTime(TimeHelpers.scala:241)
>> > >        at net.liftweb.util.Helpers$.calcTime(Helpers.scala:29)
>> > >        at
>> net.liftweb.util.TimeHelpers$class.logTime(TimeHelpers.scala:250)
>> > >        at net.liftweb.util.Helpers$.logTime(Helpers.scala:29)
>> > >        at net.liftweb.http.LiftServlet.doIt$1(LiftServlet.scala:82)
>> > >        at net.liftweb.http.LiftServlet.service(LiftServlet.scala:91)
>> > >        at
>> > > net.liftweb.http.LiftFilterTrait$$anonfun$doFilter$1$$anonfun$apply
>> > > $26.apply(LiftServlet.scala:506)
>> > >        at
>> > > net.liftweb.http.LiftFilterTrait$$anonfun$doFilter$1$$anonfun$apply
>> > > $26.apply(LiftServlet.scala:506)
>> > >        at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
>> > >        at net.liftweb.http.URLRewriter$.doWith(Req.scala:411)
>> > >        at net.liftweb.http.LiftFilterTrait$$anonfun$doFilter$1.apply
>> > > (LiftServlet.scala:505)
>> > >        at net.liftweb.http.LiftFilterTrait$$anonfun$doFilter$1.apply
>> > > (LiftServlet.scala:499)
>> > >        at
>> > > net.liftweb.http.RequestVarHandler$$anonfun$apply$3$$anonfun$apply
>> > > $4$$anonfun$apply$5$$anonfun$apply$6.apply(Vars.scala:197)
>> > >        at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
>> > >        at
>> > > net.liftweb.http.RequestVarHandler$$anonfun$apply$3$$anonfun$apply
>> > > $4$$anonfun$apply$5.apply(Vars.scala:196)
>> > >        at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
>> > >        at
>> > > net.liftweb.http.RequestVarHandler$$anonfun$apply$3$$anonfun$apply
>> > > $4.apply(Vars.scala:195)
>> > >        at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
>> > >        at net.liftweb.http.RequestVarHandler$$anonfun$apply$3.apply
>> > > (Vars.scala:194)
>> > >        at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
>> > >        at net.liftweb.http.RequestVarHandler$.apply(Vars.scala:193)
>> > >        at
>> > > net.liftweb.http.LiftFilterTrait$class.doFilter(LiftServlet.scala:
>> > > 498)
>> > >        at net.liftweb.http.LiftFilter.doFilter(LiftServlet.scala:517)
>> > >        at
>> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter
>> > > (ServletHandler.java:1148)
>> > >        at org.mortbay.jetty.servlet.ServletHandler.handle
>> > > (ServletHandler.java:387)
>> > >        at org.mortbay.jetty.security.SecurityHandler.handle
>> > > (SecurityHandler.java:216)
>> > >        at org.mortbay.jetty.servlet.SessionHandler.handle
>> > > (SessionHandler.java:181)
>> > >        at org.mortbay.jetty.handler.ContextHandler.handle
>> > > (ContextHandler.java:765)
>> > >        at
>> org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:
>> > > 417)
>> > >        at org.mortbay.jetty.handler.HandlerWrapper.handle
>> > > (HandlerWrapper.java:152)
>> > >        at org.mortbay.jetty.Server.handle(Server.java:326)
>> > >        at
>> > > org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:
>> > > 534)
>> > >        at
>> org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete
>> > > (HttpConnection.java:864)
>> > >        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:539)
>> > >        at
>> org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
>> > >        at
>> org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
>> > >        at org.mortbay.jetty.bio.SocketConnector$Connection.run
>> > > (SocketConnector.java:228)
>> > >        at org.mortbay.thread.QueuedThreadPool$PoolThread.run
>> > > (QueuedThreadPool.java:520)
>> > > 2009-06-04 01:13:44.778::WARN:  /comet_request/
>> > > 58946720417/1ha35q9iqp4el
>> > > java.lang.Exception: Bail
>> > >        at
>> net.liftweb.http.LiftRules$.doContinuation(LiftRules.scala:436)
>> > >        at
>> net.liftweb.http.LiftServlet.setupContinuation(LiftServlet.scala:
>> > > 352)
>> > >        at
>> net.liftweb.http.LiftServlet.handleComet(LiftServlet.scala:363)
>> > >        at net.liftweb.http.LiftServlet.net$liftweb$http$LiftServlet$
>> > > $dispatchStatefulRequest(LiftServlet.scala:232)
>> > >        at
>> net.liftweb.http.LiftServlet$$anonfun$2.apply(LiftServlet.scala:
>> > > 155)
>> > >        at
>> net.liftweb.http.LiftServlet$$anonfun$2.apply(LiftServlet.scala:
>> > > 155)
>> > >        at
>> net.liftweb.http.S$.net$liftweb$http$S$$wrapQuery(S.scala:908)
>> > >        at
>> > > net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_nest2InnerInit$1$
>> > > $anonfun$apply$18.apply(S.scala:1026)
>> > >        at
>> net.liftweb.http.S$.net$liftweb$http$S$$doAround(S.scala:845)
>> > >        at
>> net.liftweb.http.S$$anonfun$net$liftweb$http$S$$doAround$1.apply
>> > > (S.scala:846)
>> > >        at net.liftweb.mapper.DB$$anon$1.net
>> > > $liftweb$mapper$DB$$anon$$doWith
>> > > (DB.scala:117)
>> > >        at
>> > > net.liftweb.mapper.DB$$anon$1$$anonfun$net$liftweb$mapper$DB$$anon$
>> > > $doWith$1.apply(DB.scala:118)
>> > >        at
>> > > net.liftweb.mapper.DB$$anon$1$$anonfun$net$liftweb$mapper$DB$$anon$
>> > > $doWith$1.apply(DB.scala:118)
>> > >        at
>> >
>> > ...
>> >
>> > продолжение >>
>>
>>
>>
>
>
> --
> Lift, the simply functional web framework http://liftweb.net
> Beginning Scala http://www.apress.com/book/view/1430219890
> Follow me: http://twitter.com/dpp
> Git some: http://github.com/dpp
>
> >
>


-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Git some: http://github.com/dpp

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to