Steven,

Thanks for the reply, this has me stumped. Sorry for the lack of information, but I just wasn't sure where to turn. I was hoping somebody could give me a starting point. I've been through the JSPs, server.xml and httpd.conf without luck. I compared the IDE's server.xml with the production server.xml and I can't find anything different. I'm more of a programmer than a sysadmin so I may be missing something incredibly simple.

     One thought that comes to mind is, wtf are you *trying* to do
with the second URL?

The page I used for a the sample URL is pretty basic and doesn't normally use the GET method. I just used it as an example because it is a fairly simple page and just passing a parameter to it on the URL shouldn't cause a failure. Passing parameters to any JSP pages causes the failure. The page is just a simple form that uses JSTL for some content processing. It currently doesn't call a bean directly.


<[EMAIL PROTECTED] contentType="text/html"%>
<[EMAIL PROTECTED] prefix="c" uri="http://java.sun.com/jstl/core"; %>
<[EMAIL PROTECTED] prefix="sql" uri="http://java.sun.com/jstl/sql"; %>
<html>
<head><title>NFL 2003 Contest</title></head>
<body bgcolor="#ffffff">
<font face="Arial">
<c:if test='${not empty param.username}'>
<sql:query var='row'>
SELECT * FROM contestants where user_name = ? and password = ?
<sql:param value='${param.username}'/>
<sql:param value='${param.password}'/>
</sql:query>
<c:choose>
<c:when test='${row.rowCount == 0}'>
The username and password you entered does not match our records.<br>
Please reenter them or <a href="signup.jsp">create</a> a new account.
</c:when>
<c:otherwise>
<c:set var='userName' value='${param.username}' scope='session'/>
<c:redirect url='enterpicks.jsp'/>
</c:otherwise>
</c:choose>
</c:if>


<form method="post">
<table border=1 cellpadding=5>
<tr><td>
<table border=0 width="100%">
<tr><td colspan=2 align=center>Sign In<br><br></td></tr>
<tr><td align="right">Username: </td><td><input type="text" name="username" maxlength=15 size=15 value="<c:out value='${param.username}'/>"></td></tr>
<tr><td align="right">Password: </td><td><input type="password" name="password" maxlength=15 size=15><br><br></td></tr>
<tr><td></td><td><input type="submit" value="Sign In"></td></tr>
</table>
</td></tr>
<tr><td>If you don't have a login then you can <a href="signup.jsp">signup here</a>.</td></tr>
</table>
</form>


</font>

</body>
</html>


The only odd thing on the page is that <form method="post"> doesn't have an action attached, but the results are the same if I add an action statement to the tag.


     I would also highly recommend using telnet to www.gamesquick.com
port 80 and simulating the two requests, to see exactly what error the
server is sending back to your browser.

How do I send a request through telnet? I can telnet to port 80, but I don't know what it is waiting for. If I type in GET I get the index page from my default virtual host. If I try typing anything after the GET I get a 400 error.


Try installing a vanilla stand-alone tomcat, and test the second
version with that.  If the problem goes away, then you know you need
to tweak your mod_jk mappings.

I'll setup the stand alone again and see what happens. When you say "tweak your mod_jk mappings" what file are you referring to?


     Further, it was back in 1996 that I last saw this behavior, and I
suspect that today servlets might be smarter about this.

What's interesting is that I remember this same behavior from my last job. There we were using Oracle iAS which is based on Apache and Orion. I don't remember if they fixed the issue or we just coded around it. But it doesn't really matter since I don't work there any longer and it doesn't apply to this issue. ;^)


     Ideally, the next step in troubleshooting this would be to look
at your logs and see exactly what requests mod_jk is forwarding, and
exactly what error tomcat is reporting when you request the second
URL.

In looking at the mod_jk log I am getting this error:


[Sat May 31 10:45:20 2003] [jk_uri_worker_map.c (595)]: In jk_uri_worker_map_t::map_uri_to_worker, wrong parameters

I just tried google, but didn't find anything useful. I'll set the logging back to debug to see if it turns up any more information. Also, as I mentioned before catalina.out is logging "[Ajp13] bad read: -103". The Apache error log reports:

