vmassol 01/11/14 13:14:44
Modified: docs/framework/xdocs faq.xml
Log:
new faq entry thanks to Nicholas Lesiecki
Revision Changes Path
1.2 +88 -10 jakarta-cactus/docs/framework/xdocs/faq.xml
Index: faq.xml
===================================================================
RCS file: /home/cvs/jakarta-cactus/docs/framework/xdocs/faq.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- faq.xml 2001/11/05 21:57:42 1.1
+++ faq.xml 2001/11/14 21:14:43 1.2
@@ -15,33 +15,40 @@
<s1 title="FAQ Content">
<ul>
<li>
- <jump anchor="faq1_web_xml_production">How can I have a web.xml that is
valid both for
+ <jump anchor="faq1">How can I have a web.xml that is valid both for
testing and for production ?</jump>
</li>
+ <li>
+ <jump anchor="faq2">I'm getting a
+ <code>java.io.StreamCorruptedException: InputStream does not contain a
+ serialized object</code> error. What does it mean ?</jump>
+ </li>
</ul>
</s1>
- <anchor id="faq1_web_xml_production"/>
+ <anchor id="faq1"/>
<s1 title="How can I have a web.xml that is valid both for testing and for
production ?">
<p>
- <em>submitted by <link href="mailto:[EMAIL PROTECTED]">Erik
Hatcher</link></em>
+ <em>submitted by
+ <link href="mailto:[EMAIL PROTECTED]">Erik Hatcher</link></em>
</p>
<s2 title="Question">
<p>
- Cactus needs to have a few entries set in the <code>web.xml</code> file
(redirector
- definition and mappings mostly). The application to test also needs its
own entries.
- What would be nice would be to be able to use the same
<code>web.xml</code> file in
- the build process for both application testing and deployment to
production.
+ Cactus needs to have a few entries set in the <code>web.xml</code>
+ file (redirector definition and mappings mostly). The application to
+ test also needs its own entries. What would be nice would be to be
+ able to use the same <code>web.xml</code> file in the build process
+ for both application testing and deployment to production.
</p>
</s2>
<s2 title="Solution">
<p>
Here's how I accomplished conditional inclusion
- of Cactus web.xml configuration. My web.xml file is capable of working
- standalone without requiring any filtered copy to work. In Ant I'm
doing
- this:
+ of Cactus web.xml configuration. My web.xml file is capable of
+ working standalone without requiring any filtered copy to work.
+ In Ant I'm doing this:
</p>
<source><![CDATA[
<!-- Activate the Cactus web.xml configuration -->
@@ -88,6 +95,77 @@
@end.cactus.config@ End Cactus Configuration -->
]]></source>
+ </s2>
+
+ </s1>
+
+ <anchor id="faq2"/>
+ <s1 title="I'm getting a java.io.StreamCorruptedException error. What does it
mean ?">
+
+ <p>
+ <em>submitted by
+ <link href="mailto:[EMAIL PROTECTED]">Nicholas Lesiecki</link></em>
+ </p>
+
+ <s2 title="Solution">
+ <p>
+ This exception results when client-side Cactus code attempts to talk
+ to a misconfigured installation of Cactus on the server side. The
+ reason for the obscure exception is this: Cactus makes two requests
+ to the server. In the first, the client-side test runner requests that
+ such-and-such a test be run on the server (an oversimplification,
+ please see: XXXX). Immediately after the response from the server
+ the client code makes a second request, this time for the results of
+ the server-side test. Cactus is supposed to send back a serialized
+ Object containing the results. Cactus then attempts to deserialize
+ this Object from the input stream in the response. If
+ Cactus is installed properly on the server, this process
+ works transparently. If not (for instance the second
+ request does not even arrive at a Cactus redirector) then
+ the response to the second request (which very well may be
+ a 404 or 500 error) will not contain the object that
+ client-cactus expects. This leads to the
+ StreamCorruptedException.
+ </p>
+ <p>
+ When troubleshooting this error, the most likely prospect
+ is that the requests from client-Cactus are not even
+ reaching server-Cactus. This can happen when the
+ <code>cactus.properties</code> contains a bad entry. For instance, I
+ have run into this problem when building several different
+ testing-applications. I tried to run my tests against
+ <code>http://localhost/webapp1/ServletRedirector/</code> when I needed
+ to be running against
+ <code>http://localhost/webapp2/ServletRedirector/</code>. This can
+ also happen if your web.xml file contains an error, or does not
+ properly map the URLs contained in cactus.properties to the
+ Cactus redirectors.
+ </p>
+ <p>
+ A good way to check whether your requests are reaching a
+ Cactus redirector is to manually enter in the URLs for all
+ of the redirectors you use into the navigation bar of your
+ web-browser. If the URL yields a 500 error and you get a
+ stack trace (in the log or along with your error page that)
+ says <code><![CDATA[Missing service name
+ parameter [] in HTTP request.]]></code>
+ then that particular URL is probably pointing to a valid
+ server-side Cactus install.
+ </p>
+ <p>
+ Another likely error is that your server-side classpath
+ does not contain a copy of the cactus.jar. (Cactus is
+ effectively not present on the server.) According to
+ e-mails on the Cactus user list, the
+ StreamCorruptedException could also result when you are
+ using the wrong version of the servlet.jar in some area
+ (any version prior to 2.2, or using servlet.jar 2.2 with a
+ Cactus-2.3 installation).
+ </p>
+ <p>
+ Cactus 1.3 should trap or avoid this exception and provide
+ a clearer message about the likely causes.
+ </p>
</s2>
</s1>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>