cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1405736 - in /cxf/trunk/rt: frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ management-web/src/main/java/org/apache/cxf/management/web/logging/atom/ rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/aegis/ rs/ex...
Date Mon, 05 Nov 2012 10:35:15 GMT
Author: sergeyb
Date: Mon Nov  5 10:35:14 2012
New Revision: 1405736

URL: http://svn.apache.org/viewvc?rev=1405736&view=rev
Log:
Updating the rest of RS code to use WAE subclasses where possible

Modified:
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientConfiguration.java
    cxf/trunk/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/atom/AtomPullServer.java
    cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/aegis/AegisElementProvider.java
    cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/aegis/AegisJSONProvider.java
    cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/atom/AbstractAtomProvider.java
    cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/atom/AtomPojoProvider.java
    cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/dom4j/DOM4JProvider.java
    cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/JSONProvider.java
    cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/xmlbeans/XMLBeansElementProvider.java
    cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/xmlbeans/XMLBeansJSONProvider.java
    cxf/trunk/rt/rs/security/oauth-parent/oauth/src/main/java/org/apache/cxf/rs/security/oauth/services/AuthorizationRequestHandler.java
    cxf/trunk/rt/rs/security/oauth-parent/oauth/src/main/java/org/apache/cxf/rs/security/oauth/utils/OAuthUtils.java
    cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractAccessTokenValidator.java
    cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractOAuthService.java
    cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AccessTokenService.java
    cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/RedirectionBasedGrantService.java
    cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/utils/AuthorizationUtils.java
    cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/utils/OAuthContextUtils.java
    cxf/trunk/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/AbstractServiceProviderFilter.java
    cxf/trunk/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/RequestAssertionConsumerService.java
    cxf/trunk/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/SamlPostBindingFilter.java
    cxf/trunk/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/SamlRedirectBindingFilter.java
    cxf/trunk/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/AbstractSamlInHandler.java
    cxf/trunk/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/AbstractXmlSecInHandler.java

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientConfiguration.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientConfiguration.java?rev=1405736&r1=1405735&r2=1405736&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientConfiguration.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientConfiguration.java
Mon Nov  5 10:35:14 2012
@@ -164,7 +164,7 @@ public class ClientConfiguration impleme
     
     /**
      * Sets the list of in fault interceptors which will deal with the HTTP
-     * faults; the client code may choose to catch {@link ServerWebApplicationException}
+     * faults; the client code may choose to catch {@link WebApplicationException}
      * exceptions instead.
      *  
      * @param interceptors in fault interceptors
@@ -175,7 +175,7 @@ public class ClientConfiguration impleme
 
     /**
      * Sets the list of out fault interceptors which will deal with the client-side
-     * faults; the client code may choose to catch {@link ClientWebApplicationException}
+     * faults; the client code may choose to catch {@link ClientException}
      * exceptions instead.
      *  
      * @param interceptors out fault interceptors

Modified: cxf/trunk/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/atom/AtomPullServer.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/atom/AtomPullServer.java?rev=1405736&r1=1405735&r2=1405736&view=diff
==============================================================================
--- cxf/trunk/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/atom/AtomPullServer.java
(original)
+++ cxf/trunk/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/atom/AtomPullServer.java
Mon Nov  5 10:35:14 2012
@@ -31,10 +31,10 @@ import java.util.WeakHashMap;
 import java.util.logging.Handler;
 
 import javax.ws.rs.GET;
+import javax.ws.rs.NotFoundException;
 import javax.ws.rs.Path;
 import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
-import javax.ws.rs.WebApplicationException;
 import javax.ws.rs.core.Context;
 import javax.ws.rs.core.UriBuilder;
 
@@ -228,7 +228,7 @@ public class AtomPullServer extends Abst
             list.add(records.get(index));
         }
         if (list.size() != 1) { 
-            throw new WebApplicationException(404);
+            throw new NotFoundException();
         }
         return list;
     }

Modified: cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/aegis/AegisElementProvider.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/aegis/AegisElementProvider.java?rev=1405736&r1=1405735&r2=1405736&view=diff
==============================================================================
--- cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/aegis/AegisElementProvider.java
(original)
+++ cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/aegis/AegisElementProvider.java
Mon Nov  5 10:35:14 2012
@@ -27,9 +27,10 @@ import java.lang.annotation.Annotation;
 import java.lang.reflect.ParameterizedType;
 import java.lang.reflect.Type;
 
+import javax.ws.rs.BadRequestException;
 import javax.ws.rs.Consumes;
+import javax.ws.rs.InternalServerErrorException;
 import javax.ws.rs.Produces;
-import javax.ws.rs.WebApplicationException;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.MultivaluedMap;
 import javax.ws.rs.ext.Provider;
@@ -69,7 +70,7 @@ public class AegisElementProvider<T> ext
             xmlStreamReader = createStreamReader(typeToRead, is);
             return type.cast(aegisReader.read(xmlStreamReader, typeToRead));
         } catch (Exception e) {
-            throw new WebApplicationException(e);
+            throw new BadRequestException(e);
         } finally {
             StaxUtils.close(xmlStreamReader);
         }
@@ -114,7 +115,7 @@ public class AegisElementProvider<T> ext
             xmlStreamWriter.writeEndDocument();
             xmlStreamWriter.close();
         } catch (Exception e) {
-            throw new WebApplicationException(e);
+            throw new InternalServerErrorException(e);
         }
     }
     

Modified: cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/aegis/AegisJSONProvider.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/aegis/AegisJSONProvider.java?rev=1405736&r1=1405735&r2=1405736&view=diff
==============================================================================
--- cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/aegis/AegisJSONProvider.java
(original)
+++ cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/aegis/AegisJSONProvider.java
Mon Nov  5 10:35:14 2012
@@ -29,8 +29,8 @@ import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 
 import javax.ws.rs.Consumes;
+import javax.ws.rs.InternalServerErrorException;
 import javax.ws.rs.Produces;
-import javax.ws.rs.WebApplicationException;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.MultivaluedMap;
 import javax.ws.rs.ext.Provider;
@@ -121,7 +121,7 @@ public final class AegisJSONProvider<T> 
             xmlStreamWriter.flush();
             xmlStreamWriter.close();
         } catch (Exception e) {
-            throw new WebApplicationException(e);
+            throw new InternalServerErrorException(e);
         }
     }
 

Modified: cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/atom/AbstractAtomProvider.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/atom/AbstractAtomProvider.java?rev=1405736&r1=1405735&r2=1405736&view=diff
==============================================================================
--- cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/atom/AbstractAtomProvider.java
(original)
+++ cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/atom/AbstractAtomProvider.java
Mon Nov  5 10:35:14 2012
@@ -26,7 +26,7 @@ import java.lang.annotation.Annotation;
 import java.lang.reflect.Type;
 import java.util.logging.Logger;
 
-import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.NotSupportedException;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.MultivaluedMap;
 import javax.ws.rs.ext.MessageBodyReader;
@@ -56,7 +56,7 @@ public abstract class AbstractAtomProvid
         if (MediaType.APPLICATION_JSON_TYPE.isCompatible(mt)) {
             Writer w = createWriter("json");
             if (w == null) {
-                throw new WebApplicationException(415);
+                throw new NotSupportedException();
             }
             element.writeTo(w, os);   
         } else if (formattedOutput) {

Modified: cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/atom/AtomPojoProvider.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/atom/AtomPojoProvider.java?rev=1405736&r1=1405735&r2=1405736&view=diff
==============================================================================
--- cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/atom/AtomPojoProvider.java
(original)
+++ cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/atom/AtomPojoProvider.java
Mon Nov  5 10:35:14 2012
@@ -35,8 +35,11 @@ import java.util.Map;
 import java.util.UUID;
 import java.util.logging.Logger;
 
+import javax.ws.rs.ClientErrorException;
 import javax.ws.rs.Consumes;
+import javax.ws.rs.InternalServerErrorException;
 import javax.ws.rs.Produces;
+import javax.ws.rs.ServerErrorException;
 import javax.ws.rs.WebApplicationException;
 import javax.ws.rs.core.Context;
 import javax.ws.rs.core.MediaType;
@@ -170,7 +173,7 @@ public class AtomPojoProvider extends Ab
                 atomElement = createEntryFromObject(factory, o, cls);
             }
         } catch (Exception ex) {
-            throw new WebApplicationException(ex);
+            throw new InternalServerErrorException(ex);
         }
         
         try {
@@ -548,9 +551,9 @@ public class AtomPojoProvider extends Ab
         LOG.warning(message);
         Response response = Response.status(status).type("text/plain").entity(message).build();
         if (ex == null) {
-            throw new WebApplicationException(response);
+            throw status < 500 ? new ClientErrorException(response) : new ServerErrorException(response);
         } else {
-            throw new WebApplicationException(ex, response);
+            throw status < 500 ? new ClientErrorException(response, ex) : new ServerErrorException(response,
ex);
         }
     }
     private void reportError(String message, Exception ex) {

Modified: cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/dom4j/DOM4JProvider.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/dom4j/DOM4JProvider.java?rev=1405736&r1=1405735&r2=1405736&view=diff
==============================================================================
--- cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/dom4j/DOM4JProvider.java
(original)
+++ cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/dom4j/DOM4JProvider.java
Mon Nov  5 10:35:14 2012
@@ -25,6 +25,8 @@ import java.io.StringReader;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Type;
 
+import javax.ws.rs.NotAcceptableException;
+import javax.ws.rs.NotSupportedException;
 import javax.ws.rs.WebApplicationException;
 import javax.ws.rs.core.Context;
 import javax.ws.rs.core.MediaType;
@@ -62,7 +64,7 @@ public class DOM4JProvider implements Me
         MessageBodyReader<org.w3c.dom.Document> reader =
             providers.getMessageBodyReader(DOM_DOC_CLS, DOM_DOC_CLS, anns, mt);
         if (reader == null) {
-            throw new WebApplicationException(415);
+            throw new NotSupportedException();
         }
         org.w3c.dom.Document domDoc =
             reader.readFrom(DOM_DOC_CLS, DOM_DOC_CLS, anns, mt, headers, is);
@@ -93,7 +95,7 @@ public class DOM4JProvider implements Me
             MessageBodyWriter<org.w3c.dom.Document> writer =
                 providers.getMessageBodyWriter(DOM_DOC_CLS, DOM_DOC_CLS, anns, mt);
             if (writer == null) {
-                throw new WebApplicationException(406);
+                throw new NotAcceptableException();
             }
             writer.writeTo(domDoc, DOM_DOC_CLS, DOM_DOC_CLS, anns, mt, headers, os);
         }
@@ -104,7 +106,7 @@ public class DOM4JProvider implements Me
         try {
             return DOMUtils.readXml(new StringReader(xml));
         } catch (Exception ex) {
-            throw new javax.ws.rs.WebApplicationException(ex);
+            throw new javax.ws.rs.InternalServerErrorException(ex);
         }
     }
 }

Modified: cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/JSONProvider.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/JSONProvider.java?rev=1405736&r1=1405735&r2=1405736&view=diff
==============================================================================
--- cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/JSONProvider.java
(original)
+++ cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/JSONProvider.java
Mon Nov  5 10:35:14 2012
@@ -38,13 +38,14 @@ import java.util.List;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 
+import javax.ws.rs.BadRequestException;
 import javax.ws.rs.Consumes;
+import javax.ws.rs.InternalServerErrorException;
 import javax.ws.rs.Produces;
 import javax.ws.rs.WebApplicationException;
 import javax.ws.rs.core.Context;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.core.Response;
 import javax.ws.rs.ext.Provider;
 import javax.xml.bind.JAXBElement;
 import javax.xml.bind.JAXBException;
@@ -248,7 +249,7 @@ public class JSONProvider<T> extends Abs
         } catch (WebApplicationException e) {
             throw e;
         } catch (Exception e) {
-            throw new WebApplicationException(e, Response.status(400).build());
+            throw new BadRequestException(e);
         } finally {
             StaxUtils.close(reader);
         }
@@ -320,7 +321,7 @@ public class JSONProvider<T> extends Abs
         }
         
         if (name == null) {
-            throw new WebApplicationException(500);
+            throw new InternalServerErrorException();
         }
         
         return "{\"" + name + "\":";
@@ -371,7 +372,7 @@ public class JSONProvider<T> extends Abs
         } catch (XMLStreamException e) {
             handleXMLStreamException(e, false);
         } catch (Exception e) {
-            throw new WebApplicationException(e);
+            throw new InternalServerErrorException(e);
         } finally {
             StaxUtils.close(writer);
         }

Modified: cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/xmlbeans/XMLBeansElementProvider.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/xmlbeans/XMLBeansElementProvider.java?rev=1405736&r1=1405735&r2=1405736&view=diff
==============================================================================
--- cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/xmlbeans/XMLBeansElementProvider.java
(original)
+++ cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/xmlbeans/XMLBeansElementProvider.java
Mon Nov  5 10:35:14 2012
@@ -27,11 +27,10 @@ import java.lang.annotation.Annotation;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.lang.reflect.Type;
-import java.net.HttpURLConnection;
 
 import javax.ws.rs.Consumes;
+import javax.ws.rs.InternalServerErrorException;
 import javax.ws.rs.Produces;
-import javax.ws.rs.WebApplicationException;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.MultivaluedMap;
 import javax.ws.rs.ext.MessageBodyReader;
@@ -40,7 +39,6 @@ import javax.ws.rs.ext.Provider;
 import javax.xml.stream.XMLStreamReader;
 
 import org.apache.cxf.jaxrs.provider.AbstractConfigurableProvider;
-
 import org.apache.xmlbeans.XmlObject;
 
 /**
@@ -115,11 +113,11 @@ public class XMLBeansElementProvider ext
             }
 
         } catch (NoSuchMethodException nsme) {
-            throw new WebApplicationException(HttpURLConnection.HTTP_INTERNAL_ERROR);
+            throw new InternalServerErrorException(nsme);
         } catch (InvocationTargetException ite) {
-            throw new WebApplicationException(HttpURLConnection.HTTP_INTERNAL_ERROR);
+            throw new InternalServerErrorException(ite);
         } catch (IllegalAccessException iae) {
-            throw new WebApplicationException(HttpURLConnection.HTTP_INTERNAL_ERROR);
+            throw new InternalServerErrorException(iae);
         }
 
         return result;

Modified: cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/xmlbeans/XMLBeansJSONProvider.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/xmlbeans/XMLBeansJSONProvider.java?rev=1405736&r1=1405735&r2=1405736&view=diff
==============================================================================
--- cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/xmlbeans/XMLBeansJSONProvider.java
(original)
+++ cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/xmlbeans/XMLBeansJSONProvider.java
Mon Nov  5 10:35:14 2012
@@ -25,13 +25,13 @@ import java.io.OutputStream;
 import java.io.Reader;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Type;
-import java.net.HttpURLConnection;
 import java.util.HashMap;
 import java.util.Map;
 
+import javax.ws.rs.BadRequestException;
 import javax.ws.rs.Consumes;
+import javax.ws.rs.InternalServerErrorException;
 import javax.ws.rs.Produces;
-import javax.ws.rs.WebApplicationException;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.MultivaluedMap;
 import javax.ws.rs.ext.Provider;
@@ -72,7 +72,7 @@ public class XMLBeansJSONProvider extend
             xsr.close();
 
         } catch (XMLStreamException e) {
-            throw new WebApplicationException(HttpURLConnection.HTTP_INTERNAL_ERROR);
+            throw new BadRequestException(e);
         }
 
         return result;
@@ -101,9 +101,9 @@ public class XMLBeansJSONProvider extend
             xsw.close();
 
         } catch (XMLStreamException e) {
-            throw new WebApplicationException(HttpURLConnection.HTTP_INTERNAL_ERROR);
+            throw new InternalServerErrorException(e);
         } catch (IOException ioe) {
-            throw new WebApplicationException(HttpURLConnection.HTTP_INTERNAL_ERROR);
+            throw new InternalServerErrorException(ioe);
         }
     }
 }

Modified: cxf/trunk/rt/rs/security/oauth-parent/oauth/src/main/java/org/apache/cxf/rs/security/oauth/services/AuthorizationRequestHandler.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/security/oauth-parent/oauth/src/main/java/org/apache/cxf/rs/security/oauth/services/AuthorizationRequestHandler.java?rev=1405736&r1=1405735&r2=1405736&view=diff
==============================================================================
--- cxf/trunk/rt/rs/security/oauth-parent/oauth/src/main/java/org/apache/cxf/rs/security/oauth/services/AuthorizationRequestHandler.java
(original)
+++ cxf/trunk/rt/rs/security/oauth-parent/oauth/src/main/java/org/apache/cxf/rs/security/oauth/services/AuthorizationRequestHandler.java
Mon Nov  5 10:35:14 2012
@@ -36,7 +36,7 @@ import java.util.logging.Logger;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
-import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.BadRequestException;
 import javax.ws.rs.core.Response;
 import javax.ws.rs.core.UriBuilder;
 
@@ -88,7 +88,7 @@ public class AuthorizationRequestHandler
                 if (decision != null) {
                     // this is a user decision request, the session has expired or been possibly
hijacked
                     LOG.warning("Session authenticity token is missing or invalid");
-                    throw new WebApplicationException(400);
+                    throw new BadRequestException();
                 }
                 // assume it is an initial authorization request
                 addAuthenticityTokenToSession(secData, request);

Modified: cxf/trunk/rt/rs/security/oauth-parent/oauth/src/main/java/org/apache/cxf/rs/security/oauth/utils/OAuthUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/security/oauth-parent/oauth/src/main/java/org/apache/cxf/rs/security/oauth/utils/OAuthUtils.java?rev=1405736&r1=1405735&r2=1405736&view=diff
==============================================================================
--- cxf/trunk/rt/rs/security/oauth-parent/oauth/src/main/java/org/apache/cxf/rs/security/oauth/utils/OAuthUtils.java
(original)
+++ cxf/trunk/rt/rs/security/oauth-parent/oauth/src/main/java/org/apache/cxf/rs/security/oauth/utils/OAuthUtils.java
Mon Nov  5 10:35:14 2012
@@ -31,7 +31,7 @@ import java.util.StringTokenizer;
 import javax.servlet.ServletContext;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
-import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.NotAuthorizedException;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.MultivaluedMap;
 import javax.ws.rs.core.Response;
@@ -182,7 +182,7 @@ public final class OAuthUtils {
                 builder.entity(e.getMessage());    
             }
         }
-        throw new WebApplicationException(builder.build());
+        throw new NotAuthorizedException(builder.build());
     }
 
     public static List<String> parseParamValue(String paramValue, String defaultValue)


Modified: cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractAccessTokenValidator.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractAccessTokenValidator.java?rev=1405736&r1=1405735&r2=1405736&view=diff
==============================================================================
--- cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractAccessTokenValidator.java
(original)
+++ cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractAccessTokenValidator.java
Mon Nov  5 10:35:14 2012
@@ -23,7 +23,7 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 
-import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.InternalServerErrorException;
 import javax.ws.rs.core.Context;
 
 import org.apache.cxf.jaxrs.ext.MessageContext;
@@ -88,7 +88,7 @@ public abstract class AbstractAccessToke
     protected AccessTokenValidation getAccessTokenValidation() {
         AccessTokenValidation accessTokenV = null;
         if (dataProvider == null && tokenHandlers.isEmpty()) {
-            throw new WebApplicationException(500);
+            throw new InternalServerErrorException();
         }
         
         // Get the scheme and its data, Bearer only is supported by default

Modified: cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractOAuthService.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractOAuthService.java?rev=1405736&r1=1405735&r2=1405736&view=diff
==============================================================================
--- cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractOAuthService.java
(original)
+++ cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractOAuthService.java
Mon Nov  5 10:35:14 2012
@@ -20,7 +20,7 @@ package org.apache.cxf.rs.security.oauth
 
 import java.util.logging.Logger;
 
-import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.BadRequestException;
 import javax.ws.rs.core.Context;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.MultivaluedMap;
@@ -71,7 +71,7 @@ public abstract class AbstractOAuthServi
      * Get the {@link Client} reference
      * @param clientId the provided client id
      * @return Client the client reference 
-     * @throws WebApplicationException if no matching Client is found, 
+     * @throws {@link javax.ws.rs.WebApplicationException} if no matching Client is found,

      *         the error is returned directly to the end user without 
      *         following the redirect URI if any
      */
@@ -101,7 +101,7 @@ public abstract class AbstractOAuthServi
         if (!mc.getSecurityContext().isSecure()) {
             LOG.warning("Unsecure HTTP, Transport Layer Security is recommended");
             if (blockUnsecureRequests) {
-                throw new WebApplicationException(400);    
+                throw new BadRequestException();    
             }
         }
     }
@@ -109,7 +109,7 @@ public abstract class AbstractOAuthServi
     protected void reportInvalidRequestError(String errorDescription) {
         OAuthError error = 
             new OAuthError(OAuthConstants.INVALID_REQUEST, errorDescription);
-        throw new WebApplicationException(
+        throw new BadRequestException(
                   Response.status(400).type(MediaType.APPLICATION_JSON).entity(error).build());
     }
 

Modified: cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AccessTokenService.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AccessTokenService.java?rev=1405736&r1=1405735&r2=1405736&view=diff
==============================================================================
--- cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AccessTokenService.java
(original)
+++ cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AccessTokenService.java
Mon Nov  5 10:35:14 2012
@@ -24,10 +24,10 @@ import java.util.Collections;
 import java.util.List;
 
 import javax.ws.rs.Consumes;
+import javax.ws.rs.NotAuthorizedException;
 import javax.ws.rs.POST;
 import javax.ws.rs.Path;
 import javax.ws.rs.Produces;
-import javax.ws.rs.WebApplicationException;
 import javax.ws.rs.core.HttpHeaders;
 import javax.ws.rs.core.MultivaluedMap;
 import javax.ws.rs.core.Response;
@@ -167,7 +167,7 @@ public class AccessTokenService extends 
         }
         
         if (client == null) {
-            throw new WebApplicationException(401);
+            throw new NotAuthorizedException(Response.status(401).build());
         }
         return client;
     }
@@ -177,7 +177,7 @@ public class AccessTokenService extends 
         Client client = getClient(clientId);
         if (clientSecret == null || !client.getClientId().equals(clientId) 
             || !client.getClientSecret().equals(clientSecret)) {
-            throw new WebApplicationException(401);
+            throw new NotAuthorizedException(Response.status(401).build());
         }
         return client;
     }

Modified: cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/RedirectionBasedGrantService.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/RedirectionBasedGrantService.java?rev=1405736&r1=1405735&r2=1405736&view=diff
==============================================================================
--- cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/RedirectionBasedGrantService.java
(original)
+++ cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/RedirectionBasedGrantService.java
Mon Nov  5 10:35:14 2012
@@ -25,12 +25,13 @@ import java.util.List;
 import java.util.UUID;
 
 import javax.servlet.http.HttpSession;
+import javax.ws.rs.BadRequestException;
 import javax.ws.rs.Consumes;
 import javax.ws.rs.GET;
+import javax.ws.rs.NotAuthorizedException;
 import javax.ws.rs.POST;
 import javax.ws.rs.Path;
 import javax.ws.rs.Produces;
-import javax.ws.rs.WebApplicationException;
 import javax.ws.rs.core.MultivaluedMap;
 import javax.ws.rs.core.Response;
 
@@ -194,7 +195,7 @@ public abstract class RedirectionBasedGr
         
         // Make sure the session is valid
         if (!compareRequestAndSessionTokens(params.getFirst(OAuthConstants.SESSION_AUTHENTICITY_TOKEN)))
{
-            throw new WebApplicationException(400);     
+            throw new BadRequestException();     
         }
         //TODO: additionally we can check that the Principal that got authenticated
         // in startAuthorization is the same that got authenticated in completeAuthorization
@@ -261,7 +262,7 @@ public abstract class RedirectionBasedGr
         SecurityContext securityContext =  
             (SecurityContext)getMessageContext().get(SecurityContext.class.getName());
         if (securityContext == null || securityContext.getUserPrincipal() == null) {
-            throw new WebApplicationException(401);
+            throw new NotAuthorizedException(Response.status(401).build());
         }
         checkTransportSecurity();
         return securityContext;

Modified: cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/utils/AuthorizationUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/utils/AuthorizationUtils.java?rev=1405736&r1=1405735&r2=1405736&view=diff
==============================================================================
--- cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/utils/AuthorizationUtils.java
(original)
+++ cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/utils/AuthorizationUtils.java
Mon Nov  5 10:35:14 2012
@@ -23,7 +23,7 @@ import java.util.Collections;
 import java.util.List;
 import java.util.Set;
 
