Commit 68c16626 authored by michael.simon's avatar michael.simon
Browse files

Exception Mappers must be included in JAX-RS activation

If not, Excaptions will not be mapped, an reported as Http 500 Server
Error
parent 4b630ff8
......@@ -16,6 +16,27 @@ import java.util.Set;
import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.Application;
import edu.kit.scc.webreg.rest.exc.AssertionExceptionMapper;
import edu.kit.scc.webreg.rest.exc.GenericRestInterfaceExceptionMapper;
import edu.kit.scc.webreg.rest.exc.LoginFailedExceptionMapper;
import edu.kit.scc.webreg.rest.exc.MisconfiguredServiceExceptionMapper;
import edu.kit.scc.webreg.rest.exc.NoDelegationConfiguredExceptionMapper;
import edu.kit.scc.webreg.rest.exc.NoEcpSupportExceptionMapper;
import edu.kit.scc.webreg.rest.exc.NoHostnameConfiguredExceptionMapper;
import edu.kit.scc.webreg.rest.exc.NoIdpForScopeExceptionMapper;
import edu.kit.scc.webreg.rest.exc.NoIdpFoundExceptionMapper;
import edu.kit.scc.webreg.rest.exc.NoItemFoundExceptionMapper;
import edu.kit.scc.webreg.rest.exc.NoRegistryFoundExceptionMapper;
import edu.kit.scc.webreg.rest.exc.NoScopedUsernameExceptionMapper;
import edu.kit.scc.webreg.rest.exc.NoUserFoundExceptionMapper;
import edu.kit.scc.webreg.rest.exc.PersistentIdExceptionMapper;
import edu.kit.scc.webreg.rest.exc.RegisterExceptionMapper;
import edu.kit.scc.webreg.rest.exc.UnauthorizedExceptionMapper;
import edu.kit.scc.webreg.rest.exc.UserCreateExceptionMapper;
import edu.kit.scc.webreg.rest.exc.UserNotRegisteredExceptionMapper;
import edu.kit.scc.webreg.rest.exc.UserUpdateFailedExceptionMapper;
import edu.kit.scc.webreg.rest.exc.ValidationExceptionMapper;
@ApplicationPath("/rest")
public class JaxRsApplicationActivator extends Application {
......@@ -31,6 +52,30 @@ public class JaxRsApplicationActivator extends Application {
resources.add(ImageController.class);
resources.add(ServiceAdminController.class);
resources.add(UserController.class);
// Exceptions
resources.add(AssertionExceptionMapper.class);
resources.add(GenericRestInterfaceExceptionMapper.class);
resources.add(LoginFailedExceptionMapper.class);
resources.add(MisconfiguredServiceExceptionMapper.class);
resources.add(NoDelegationConfiguredExceptionMapper.class);
resources.add(NoEcpSupportExceptionMapper.class);
resources.add(NoHostnameConfiguredExceptionMapper.class);
resources.add(NoIdpForScopeExceptionMapper.class);
resources.add(NoIdpFoundExceptionMapper.class);
resources.add(NoItemFoundExceptionMapper.class);
resources.add(NoRegistryFoundExceptionMapper.class);
resources.add(NoScopedUsernameExceptionMapper.class);
resources.add(LoginFailedExceptionMapper.class);
resources.add(NoUserFoundExceptionMapper.class);
resources.add(PersistentIdExceptionMapper.class);
resources.add(RegisterExceptionMapper.class);
resources.add(UnauthorizedExceptionMapper.class);
resources.add(UserCreateExceptionMapper.class);
resources.add(UserNotRegisteredExceptionMapper.class);
resources.add(UserUpdateFailedExceptionMapper.class);
resources.add(ValidationExceptionMapper.class);
return resources;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment