Solved

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

Posted on 2011-03-17
10
1,791 Views
Last Modified: 2013-11-24
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
Comment
Question by:phx7
  • 6
  • 4
10 Comments
 

Author Comment

by:phx7
ID: 35160588
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
 
LVL 26

Accepted Solution

by:
mrcoffee365 earned 500 total points
ID: 35162889
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
 

Assisted Solution

by:phx7
phx7 earned 0 total points
ID: 35166515
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
 
LVL 26

Expert Comment

by:mrcoffee365
ID: 35167026
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
 

Author Comment

by:phx7
ID: 35167224
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 26

Expert Comment

by:mrcoffee365
ID: 35167538
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
 

Author Comment

by:phx7
ID: 35169021

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
 
LVL 26

Expert Comment

by:mrcoffee365
ID: 35169332
Cool -- that explains it.  So we were right, it was a "helpful" framework-style warning.
0
 

Author Comment

by:phx7
ID: 35169404
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
 

Author Closing Comment

by:phx7
ID: 35196670
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

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

I had a project requirement for a displaying a user workbench .This workbench would consist multiple data grids .In each grid the user will be able to see a large number of data. These data grids should allow the user to 1. Sort 2. Export the …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now