-import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.NotAuthorizedException;
 import javax.ws.rs.core.HttpHeaders;
 import javax.ws.rs.core.Response;
 import javax.ws.rs.core.Response.ResponseBuilder;
@@ -43,13 +43,13 @@ public final class AuthorizationUtils {
         try {
             authDecoded = new String(Base64Utility.decode(data));
         } catch (Exception ex) {
-            throw new WebApplicationException(401);
+            throw new NotAuthorizedException(ex);
         }
         String authInfo[] = authDecoded.split(":");
         if (authInfo.length == 2) {
             return authInfo;
         }
-        throw new WebApplicationException(401);
+        throw new NotAuthorizedException(Response.status(401).build());
     }
     
     public static String[] getAuthorizationParts(MessageContext mc) {
@@ -86,7 +86,7 @@ public final class AuthorizationUtils {
             rb.header(HttpHeaders.WWW_AUTHENTICATE, sb.toString());
         }
         Response r = rb.build();
-        throw new WebApplicationException(r);
+        throw new NotAuthorizedException(r);
     }
 
 }

Modified: cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/utils/OAuthContextUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/utils/OAuthContextUtils.java?rev=1405736&r1=1405735&r2=1405736&view=diff
==============================================================================
--- cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/utils/OAuthContextUtils.java
(original)
+++ cxf/trunk/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/utils/OAuthContextUtils.java
Mon Nov  5 10:35:14 2012
@@ -20,7 +20,9 @@ package org.apache.cxf.rs.security.oauth
 
 import java.util.List;
 
