You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by gn...@apache.org on 2006/09/25 13:14:45 UTC
svn commit: r449651 -
/incubator/servicemix/trunk/servicemix-components/src/main/java/org/apache/servicemix/components/http/HttpBindingSupport.java
Author: gnodet
Date: Mon Sep 25 04:14:45 2006
New Revision: 449651
URL: http://svn.apache.org/viewvc?view=rev&rev=449651
Log:
SM-570: HTTP connector can blow up while trying to report a problem
Modified:
incubator/servicemix/trunk/servicemix-components/src/main/java/org/apache/servicemix/components/http/HttpBindingSupport.java
Modified: incubator/servicemix/trunk/servicemix-components/src/main/java/org/apache/servicemix/components/http/HttpBindingSupport.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-components/src/main/java/org/apache/servicemix/components/http/HttpBindingSupport.java?view=diff&rev=449651&r1=449650&r2=449651
==============================================================================
--- incubator/servicemix/trunk/servicemix-components/src/main/java/org/apache/servicemix/components/http/HttpBindingSupport.java (original)
+++ incubator/servicemix/trunk/servicemix-components/src/main/java/org/apache/servicemix/components/http/HttpBindingSupport.java Mon Sep 25 04:14:45 2006
@@ -24,6 +24,7 @@
import javax.jbi.JBIException;
import javax.jbi.messaging.NormalizedMessage;
import java.io.IOException;
+import java.io.OutputStream;
import java.io.PrintWriter;
/**
@@ -59,7 +60,13 @@
protected void outputException(HttpServletResponse response, Exception e) throws IOException {
response.setStatus(BAD_REQUEST_STATUS_CODE);
- PrintWriter writer = response.getWriter();
+ PrintWriter writer = null;
+ try {
+ writer = response.getWriter();
+ } catch (IllegalStateException ise) {
+ OutputStream os = response.getOutputStream();
+ writer = new PrintWriter (os);
+ }
writer.println("Request failed with error: " + e);
e.printStackTrace(writer);
}