Re: OGNL exceptions are swallowed by struts2
I have a patch that will throw a runtime exception when either(iff 'struts.el.throwExceptionOnFailure' is true): * Property is not found * Method is not found * An exception is thrown from the expression evaluation It seems to work fairly well, but I am sure it will need more tweaking and lots of testing. This won't be part of the 2.1 release that we hope will come out soon, but we can make it a priority for the next minor release of 2.1. musachy On Fri, Jan 9, 2009 at 5:30 PM, Musachy Barroso wrote: > The OgnlValueStack swallows the exceptions. Always rethrowing the > exception is not an option, as that it not wanted in many places. The > challenge is to do some refactoring, so the exceptions are thrown only > when OgnlValueStack:find(...) is called from the view. I will play > around with it, see if I can come out with something. > > musachy > > On Fri, Jan 9, 2009 at 10:39 AM, hernan gonzalez wrote: >>> >>> I agree, Struts2 sucks big time in >>> this regard while being an excellent framework otherwise. >>> >>> Robert >> >> Judging from my (not very long) experience with Struts2, I agree >> wholeheartedly >> with that. >> >> It really seems badly broken that the framework (OGNL, in this case) >> swallows exceptions (even if we are on the "view" stage, even if it logs it). >> >> See also this thread http://markmail.org/message/ui2gbkuqjiuhnudf >> >> If the very architecture design of OGNL implies that this cannot be fixed, >> developers should be clearly warned about it. It means, for example, that >> the one has put special care with "lazy getters" in the action >> (those which are called from the rendering stage), as exceptions during its >> execution won't break the jsp page. IMHO, this simply sucks. >> >> Hernán J. González >> http://hjg.com.ar/ >> >> - >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >> For additional commands, e-mail: user-h...@struts.apache.org >> >> > > > > -- > "Hey you! Would you help me to carry the stone?" Pink Floyd > -- "Hey you! Would you help me to carry the stone?" Pink Floyd - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: OGNL exceptions are swallowed by struts2
The OgnlValueStack swallows the exceptions. Always rethrowing the exception is not an option, as that it not wanted in many places. The challenge is to do some refactoring, so the exceptions are thrown only when OgnlValueStack:find(...) is called from the view. I will play around with it, see if I can come out with something. musachy On Fri, Jan 9, 2009 at 10:39 AM, hernan gonzalez wrote: >> >> I agree, Struts2 sucks big time in >> this regard while being an excellent framework otherwise. >> >> Robert > > Judging from my (not very long) experience with Struts2, I agree > wholeheartedly > with that. > > It really seems badly broken that the framework (OGNL, in this case) > swallows exceptions (even if we are on the "view" stage, even if it logs it). > > See also this thread http://markmail.org/message/ui2gbkuqjiuhnudf > > If the very architecture design of OGNL implies that this cannot be fixed, > developers should be clearly warned about it. It means, for example, that > the one has put special care with "lazy getters" in the action > (those which are called from the rendering stage), as exceptions during its > execution won't break the jsp page. IMHO, this simply sucks. > > Hernán J. González > http://hjg.com.ar/ > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > > -- "Hey you! Would you help me to carry the stone?" Pink Floyd - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: OGNL exceptions are swallowed by struts2
> > I agree, Struts2 sucks big time in > this regard while being an excellent framework otherwise. > > Robert Judging from my (not very long) experience with Struts2, I agree wholeheartedly with that. It really seems badly broken that the framework (OGNL, in this case) swallows exceptions (even if we are on the "view" stage, even if it logs it). See also this thread http://markmail.org/message/ui2gbkuqjiuhnudf If the very architecture design of OGNL implies that this cannot be fixed, developers should be clearly warned about it. It means, for example, that the one has put special care with "lazy getters" in the action (those which are called from the rendering stage), as exceptions during its execution won't break the jsp page. IMHO, this simply sucks. Hernán J. González http://hjg.com.ar/ - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: OGNL exceptions are swallowed by struts2
If you're running with log4j in your app, set the logging priority on the root logger to debug. It spews a lot of messages, and the type converter messages are there - I was using this facility the other day when trying to upgrade an existing app from 2.0.x to 2.1.2. Andy. On 9 Jan 2009, at 09:12, Robert Graf-Waczenski wrote: Hi! To my knowledge, you have to enable devMode. This gives you a lot of debugging output and exception stack traces on the console. The drawback is that it makes your application rather sluggish. Yes, the article you quote is well known. I agree, Struts2 sucks big time in this regard while being an excellent framework otherwise. Robert Vincent Lin wrote: Hi, Is there anyway to get better error message there's an error occurring in ognl? Everytime there's an exception in ognl it's swallowed. And I ran into some "No Result Found for XxxAction" error. It's extremely hard to debug, because there's no any useful information in it. All of them seem to be converter related problem. Is there anyway to make struts 2 easier to debug? There's an article complaining about this issue: http://raibledesigns.com/rd/entry/does_struts_2_suck Thanks, Vincent - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: OGNL exceptions are swallowed by struts2
Hi! To my knowledge, you have to enable devMode. This gives you a lot of debugging output and exception stack traces on the console. The drawback is that it makes your application rather sluggish. Yes, the article you quote is well known. I agree, Struts2 sucks big time in this regard while being an excellent framework otherwise. Robert Vincent Lin wrote: Hi, Is there anyway to get better error message there's an error occurring in ognl? Everytime there's an exception in ognl it's swallowed. And I ran into some "No Result Found for XxxAction" error. It's extremely hard to debug, because there's no any useful information in it. All of them seem to be converter related problem. Is there anyway to make struts 2 easier to debug? There's an article complaining about this issue: http://raibledesigns.com/rd/entry/does_struts_2_suck Thanks, Vincent - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
OGNL exceptions are swallowed by struts2
Hi, Is there anyway to get better error message there's an error occurring in ognl? Everytime there's an exception in ognl it's swallowed. And I ran into some "No Result Found for XxxAction" error. It's extremely hard to debug, because there's no any useful information in it. All of them seem to be converter related problem. Is there anyway to make struts 2 easier to debug? There's an article complaining about this issue: http://raibledesigns.com/rd/entry/does_struts_2_suck Thanks, Vincent