+import javax.ws.rs.NotAuthorizedException;
 import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.Response;
 import javax.ws.rs.core.Response.Status;
 
 import org.apache.cxf.jaxrs.ext.MessageContext;
@@ -125,7 +127,7 @@ public final class OAuthContextUtils {
     public static OAuthContext getContext(final MessageContext mc) {
         final OAuthContext oauth = mc.getContent(OAuthContext.class);
         if ((oauth == null) || (oauth.getSubject() == null) || (oauth.getSubject().getLogin()
== null)) {
-            throw new WebApplicationException(Status.UNAUTHORIZED);
+            throw new NotAuthorizedException(Response.status(401).build());
         }
         return oauth;
     }

Modified: cxf/trunk/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/AbstractServiceProviderFilter.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/AbstractServiceProviderFilter.java?rev=1405736&r1=1405735&r2=1405736&view=diff
==============================================================================
--- cxf/trunk/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/AbstractServiceProviderFilter.java
(original)
+++ cxf/trunk/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/AbstractServiceProviderFilter.java
Mon Nov  5 10:35:14 2012
@@ -30,7 +30,7 @@ import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import javax.annotation.PreDestroy;
-import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.InternalServerErrorException;
 import javax.ws.rs.core.Cookie;
 import javax.ws.rs.core.HttpHeaders;
 import javax.ws.rs.core.UriBuilder;
@@ -282,7 +282,7 @@ public abstract class AbstractServicePro
             //TODO: Review the possibility of using this filter
             //for validating SAMLResponse too
             reportError("MISSING_ASSERTION_SERVICE_URL");
-            throw new WebApplicationException(500);
+            throw new InternalServerErrorException();
         }
         if (!assertionConsumerServiceAddress.startsWith("http")) {
             String httpBasePath = (String)m.get("http.base.path");

Modified: cxf/trunk/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/RequestAssertionConsumerService.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/RequestAssertionConsumerService.java?rev=1405736&r1=1405735&r2=1405736&view=diff
==============================================================================
--- cxf/trunk/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/RequestAssertionConsumerService.java
(original)
+++ cxf/trunk/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/RequestAssertionConsumerService.java
Mon Nov  5 10:35:14 2012
@@ -32,6 +32,7 @@ import java.util.logging.Logger;
 import java.util.zip.DataFormatException;
 
 import javax.annotation.PreDestroy;
+import javax.ws.rs.BadRequestException;
 import javax.ws.rs.FormParam;
 import javax.ws.rs.GET;
 import javax.ws.rs.POST;
@@ -193,11 +194,11 @@ public class RequestAssertionConsumerSer
     private RequestState processRelayState(String relayState) {
         if (relayState == null) {
             reportError("MISSING_RELAY_STATE");
-            throw new WebApplicationException(400);
+            throw new BadRequestException();
         }
         if (relayState.getBytes().length < 0 || relayState.getBytes().length > 80)
{
             reportError("INVALID_RELAY_STATE");
-            throw new WebApplicationException(400);
+            throw new BadRequestException();
         }
         RequestState requestState = getStateProvider().removeRequestState(relayState);
         if (requestState == null) {
@@ -206,7 +207,7 @@ public class RequestAssertionConsumerSer
         }
         if (isStateExpired(requestState.getCreatedAt(), 0)) {
             reportError("EXPIRED_REQUEST_STATE");
-            throw new WebApplicationException(400);
+            throw new BadRequestException();
         }
         return requestState;
     }
@@ -217,7 +218,7 @@ public class RequestAssertionConsumerSer
     ) {
         if (StringUtils.isEmpty(samlResponse)) {
             reportError("MISSING_SAML_RESPONSE");
-            throw new WebApplicationException(400);
+            throw new BadRequestException();
         }
         
         String samlResponseDecoded = samlResponse;
@@ -227,7 +228,7 @@ public class RequestAssertionConsumerSer
             try {
                 samlResponseDecoded = URLDecoder.decode(samlResponse, "UTF-8");
             } catch (UnsupportedEncodingException e) {
-                throw new WebApplicationException(400);
+                throw new BadRequestException();
             }
         }
         */
