Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2377
  • Last Modified:

org.apache.tomcat.util.http.Parameters processParameters ... invalid chunk

request.getParameter("username") generates an invalid chunk error???

I wrote a quick servlet to do some testing, ie: a login servlet

Mar 17, 2011 2:08:49 AM org.apache.tomcat.util.http.Parameters processParameters
WARNING: Parameters: Invalid chunk '=usertest' ignored.
Mar 17, 2011 2:08:49 AM org.apache.tomcat.util.http.Parameters processParameters
WARNING: Parameters: Invalid chunk '=password' ignored.


--------------------------
Tomcat 7.0
jdk 1.6.0_24
eclipse



Any thoughts?
Thanks!
@WebServlet("/Login")
public class Login extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    public Login() {
        super();
    }

		protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
				String username = request.getParameter(Properties.username);
				String password = request.getParameter(Properties.password);
		}
}

------------------------html/jsp----------------------------
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
	
	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
	<title>test</title>
	
	</head>
	<body>
		<form method="POST" action="Login">
			<table>
			  <tr>
			    <td align="right">Username</td>
			    <td><input id="username" type="text" name="" /></td>
			  </tr>
			  <tr>
			    <td align="right">Password</td>
			    <td><input type="password" name="" /></td>
			  </tr>
			  <tr>
			    <td colspan="2" align="right">
			      <input type="submit" value="Login" />
			      <input type="reset" value="Reset" />
			    </td>
			  </tr>
			</table>
			</form>
	</body>
</html>

Open in new window

0
phx7
Asked:
phx7
  • 6
  • 4
2 Solutions
 
phx7Author Commented:
Ok, now I am really trying to figure this out.
reinstalled eclipse
reinstalled jdk
wrote it in a jsp instead of a servlet, and I am getting the same invalid error....

Where does it get the = in the '=password' from????
0
 
mrcoffee365Commented:
Could this person be talking about the same problem:
http://forum.springsource.org/showthread.php?t=49865

Apparently some frameworks read a form and if you don't define variables for the fields, it "creates" them.  Poorly, in this case.  Did you give us the full configuration?  Are you maybe using jsf faces (or ice faces) or spring, or something like that?
0
 
phx7Author Commented:
I had read that posting, but it didn't help

I suppose that is what shocked me. I downloaded the
      latest jdk 6u24,
      latest official release of Helios eclipse .. eclipse-jee-helios-SR2-win32-x86_64.zip
      latest Tomcat 7.0.11 and started a new project with just that code and one file that I added to hold public static final String variables to use as keys to get parameters.

Yeah, added the constants when I thought maybe I kept spelling things differently from the form to the servlet.... didn't help, that wasn't the problem.

copied the workspace to another computer... same problem.

downloaded netbeans...  copied the code over and it worked!  Head scratch  (same question in my head... what is eclipse finding?)

so, on the second computer, I blew everything away again, did a search for anything resembling eclipse or tomcat anywhere in the file system.

started over with fresh downloads.  AGAIN...  but it used the jdk6u16 and typed everything from scratch again and it worked.... So, call me stumped as to why that was happening, what it was finding... but, I am no longer stuck, just curious now as to what in the world is/was going on!

ps.... can switch the jdk back to 6u24 and it works, so its not the jvm
SO..  my best guess is that it was any combination of the following:
    A)eclipse install base being bad
    B)eclipse finding some plugin on my system without asking
    C)some hidden text that I can't see that was in the code (which I typed)
    D)Tomcat
    E)???
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
mrcoffee365Commented:
Good that you fixed it.  Going with the possible mis-typing:  It could be that one of the form variables didn't get name= assigned to it in your HTML.  Which could result in this warning if you're using icefaces.  Some explanation here:
http://jira.icefaces.org/browse/ICE-1677
0
 
phx7Author Commented:
Thanks. Icefaces would be interesting.
again.. I have no idea on that form, as it worked copy paste into a new netbeans project.

Yeah, I have not picked a framework for this new project yet, I have done projects in Spring, Struts and jsp/EJB in the past, but never had an opportunity for a JSF technology.
0
 
mrcoffee365Commented:
And you said that now it works copy/paste into Eclipse.

Possibly -- the java for the form didn't get recompiled as you fixed it, so that putting it into a new environment where it had never been compiled caused a new compilation and your fixes were picked up.  

It's also possible that you checked a flag when you created the project in eclipse which resulted in one of the frameworks being automatically set up -- which then behaved oddly.  And the same checkboxes didn't exist for netbeans, so you didn't run into it.
0
 
phx7Author Commented:

Here is my uh DUH!!!!

<tr>
  <td align="right">Username</td>
  <td><input id="username" type="text" name="" /></td>
</tr>
 <tr>
    <td align="right">Password</td>
    <td><input type="password" name="" /></td>
 </tr>

helps if the input's have names  :)

<tr>
  <td align="right">Username</td>
  <td><input id="username" type="text" name="username" /></td>
</tr>
 <tr>
    <td align="right">Password</td>
    <td><input type="password" name="password" /></td>
 </tr>
0
 
mrcoffee365Commented:
Cool -- that explains it.  So we were right, it was a "helpful" framework-style warning.
0
 
phx7Author Commented:
LOL!
Yeah, real helpful "warning"    :)

It's always the little things that get you...

Thanks again for your help!
You should have been awarded the points by now.
0
 
phx7Author Commented:
Grade is due to this being one of those questions that are answered, but not answered.  No fault of any solution provider. I think they were heading the right way and would have found a solution.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 6
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now