[CC'ed to xindice-dev to get somone to review and commit the fix. ;) ]

Hey Jeff,

Stewart, Jeffrey E wrote:
I'm getting the following exception from the listcontacts url:
http://localhost:8080/Addressbook/servlet/Task?action=listcontacts


Your installation of the addressbook is encountering a problem when you are running it. An exception is getting thrown and the Task class is trying to output an error message. Unfortunately, a response has already been comittted back to the browser so the IllegalStateException you are seeing is getting thrown, and masking the real error.


Apply the attached patch and rebuild the Addressbook example. Redeploy it and you should see a stack trace for the real problem instead, which may tell what the real problem actually is.

HTH,
Mike

--
Mike Gratton <[EMAIL PROTECTED]>, <http://web.vee.net/>
"Every motive escalate."
Index: java/examples/Addressbook/src/java/addressbook/Task.java
===================================================================
RCS file: 
/home/cvspublic/xml-xindice/java/examples/Addressbook/src/java/addressbook/Task.java,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 Task.java
--- java/examples/Addressbook/src/java/addressbook/Task.java    6 Dec 2001 
19:33:52 -0000       1.1.1.1
+++ java/examples/Addressbook/src/java/addressbook/Task.java    9 Mar 2002 
03:05:05 -0000
@@ -173,15 +173,19 @@
          }
          
       } catch( Exception e ) {
-         // Catch the exception and send the user to the error page
+         e.printStackTrace();
+
+        // there's not else we can do if the response is committed
+        if (response.isCommitted())
+            return;
+
+         // Catch the exception and send the user to the error page     
          if (e.getMessage() != null ) {
             response.sendRedirect("/Addressbook/error.jsp?error=" + 
URLEncoder.encode(e.getMessage()) );
          }
          else {
             response.sendRedirect("/Addressbook/error.jsp" );
          }
-         
-         e.printStackTrace();
       }
    }
    

Reply via email to