@@ -239,15 +240,15 @@ public class RequestAssertionConsumerSer
                     ? new DeflateEncoderDecoder().inflateToken(deflatedToken)
                     : new ByteArrayInputStream(deflatedToken); 
             } catch (Base64Exception ex) {
-                throw new WebApplicationException(400);
+                throw new BadRequestException(ex);
             } catch (DataFormatException ex) {
-                throw new WebApplicationException(400);
+                throw new BadRequestException(ex);
             }
         } else {
             try {
                 tokenStream = new ByteArrayInputStream(samlResponseDecoded.getBytes("UTF-8"));
             } catch (UnsupportedEncodingException ex) {
-                throw new WebApplicationException(400);
+                throw new BadRequestException(ex);
             }
         }
         
@@ -264,10 +265,10 @@ public class RequestAssertionConsumerSer
         try {
             responseObject = OpenSAMLUtil.fromDom(responseDoc.getDocumentElement());
         } catch (WSSecurityException ex) {
-            throw new WebApplicationException(400);
+            throw new BadRequestException(ex);
         }
         if (!(responseObject instanceof org.opensaml.saml2.core.Response)) {
-            throw new WebApplicationException(400);
+            throw new BadRequestException();
         }
         return (org.opensaml.saml2.core.Response)responseObject;
     }
@@ -284,7 +285,7 @@ public class RequestAssertionConsumerSer
         } catch (WSSecurityException ex) {
             LOG.log(Level.FINE, ex.getMessage(), ex);
             reportError("INVALID_SAML_RESPONSE");
-            throw new WebApplicationException(400);
+            throw new BadRequestException();
         }
     }
     
@@ -314,7 +315,7 @@ public class RequestAssertionConsumerSer
             return ssoResponseValidator.validateSamlResponse(samlResponse, postBinding);
         } catch (WSSecurityException ex) {
             reportError("INVALID_SAML_RESPONSE");
-            throw new WebApplicationException(400);
+            throw new BadRequestException(ex);
         }
     }
     
@@ -328,7 +329,7 @@ public class RequestAssertionConsumerSer
         } else {
             reportError("MISSING_TARGET_URI");
         }
-        throw new WebApplicationException(400);
+        throw new BadRequestException();
     }
     
     private void reportError(String code) {

Modified: cxf/trunk/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/SamlPostBindingFilter.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/SamlPostBindingFilter.java?rev=1405736&r1=1405735&r2=1405736&view=diff
==============================================================================
--- cxf/trunk/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/SamlPostBindingFilter.java
(original)
+++ cxf/trunk/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/SamlPostBindingFilter.java
Mon Nov  5 10:35:14 2012
@@ -23,7 +23,7 @@ import java.security.PrivateKey;
 import java.security.cert.X509Certificate;
 
 import javax.security.auth.callback.CallbackHandler;
-import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.InternalServerErrorException;
 import javax.ws.rs.core.HttpHeaders;
 import javax.ws.rs.core.Response;
 
@@ -83,7 +83,7 @@ public class SamlPostBindingFilter exten
                                .build();
                 
             } catch (Exception ex) {
-                throw new WebApplicationException(ex);
+                throw new InternalServerErrorException(ex);
             }
         }
     }
