You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by ni...@apache.org on 2011/02/24 14:56:27 UTC

svn commit: r1074152 - in /cxf/branches/2.3.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport: http/AbstractHTTPDestination.java servlet/ServletDestination.java

Author: ningjiang
Date: Thu Feb 24 13:56:26 2011
New Revision: 1074152

URL: http://svn.apache.org/viewvc?rev=1074152&view=rev
Log:
CXF-3362 Fix the servlet systest error

Modified:
    cxf/branches/2.3.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java
    cxf/branches/2.3.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletDestination.java

Modified: cxf/branches/2.3.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java?rev=1074152&r1=1074151&r2=1074152&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java (original)
+++ cxf/branches/2.3.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java Thu Feb 24 13:56:26 2011
@@ -376,17 +376,25 @@ public abstract class AbstractHTTPDestin
         return retrieveFromServlet3Async(req);
     }
     protected Message retrieveFromServlet3Async(HttpServletRequest req) {
-        if (req.isAsyncStarted()) {
-            return (Message)req.getAttribute(CXF_CONTINUATION_MESSAGE);
+        try {
+            if (req.isAsyncStarted()) {
+                return (Message)req.getAttribute(CXF_CONTINUATION_MESSAGE);
+            }
+        } catch (Throwable ex) {
+            // the request may not implement the Servlet3 API
         }
         return null;
     }
     protected void setupContinuation(Message inMessage,
                       final HttpServletRequest req, 
                       final HttpServletResponse resp) {
-        if (isServlet3 && req.isAsyncSupported()) {
-            inMessage.put(ContinuationProvider.class.getName(), 
+        try {
+            if (isServlet3 && req.isAsyncSupported()) {
+                inMessage.put(ContinuationProvider.class.getName(), 
                           new Servlet3ContinuationProvider(req, resp, inMessage));
+            }
+        } catch (Throwable ex) {
+            // the request may not implement the Servlet3 API
         }
     }
     protected String getBasePath(String contextPath) throws IOException {

Modified: cxf/branches/2.3.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletDestination.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletDestination.java?rev=1074152&r1=1074151&r2=1074152&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletDestination.java (original)
+++ cxf/branches/2.3.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletDestination.java Thu Feb 24 13:56:26 2011
@@ -76,8 +76,12 @@ public class ServletDestination extends 
     protected Message retrieveFromServlet3Async(HttpServletRequest req) {
         // It looks current Servlet3 implementation request doesn't pass the isAsyncStart 
         // status to the redispatched request
-        if (req.isAsyncSupported()) {
-            return (Message)req.getAttribute(CXF_CONTINUATION_MESSAGE);
+        try {
+            if (req.isAsyncSupported()) {
+                return (Message)req.getAttribute(CXF_CONTINUATION_MESSAGE);
+            }
+        } catch (AbstractMethodError ex) {
+            // the request may not implement the Servlet3 API
         }
         return null;
     }