exception page debug

2010-03-15 Thread Yury Luneff
I have already raised this question some time ago, but we still did 
not overcome our situation.

It is frequent in our project that when a exception page should be 
shown, we have completely null response (no data at all). And often 
even no log messages in log4j with stacktrace.

At a glance, I've thought this is a spring-security integration 
problem (and it seemed logical), but even turning off all its filters 
does not help.

So now if I forget to put private for a field, I have null response 
and I should guess what is the problem.

What can I do in my situation? I can provide any information about my 
environment and code. Please, god, send me a geek that likes puzzles 
:-)


-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: exception page debug

2010-03-15 Thread Christophe Cordenier
Hi,

Have you overrided the ExceptionReport or even ExceptionRequestHandler ?

Regards,
Christophe Cordenier.

2010/3/15 Yury Luneff bitter...@ya.ru

 I have already raised this question some time ago, but we still did
 not overcome our situation.

 It is frequent in our project that when a exception page should be
 shown, we have completely null response (no data at all). And often
 even no log messages in log4j with stacktrace.

 At a glance, I've thought this is a spring-security integration
 problem (and it seemed logical), but even turning off all its filters
 does not help.

 So now if I forget to put private for a field, I have null response
 and I should guess what is the problem.

 What can I do in my situation? I can provide any information about my
 environment and code. Please, god, send me a geek that likes puzzles
 :-)


 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org




-- 
Regards,
Christophe Cordenier.

Developer of wooki @wookicentral.com


Re: exception page debug

2010-03-15 Thread Robert Hailey


Perhaps you have injected a service before the exception handler/filter?

--
Robert Hailey


On Mar 15, 2010, at 11:17 AM, Yury Luneff wrote:


I have already raised this question some time ago, but we still did
not overcome our situation.

It is frequent in our project that when a exception page should be
shown, we have completely null response (no data at all). And often
even no log messages in log4j with stacktrace.

At a glance, I've thought this is a spring-security integration
problem (and it seemed logical), but even turning off all its filters
does not help.

So now if I forget to put private for a field, I have null response
and I should guess what is the problem.

What can I do in my situation? I can provide any information about my
environment and code. Please, god, send me a geek that likes puzzles
:-)


-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: exception page debug

2010-03-15 Thread Yury Luneff
 Hi,

 Have you overrided the ExceptionReport or even ExceptionRequestHandler ?

 Regards,
 Christophe Cordenier.

in security module from tapestry5.localhost.nu ()there is:
@InjectService(SpringSecurityExceptionFilter)
final SpringSecurityExceptionTranslationFilter 
springSecurityExceptionFilter)

where public class SpringSecurityExceptionTranslationFilter extends
SpringSecurityFilter

as today i have turned off this module in a whole and the problem 
persists, it is probably not the source of problem. Even if it is, 
security there checks logged user if he can read logs and puts error 
message otherwise and i don't receive any error message, just null.

In my project i haven't touched anything related to expectionreport 
and such by myself and if i had, it would be the first place i watch 
for fixes.


-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: exception page debug

2010-03-15 Thread Yury Luneff

 Perhaps you have injected a service before the exception handler/filter?

 --
 Robert Hailey

i guess, i have solved the issue ;)

the problem was in custom logic i've added to stock timingFilter!

So I am happy again, thanks to everyone! :-D


-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: exception page debug

2010-03-15 Thread Robert Hailey


On Mar 15, 2010, at 2:10 PM, Yury Luneff wrote:


Hi,


Have you overrided the ExceptionReport or even  
ExceptionRequestHandler ?



Regards,
Christophe Cordenier.


in security module from tapestry5.localhost.nu ()there is:
@InjectService(SpringSecurityExceptionFilter)
   final SpringSecurityExceptionTranslationFilter  
springSecurityExceptionFilter)


where public class SpringSecurityExceptionTranslationFilter extends
   SpringSecurityFilter

as today i have turned off this module in a whole and the problem
persists, it is probably not the source of problem. Even if it is,
security there checks logged user if he can read logs and puts error
message otherwise and i don't receive any error message, just null.

