On May 7, 6:02 pm, David Pollak <feeder.of.the.be...@gmail.com> wrote:
> On Thu, May 7, 2009 at 7:19 AM, ivan <ivan.se...@gmail.com> wrote:
>
> > Hi people. Time has come for my second question on this group :)
>
> Please keep asking questions...

Thanks for responding so fast.

> although when you become skilled enough with
> Lift, I hope that you'll answer some as well.

I sure will. I'm thinking of a JSF->Lift transition guide. But I'm
still working on the transitioning part.

> > The link works fine, the entity is deleted from the database and
> > "Succesfully deleted!" notice is shown but an exception happens in the
> > finally block when calling S.redirectTo(dest).
>
> This should work.  Please post the complete stack trace that you're getting.

Here is the complete stack trace (I hope it will help):

net.liftweb.http.ResponseShortcutException:
Shortcut
        at net.liftweb.http.ResponseShortcutException$.redirect
(ResponseShortcutException.scala:
31)
        at net.liftweb.http.S$.redirectTo(S.scala:
322)
        at hr.ivan.util.PageUtil$$anonfun$deleteLink$1.apply
(PageUtil.scala:
58)
        at net.liftweb.http.SHtml$$anonfun$link$1.apply(SHtml.scala:
243)
        at net.liftweb.http.SHtml$$anonfun$link$1.apply(SHtml.scala:
243)
        at net.liftweb.http.S$LFuncHolder.apply(S.scala:
961)
        at net.liftweb.http.LiftSession$$anonfun$buildFunc$1$2.apply
(LiftSession.scala:
328)
        at net.liftweb.http.LiftSession$$anonfun$6$$anonfun$apply
$18.apply(LiftSession.scala:
343)
        at net.liftweb.http.LiftSession$$anonfun$6$$anonfun$apply
$18.apply(LiftSession.scala:
343)
        at scala.List.map(List.scala:
812)
        at net.liftweb.http.LiftSession$$anonfun$6.apply
(LiftSession.scala:
343)
        at net.liftweb.http.LiftSession$$anonfun$6.apply
(LiftSession.scala:
332)
        at scala.List.flatMap(List.scala:
1132)
        at net.liftweb.http.LiftSession.runParams(LiftSession.scala:
332)
        at net.liftweb.http.LiftSession.processRequest
(LiftSession.scala:
478)
        at net.liftweb.http.LiftServlet.net$liftweb$http$LiftServlet$
$dispatchStatefulRequest(LiftServlet.scala:
255)
        at net.liftweb.http.LiftServlet$$anonfun$2.apply
(LiftServlet.scala:
176)
        at net.liftweb.http.LiftServlet$$anonfun$2.apply
(LiftServlet.scala:
176)
        at net.liftweb.http.S$.net$liftweb$http$S$$wrapQuery(S.scala:
401)
        at net.liftweb.http.S$$anonfun$net$liftweb$http$S$
$_nest2InnerInit$1$$anonfun$apply$18.apply(S.scala:
456)
        at net.liftweb.http.S$.net$liftweb$http$S$$doAround(S.scala:
375)
        at net.liftweb.http.S$$anonfun$net$liftweb$http$S$$doAround
$1.apply(S.scala:
376)
        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:
376)
        at net.liftweb.http.S$$anonfun$net$liftweb$http$S$
$_nest2InnerInit$1.apply(S.scala:
454)
        at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:
65)
        at net.liftweb.http.S$.net$liftweb$http$S$$_nest2InnerInit
(S.scala:
453)
        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:
474)
        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:
473)
        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:472)
        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:
471)
        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:
470)
        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:
469)
        at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:
65)
        at net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit
$1.apply(S.scala:
468)
        at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:
65)
        at net.liftweb.http.S$.net$liftweb$http$S$$_innerInit(S.scala:
467)
        at net.liftweb.http.S$$anonfun$_init$1$$anonfun$apply$29$
$anonfun$apply$30$$anonfun$apply$31$$anonfun$apply$32.apply(S.scala:
498)
        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:
497)
        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:
496)
        at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:
65)
        at net.liftweb.http.S$$anonfun$_init$1$$anonfun$apply$29.apply
(S.scala:
495)
        at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:
65)
        at net.liftweb.http.S$$anonfun$_init$1.apply(S.scala:
494)
        at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:
65)
        at net.liftweb.http.S$._init(S.scala:
493)
        at net.liftweb.http.S$.init(S.scala:
337)
        at net.liftweb.http.LiftServlet.doService(LiftServlet.scala:
175)
        at net.liftweb.http.LiftServlet$$anonfun$doIt$1$1.apply
(LiftServlet.scala:
104)
        at net.liftweb.http.LiftServlet$$anonfun$doIt$1$1.apply
(LiftServlet.scala:
104)
        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:
103)
        at net.liftweb.http.LiftServlet.service(LiftServlet.scala:
112)
        at net.liftweb.http.LiftFilterTrait$$anonfun$doFilter$1$
$anonfun$apply$26.apply(LiftServlet.scala:
546)
        at net.liftweb.http.LiftFilterTrait$$anonfun$doFilter$1$
$anonfun$apply$26.apply(LiftServlet.scala:
546)
        at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:
65)
        at net.liftweb.http.URLRewriter$.doWith(Req.scala:
404)
        at net.liftweb.http.LiftFilterTrait$$anonfun$doFilter$1.apply
(LiftServlet.scala:
545)
        at net.liftweb.http.LiftFilterTrait$$anonfun$doFilter$1.apply
(LiftServlet.scala:
539)
        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:538)
        at net.liftweb.http.LiftFilter.doFilter(LiftServlet.scala:557)
        at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1139)
        at org.mortbay.jetty.servlet.ServletHandler.handle
(ServletHandler.java:378)
        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.ContextHandlerCollection.handle
(ContextHandlerCollection.java:230)
        at org.mortbay.jetty.handler.HandlerCollection.handle
(HandlerCollection.java:114)
        at org.mortbay.jetty.handler.HandlerWrapper.handle
(HandlerWrapper.java:152)
        at org.mortbay.jetty.Server.handle(Server.java:324)
        at org.mortbay.jetty.HttpConnection.handleRequest
(HttpConnection.java:535)
        at org.mortbay.jetty.HttpConnection
$RequestHandler.headerComplete(HttpConnection.java:865)
        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.io.nio.SelectChannelEndPoint.run
(SelectChannelEndPoint.java:409)
        at org.mortbay.thread.QueuedThreadPool$PoolThread.run
(QueuedThreadPool.java:520)


>
> S.redirectTo does throw an exception that is supposed to be caught by the
> Lift rendering machinery and then turned into a Redirect.  I'm interested in
> seeing why the machinery is not catching the exception.

I already pasted the stack trace and then realized... Lift isn't
catching the exception because I'am.
I am doing a: case e : Throwable =>
                        logAndError("Some strange exception happened",

That is why i'a seeing a stack trace and an error message. Is that
supposed to work that way?

>
> > The idea is to enable user to provide a callback (in the finally part)
> > to determine to what page to redirect after deleting an entity (maybe
> > as a function of weather deletion was successful) and this is only a
> > prototype but it doesn't work for some reason.
>
> > Any idea what could be causing this? I have SHtml.links in other
> > simpler places that have redirectTo and there it works.
>
> > Thanks in advance :)
>
> > PS I really love lift, it is really a refreshing framework.
>
> I like the tag line... Lift, the refereshing framework... kinda makes me
> think of having a beer... oh wait, it's 9am... never mind.
>

Mmmmm :)

--~--~---------~--~----~------------~-------~--~----~
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