aspose file tools*
The moose likes Servlets and the fly likes unable to find line starting with Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "unable to find line starting with "HTTP" " Watch "unable to find line starting with "HTTP" " New topic
Author

unable to find line starting with "HTTP"

chaohua wang
Ranch Hand

Joined: Dec 22, 2002
Posts: 62
Hi, Folks,

I am using Apache HttpClient 3.1, to send the resuest to a servlet server.

The code is simple:

HttpClient client = new HttpClient();
GetMethod method = new GetMethod( myURL ); byte[] responseBody = method.getResponseBody();

When I sent a short a url string with few parameters , it works fine.

But when I sent a very long url string with too many parameters,

I got this exception:

org.apache.commons.httpclient.HttpRecoverableException:
org.apache.commons.httpclient.HttpRecoverableException
: Error in parsing the status line from the response: unable to find line starting with "HTTP"
at
org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase
.java:1965)
at
org.apache.commons.httpclient.HttpMethodBase.processRequest(HttpMethodBa
se.java:2659)
at
org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java
:1093)
at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:6
75)
at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:5
29)


I think that a heavy load in servlet server site, so servlet refuse the request. How to increase load for servlet.

Thank you very much, Please help.

Chwang


For example these following parameters I need to contains them in url.
If cut them to half, it works fine. But if not, I got "unable to find line starting with "HTTP" "

(tblCase.CaseTypeCode = '210000' OR tblCase.CaseTypeCode = '210001' OR tblCase.CaseTypeCode = '210002' OR tblCase.CaseTypeCode = '210003' OR tblCase.CaseTypeCode = '210004' OR tblCase.CaseTypeCode = '210005' OR tblCase.CaseTypeCode = '210006' OR tblCase.CaseTypeCode = '210007' OR tblCase.CaseTypeCode = '210008' OR tblCase.CaseTypeCode = '210009' OR tblCase.CaseTypeCode = '210010' OR tblCase.CaseTypeCode = '210011' OR tblCase.CaseTypeCode = '210012' OR tblCase.CaseTypeCode = '210013' OR tblCase.CaseTypeCode = '210014' OR tblCase.CaseTypeCode = '210015' OR tblCase.CaseTypeCode = '210016' OR tblCase.CaseTypeCode = '210017' OR tblCase.CaseTypeCode = '210018' OR tblCase.CaseTypeCode = '210019' OR tblCase.CaseTypeCode = '210020' OR tblCase.CaseTypeCode = '210026' OR tblCase.CaseTypeCode = '210030' OR tblCase.CaseTypeCode = '210099' OR tblCase.CaseTypeCode = '210500' OR tblCase.CaseTypeCode = '210501' OR tblCase.CaseTypeCode = '210502' OR tblCase.CaseTypeCode = '211000' OR tblCase.CaseTypeCode = '211001' OR tblCase.CaseTypeCode = '212002' OR tblCase.CaseTypeCode = '212009' OR tblCase.CaseTypeCode = '213000' OR tblCase.CaseTypeCode = '213001' OR tblCase.CaseTypeCode = '213002' OR tblCase.CaseTypeCode = '213700' OR tblCase.CaseTypeCode = '213701' OR tblCase.CaseTypeCode = '214000' OR tblCase.CaseTypeCode = '214001' OR tblCase.CaseTypeCode = '214002' OR tblCase.CaseTypeCode = '214100' OR tblCase.CaseTypeCode = '214101' OR tblCase.CaseTypeCode = '215000' OR tblCase.CaseTypeCode = '215001' OR tblCase.CaseTypeCode = '215002' OR tblCase.CaseTypeCode = '215003' OR tblCase.CaseTypeCode = '215005' OR tblCase.CaseTypeCode = '216001' OR tblCase.CaseTypeCode = '218000' OR tblCase.CaseTypeCode = '218001' OR tblCase.CaseTypeCode = '218002' OR tblCase.CaseTypeCode = '218003' OR tblCase.CaseTypeCode = '218004' OR tblCase.CaseTypeCode = '218005' OR tblCase.CaseTypeCode = '218006' OR tblCase.CaseTypeCode = '218007' OR tblCase.CaseTypeCode = '218008' OR tblCase.CaseTypeCode = '218009' OR tblCase.CaseTypeCode = '218010' OR tblCase.CaseTypeCode = '218011' OR tblCase.CaseTypeCode = '218012' OR tblCase.CaseTypeCode = '218013' OR tblCase.CaseTypeCode = '218014' OR tblCase.CaseTypeCode = '218015' OR tblCase.CaseTypeCode = '218016' OR tblCase.CaseTypeCode = '218017' OR tblCase.CaseTypeCode = '218018' OR tblCase.CaseTypeCode = '218019' OR tblCase.CaseTypeCode = '218020' OR tblCase.CaseTypeCode = '218021' OR tblCase.CaseTypeCode = '218022' OR tblCase.CaseTypeCode = '218023' OR tblCase.CaseTypeCode = '218024' OR tblCase.CaseTypeCode = '218025' OR tblCase.CaseTypeCode = '218030' OR tblCase.CaseTypeCode = '218035' OR tblCase.CaseTypeCode = '218040' OR tblCase.CaseTypeCode = '218050' OR tblCase.CaseTypeCode = '218060' OR tblCase.CaseTypeCode = '218065' OR tblCase.CaseTypeCode = '218070' OR tblCase.CaseTypeCode = '218071' OR tblCase.CaseTypeCode = '218080' OR tblCase.CaseTypeCode = '218090' OR tblCase.CaseTypeCode = '218091' OR tblCase.CaseTypeCode = '250005' OR tblCase.CaseTypeCode = '262601' OR tblCase.CaseTypeCode = '264001' OR tblCase.CaseTypeCode = '274002' OR tblCase.CaseTypeCode = '276501')
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18911
    
    8

You may suspect the server load. But there is a fairly small limit on the number of bytes you can send in a GET request, and your experiments tend to show that you are exceeding that limit.

Unfortunately the limit is not precisely specified, but it tends to be about 2000 bytes.
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Originally posted by Paul Clapham:
Unfortunately the limit is not precisely specified, but it tends to be about 2000 bytes.[/QB]


256 characters (approx.)
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

Passing so much information as url parameters is probably not a good solution.
You probably should think of another way to do it.


[My Blog]
All roads lead to JavaRanch
chaohua wang
Ranch Hand

Joined: Dec 22, 2002
Posts: 62
Thank you very much, ALL.
I have to use som many paramters depending on customers' request.
There is any way to fix this issue?

Chaohua
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18911
    
    8

The POST method has no limit on the number of bytes you can upload.
chaohua wang
Ranch Hand

Joined: Dec 22, 2002
Posts: 62
Paul,

I also tried to use post method. still does't work. I am confused. POST should work fine. Any idea? Thank you very much.

Chaohua
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18911
    
    8

You should start by finding out more precisely what "doesn't work" means. Then you would have some information you could work with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: unable to find line starting with "HTTP"