[Sat May 31 11:32:31 2003] [notice] child pid 7807 exit signal Segmentation Fault (11)

Next I'll try the stand alone again.

Thanks,

Jeff




On Saturday, May 31, 2003, at 01:18 AM, Steven J. Owens wrote:


On Fri, May 30, 2003 at 05:57:25PM -0700, Jeff Knox wrote:
Hmm, I just realized something I didn't mention -- the pages in
question work in the development environment (Sun ONE Studio). The
development environment uses it's own instance of Tomcat to parse the
pages. When I push the files over to the production environment it
fails. This leads me to believe that it's a configuration issue, but I
don't have a clue as to what would cause a failure at this point.
Examples:

   http://www.gamesquick.com/nfl2003/login.jsp
   http://www.gamesquick.com/nfl2003/login.jsp?username=bob

Both of the above URLs work from within the IDE while the second one
fails in the production environment. And when it fails it says it can't
find the server! Where might I look to figure out what the difference
is?

Hm... lacking a *lot* of information here, it's impossible to say what's happening. What exactly are you seeing?

     I tried to load both URLs, the second URL doesn't load.  I tried
to troubleshoot this by telnetting to www.gamesquick.com, port 80, and
simulating an HTTP GET request to get the login page, but *that*
didn't work for either URL.

     One thought that comes to mind is, wtf are you *trying* to do
with the second URL?

     Unless the login.jsp is coded to grab the username parameter from
the GET request and use it to pre-populate the login form, the second
URL should, at best, just produce the blank login form.  Maybe you
should post your JSP source.

Both instances are running on the same physical box. The working
version runs in Tomcat under the IDE. The failing one runs in an
Apache/Tomcat setup using mod_jk to handle the JSP requests.

This last detail (mod_jk) definitely points to a mapping issue. Try installing a vanilla stand-alone tomcat, and test the second version with that. If the problem goes away, then you know you need to tweak your mod_jk mappings.

On Sat, 31 May 2003 08:30, Jeff Knox wrote:
Has anybody ever seen JSP pages that work with forms using the POST
method and not the GET method?

Just for the record, I have never seen this. It's conceivably possible, depending much on the JSP compiler, but unlikely. If it were going to happen, it would be like this:

     The JSP generates a servlet.  Normally when you code your own
servlet, you define one or more of the HTTP request types (GET, POST,
HEAD, etc).  A given request type has a specified method implemented
on the servlet (doPost(), doGet(), doHead(), etc).  If you then
atttempt one of the unimplemented requests with that servlet, you
would get an error.

     So, conceivably your JSP might generate a servlet that only has
one of doGet() or doPost() implemented.  However, I have no idea how
this is defined in the JSP spec, so I would not assume this is
happening.

     Further, it was back in 1996 that I last saw this behavior, and I
suspect that today servlets might be smarter about this.  I *know* for
a fact that if you use a POST but you define the
ACTION="http://foo.com?bar=baz";, the bar=baz parameter will carry
through.  This sort of fact, though strictly speaking unrelated,
suggests that the JSP compiler might be equally smart about generating
both doPost() and doGet() methods.


Having said all of this, your question above, and the further example URLS you post, do not agree. There's nothing in the examples you posted, or the further description of the problem, that suggests that you're actually seeing a JSP that works wtih a POST but not a GET. It's just suggesting that your mapping or your JSP is incorrectly defined, so that the username parameter trips things up.

     Ideally, the next step in troubleshooting this would be to look
at your logs and see exactly what requests mod_jk is forwarding, and
exactly what error tomcat is reporting when you request the second
URL.

     I would also highly recommend using telnet to www.gamesquick.com
port 80 and simulating the two requests, to see exactly what error the
server is sending back to your browser.  I tried a moment ago, but I'm
apparently too tired or too drunk to even get the first URL
successfully.

Good luck.

--
Steven J. Owens
[EMAIL PROTECTED]

"I'm going to make broad, sweeping generalizations and strong,
 declarative statements, because otherwise I'll be here all night and
 this document will be four times longer and much less fun to read.
 Take it all with a grain of salt." - Me at http://darksleep.com


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to