@@ -107,17 +107,17 @@ public class SamlPostBindingFilter exten
         Crypto crypto = getSignatureCrypto();
         if (crypto == null) {
             LOG.fine("No crypto instance of properties file configured for signature");
-            throw new WebApplicationException();
+            throw new InternalServerErrorException();
         }
         String signatureUser = getSignatureUsername();
         if (signatureUser == null) {
             LOG.fine("No user configured for signature");
-            throw new WebApplicationException();
+            throw new InternalServerErrorException();
         }
         CallbackHandler callbackHandler = getCallbackHandler();
         if (callbackHandler == null) {
             LOG.fine("No CallbackHandler configured to supply a password for signature");
-            throw new WebApplicationException();
+            throw new InternalServerErrorException();
         }
         
         CryptoType cryptoType = new CryptoType(CryptoType.TYPE.ALIAS);

Modified: cxf/trunk/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/SamlRedirectBindingFilter.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/SamlRedirectBindingFilter.java?rev=1405736&r1=1405735&r2=1405736&view=diff
==============================================================================
--- cxf/trunk/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/SamlRedirectBindingFilter.java
(original)
+++ cxf/trunk/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/SamlRedirectBindingFilter.java
Mon Nov  5 10:35:14 2012
@@ -23,8 +23,9 @@ import java.net.URLEncoder;
 import java.security.PrivateKey;
 import java.security.Signature;
 import java.security.cert.X509Certificate;
+
 import javax.security.auth.callback.CallbackHandler;
-import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.InternalServerErrorException;
 import javax.ws.rs.core.HttpHeaders;
 import javax.ws.rs.core.Response;
 import javax.ws.rs.core.UriBuilder;
@@ -74,7 +75,7 @@ public class SamlRedirectBindingFilter e
                                .build();
             } catch (Exception ex) {
                 ex.printStackTrace();
-                throw new WebApplicationException(ex);
+                throw new InternalServerErrorException(ex);
             }
         }
     }
@@ -103,17 +104,17 @@ public class SamlRedirectBindingFilter e
         Crypto crypto = getSignatureCrypto();
         if (crypto == null) {
             LOG.fine("No crypto instance of properties file configured for signature");
-            throw new WebApplicationException();
+            throw new InternalServerErrorException();
         }
         String signatureUser = getSignatureUsername();
         if (signatureUser == null) {
             LOG.fine("No user configured for signature");
-            throw new WebApplicationException();
+            throw new InternalServerErrorException();
         }
         CallbackHandler callbackHandler = getCallbackHandler();
         if (callbackHandler == null) {
             LOG.fine("No CallbackHandler configured to supply a password for signature");
-            throw new WebApplicationException();
+            throw new InternalServerErrorException();
         }
         
         CryptoType cryptoType = new CryptoType(CryptoType.TYPE.ALIAS);

Modified: cxf/trunk/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/AbstractSamlInHandler.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/AbstractSamlInHandler.java?rev=1405736&r1=1405735&r2=1405736&view=diff
==============================================================================
--- cxf/trunk/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/AbstractSamlInHandler.java
(original)
+++ cxf/trunk/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/AbstractSamlInHandler.java
Mon Nov  5 10:35:14 2012
@@ -28,7 +28,7 @@ import java.security.cert.X509Certificat
 import java.util.List;
 import java.util.logging.Logger;
 
-import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.NotAuthorizedException;
 import javax.ws.rs.core.Response;
 
 import org.w3c.dom.Document;
@@ -158,7 +158,7 @@ public abstract class AbstractSamlInHand
         // to rt/rs/security
         LOG.warning(error);
         Response response = Response.status(401).entity(error).build();
-        throw ex != null ? new WebApplicationException(ex, response) : new WebApplicationException(response);
+        throw ex != null ? new NotAuthorizedException(ex, response) : new NotAuthorizedException(response);
     }
     
     /**

Modified: cxf/trunk/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/AbstractXmlSecInHandler.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/AbstractXmlSecInHandler.java?rev=1405736&r1=1405735&r2=1405736&view=diff
==============================================================================
--- cxf/trunk/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/AbstractXmlSecInHandler.java
(original)
+++ cxf/trunk/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/AbstractXmlSecInHandler.java
Mon Nov  5 10:35:14 2012
@@ -23,7 +23,7 @@ import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.util.logging.Logger;
 
-import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.BadRequestException;
 import javax.ws.rs.core.Response;
 import javax.xml.stream.XMLStreamReader;
 
@@ -81,7 +81,7 @@ public abstract class AbstractXmlSecInHa
     protected void throwFault(String error, Exception ex) {
         LOG.warning(error);
         Response response = Response.status(400).entity(error).build();
-        throw ex != null ? new WebApplicationException(ex, response) : new WebApplicationException(response);
+        throw ex != null ? new BadRequestException(response, ex) : new BadRequestException(response);
     }
 
     protected Element getNode(Element parent, String ns, String name, int index) {



Mime
View raw message