In my project i haven't touched anything related to expectionreport
and such by myself and if i had, it would be the first place i watch
for fixes.




Yury,

I think that something is catching the exceptions and not rendering  
anything. Do you have any custom filters? My understanding is that  
this anti-pattern will break exception reporting in a filter:


try {
  return handler.service(request, response);
} catch (Exception e) {
  log.debug(i just silently broke something, e)
  //@bug: here, exception caught!
}

--
Robert Hailey





Re: exception page debug

2010-03-15 Thread Yury Luneff

 On Mar 15, 2010, at 2:10 PM, Yury Luneff wrote:

 Hi,

 Have you overrided the ExceptionReport or even  
 ExceptionRequestHandler ?

 Regards,
 Christophe Cordenier.

 in security module from tapestry5.localhost.nu ()there is:
 @InjectService(SpringSecurityExceptionFilter)
final SpringSecurityExceptionTranslationFilter  
 springSecurityExceptionFilter)

 where public class SpringSecurityExceptionTranslationFilter extends
SpringSecurityFilter

 as today i have turned off this module in a whole and the problem
 persists, it is probably not the source of problem. Even if it is,
 security there checks logged user if he can read logs and puts error
 message otherwise and i don't receive any error message, just null.

 In my project i haven't touched anything related to expectionreport
 and such by myself and if i had, it would be the first place i watch
 for fixes.



 Yury,

 I think that something is catching the exceptions and not rendering  
 anything. Do you have any custom filters? My understanding is that  
 this anti-pattern will break exception reporting in a filter:

 try {
return handler.service(request, response);
 } catch (Exception e) {
log.debug(i just silently broke something, e)
//@bug: here, exception caught!
 }
i think i had exactly that (no servlet api knowledge, i'm stupid, i'm 
ok with it):
public RequestFilter buildTimingFilter(final Logger logger) {
return new RequestFilter() {
public boolean service(Request request, Response response, 
RequestHandler handler) throws IOException {
long startTime = System.currentTimeMillis();
boolean successful = true;

try {
// The responsibility of a filter is to invoke the 
corresponding method
// in the handler. When you chain multiple filters 
together, each filter
// received a handler that is a bridge to the next filter.
successful = handler.service(request, response);
} finally {
long elapsed = System.currentTimeMillis() - startTime;

if (!successful) {
logger.error(String.format(%s not found, 
request.getPath()));
} else {
logger.info(
String.format(
Request time: %d ms for %s,
elapsed,
request.getPath()));
}
return successful;
}
}
};
}





-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: exception page debug

2010-03-15 Thread Robert Hailey


On Mar 15, 2010, at 2:42 PM, Yury Luneff wrote:




Yury,



I think that something is catching the exceptions and not rendering
anything. Do you have any custom filters? My understanding is that
this anti-pattern will break exception reporting in a filter:



try {
  return handler.service(request, response);
} catch (Exception e) {
  log.debug(i just silently broke something, e)
  //@bug: here, exception caught!
}

i think i had exactly that (no servlet api knowledge, i'm stupid, i'm
ok with it):
public RequestFilter buildTimingFilter(final Logger logger) {
   return new RequestFilter() {
   public boolean service(Request request, Response  
response, RequestHandler handler) throws IOException {

   long startTime = System.currentTimeMillis();
   boolean successful = true;

   try {
   // The responsibility of a filter is to invoke  
the corresponding method
   // in the handler. When you chain multiple  
filters together, each filter
   // received a handler that is a bridge to the  
next filter.

   successful = handler.service(request, response);
   } finally {
   long elapsed = System.currentTimeMillis() -  
startTime;


   if (!successful) {
   logger.error(String.format(%s not found,  
request.getPath()));

   } else {
   logger.info(
   String.format(
   Request time: %d ms for %s,
   elapsed,
   request.getPath()));
   }
   return successful;
   }
   }
   };
   }


Ok... having a return or throw statement in a 'finally' clause is bad  
java. I'm glad you found the issue, though!


--
Robert Hailey