1

I'm having a spring-mvc project set up with spring-roo, that runs on tomcat. After setting up spring-security, I can not see exceptions/stacktrace in the console anymore...

I just go to the login page and try to login. In my UserService (that is called during the login process) I throw a NullPointerException to "test" this. The Exception is not shown in the console. The only thing I can see, is the message of the exception on the login page (/login?login_error=t) like "Your login attempt was not successful, try again. Reason: blablabla".

That is not good, because I want to be able to see (in console) what is going on an where the problem is.

I commented out the filter 'springSecurityFilterChain' that was added when setting up spring-security. When I throw an exception within a controller, the exception is shown in console as expected. So my guess is, that something handles the exception during the Filter chain and does not print it to the console. I wasn't able to find out, how to avoid this...

Any help would be appreciated!

Thanks

cly
  • 31
  • 4

1 Answers1

0

Yes you are correct, spring-security is taking care of the authentication part, so all you need is set the log level of spring-security to DEBUG

org.springframework.security.level=DEBUG

This should print all the exceptions which are occurring while authenticating.

Ramesh Kotha
  • 8,266
  • 17
  • 66
  • 90
  • I changed the log level, but that doesn't do it. I can see the following line in the log now: "DEBUG org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter - Authentication request failed: org.springframework.security.authentication.AuthenticationServiceException: blablabla". The stacktrace of the original exception is still missing. And: it is not nice to see the full debug messages of spring security. If something is wrong I just would like to see the exception... – cly Feb 21 '15 at 18:18