Skip to content
This repository has been archived by the owner on Jul 3, 2020. It is now read-only.

Exception Handler when registering a user with invalid e-mail #61

Closed
christian-peters opened this issue Oct 7, 2014 · 7 comments
Closed
Assignees
Labels
Milestone

Comments

@christian-peters
Copy link

While registering when an invalid e-mail is entered, the following exception is displayed. Would be desirable that the output of stack trackes remain hidden from the user.

(dchrome has verified this issue: the validation does not work. it should return a specific error for the html field where the error occurred in this case the email field.)

HTTP Status 500 - Request processing failed; nested exception is org.osiam.resources.exception.SCIMDataValidationException: The value 'c.peters@tarent' is not a well-formed email.

org.osiam.addons.self_administration.exception.OsiamExceptionHandler handleException
WARNING: An exception occurred
org.osiam.resources.exception.SCIMDataValidationException: The value 'c.peters@tarent' is not a well-formed email.
at org.osiam.resources.scim.Email$Builder.setValue(Email.java:179)
at org.osiam.addons.self_administration.registration.UserConverter.toScimUser(UserConverter.java:68)
at org.osiam.addons.self_administration.registration.RegistrationService.convertToScimUser(RegistrationService.java:125)
at org.osiam.addons.self_administration.registration.RegistrationController.register(RegistrationController.java:87)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:215)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:781)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:721)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:83)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:943)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:877)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:863)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:200)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)

ERROR [org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver] - <Failed to invoke @ExceptionHandler method: protected org.springframework.web.servlet.ModelAndView org.osiam.addons.self_administration.exception.OsiamExceptionHandler.handleException(java.lang.RuntimeException,javax.servlet.http.HttpServletResponse)>
java.lang.NullPointerException
at org.osiam.addons.self_administration.exception.OsiamExceptionHandler.getLogLevel(OsiamExceptionHandler.java:95)
at org.osiam.addons.self_administration.exception.OsiamExceptionHandler.getLogLevel(OsiamExceptionHandler.java:95)
at org.osiam.addons.self_administration.exception.OsiamExceptionHandler.getLogLevel(OsiamExceptionHandler.java:95)
at org.osiam.addons.self_administration.exception.OsiamExceptionHandler.getLogLevel(OsiamExceptionHandler.java:95)
at org.osiam.addons.self_administration.exception.OsiamExceptionHandler.getLogLevel(OsiamExceptionHandler.java:95)
at org.osiam.addons.self_administration.exception.OsiamExceptionHandler.getLogLevel(OsiamExceptionHandler.java:95)
at org.osiam.addons.self_administration.exception.OsiamExceptionHandler.getLogLevel(OsiamExceptionHandler.java:95)
at org.osiam.addons.self_administration.exception.OsiamExceptionHandler.getLogLevel(OsiamExceptionHandler.java:95)
at org.osiam.addons.self_administration.exception.OsiamExceptionHandler.getLogLevel(OsiamExceptionHandler.java:95)
at org.osiam.addons.self_administration.exception.OsiamExceptionHandler.getLogLevel(OsiamExceptionHandler.java:95)
at org.osiam.addons.self_administration.exception.OsiamExceptionHandler.getLogLevel(OsiamExceptionHandler.java:95)
at org.osiam.addons.self_administration.exception.OsiamExceptionHandler.setLoggingInformation(OsiamExceptionHandler.java:83)
at org.osiam.addons.self_administration.exception.OsiamExceptionHandler.handleException(OsiamExceptionHandler.java:78)

@christian-peters christian-peters changed the title Exception Handler when regiRegitrierung eines Benutzers Exception Handler when registering an user with invalid e-mail Oct 7, 2014
@dacrome dacrome added the bug label Oct 7, 2014
@dacrome
Copy link
Member

dacrome commented Oct 7, 2014

Thanks. Verified.

@dacrome dacrome self-assigned this Oct 7, 2014
@dacrome dacrome added this to the v1.3 milestone Oct 7, 2014
@tkrille tkrille changed the title Exception Handler when registering an user with invalid e-mail Exception Handler when registering a user with invalid e-mail Oct 15, 2014
@tkrille
Copy link
Member

tkrille commented Oct 17, 2014

fixed with 7fc63c2

@tkrille tkrille closed this as completed Oct 17, 2014
@christian-peters
Copy link
Author

Unfortunatley the bug still exists. When entering sth like "name@mail" the stack trace is shown. Could you please look for an alternate fix

@tkrille tkrille reopened this Oct 21, 2014
@tkrille tkrille modified the milestones: v1.4, v1.3 Oct 21, 2014
@tkrille
Copy link
Member

tkrille commented Oct 21, 2014

re-opened

@dacrome
Copy link
Member

dacrome commented Oct 21, 2014

verified. the email validaton annotation of hibernate accepts also something like name@host (without the .TLD ending). sorry, I only tested with the string 'email' and not with your string ('c.peters@tarent'), because I thought only an email address with the structure 'name@host.tld' is valid

@tkrille tkrille modified the milestones: v1.3.1, v1.4 Oct 21, 2014
@tpick
Copy link
Contributor

tpick commented Nov 18, 2014

Is this fixed? Can't reproduce on head.

@christian-peters
Copy link
Author

in current nosca-system using osiam 1.1 an expected message is displayed when only entering name@xyz without a top level domain

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants