Hi Arturo,

It seems like you are ending up with partially closed connection. This could be caused by a number of things:

1) the large wait between method executions
2) an older version of JSSE. JSSE in pre 1.4 JVMs has been known to be pretty flaky.
3) the server or proxy server is under high load and simply drops the connection.


I would suggest trying one or both of the following:

1) Disable connection reuse by setting the "connection: close" header and/or using HTTP 1.0:

Method.setRequestHeader("Connection", "close");
  or
Method.setHttp11(false);

2) Catching the recoverable exception and executing the method again.

Mike

On Jul 23, 2004, at 8:04 AM, Michael Becke wrote:

Please find the message below.

Mike

Begin forwarded message:

 -----Mensaje original-----
De:     Esquivel Sanchez, Arturo 
Enviado el:     Miércoles, 21 de Julio de 2004 06:14 p.m.
Para:   '[EMAIL PROTECTED]'
Asunto: Please Help !




thanks Mike,

I´M USIGN A PROXY, WEBLOGIC SERVER 6.1, RUNNING THE PROCESS FROM UNIX AND THIS IS AN EXAMPLE OF MY CODE:
(NOTE: this code runs every 1 minute from a threed.sleep)




url="http://www.whatever.com";;

HttpClient client = new HttpClient();
client.getState().setProxyCredentials(null, null, new UsernamePasswordCredentials(System.getProperty("http.proxyUserName"), System.getProperty("http.proxyPassword")));


client.getHostConfiguration().setProxy(System.getProperty("http.proxyH ost"),Integer.parseInt(System.getProperty("http.proxyPort","80")));

GetMethod method1 = new GetMethod(url);
try{
        statusCode = client.executeMethod(method1);
        System.out.println("Return Code=> " + statusCode);
}catch (HttpRecoverableException e) {
        System.out.println("An recoverable exception occurred,retrying. " + e.getMessage());
         e.printStackTrace();
}finally{
        System.out.println("Releasing Connection method 1....." );
        method1.releaseConnection();
 }




THIS IS WHAT THE LOGGING IS DISPLAYING:
(NOTE: i don´t always get this error, most of the time the code works fine, but when i get the error and since is a runnable process, i need to stop the process by killing its id process, stop the weblogic server, wait like 30 minutes, and then try again)






004/07/21 10:10:51:415 CDT [DEBUG] HttpClient - -Java version: 1.3.1.10
2004/07/21 10:10:51:416 CDT [DEBUG] HttpClient - -Java vendor: Hewlett-Packard C
o.
2004/07/21 10:10:51:417 CDT [DEBUG] HttpClient - -Java class path: /opt/bea/webl
ogic/v61:/opt/bea/weblogic/v61/lib/weblogic_sp.jar:/opt/bea/weblogic/ v61/lib/web
logic.jar:/opt/bea:/opt/bea/weblogic/v61/lib/drivers/jconnect5_5/ jconn2.jar:/opt
/bea/weblogic/v61/lib/db2drivers/db2java.zip:/opt/bea/weblogic/v61/ lib/db2driver
s/runtime.zip:/opt/bea/weblogic/v61/config/wldominfra01/fml/classes:/ opt/bea/web
logic/v61/config/wldominfra01/utilerias/C617_infra.jar:/opt/bea/ weblogic/v61/con
fig/wldominfra01/utilerias/jregex1.2_01.jar:/opt/bea/weblogic/v61/ config/wldomin
fra01/utilerias/CAME.jar:/opt/bea/weblogic/v61/lib/encripcion/ US_export_policy.j
ar:/opt/bea/weblogic/v61/lib/encripcion/local_policy.jar:/opt/bea/ weblogic/v61/l
ib/encripcion/jce1_2_2.jar:/opt/bea/weblogic/v61/lib/encripcion/ sunjce_provider.
jar:/opt/bea/weblogic/v61/lib/tse/activation.jar:/opt/bea/weblogic/ v61/lib/tse/c
astor-0.9.3.9-xml.jar:/opt/bea/weblogic/v61/lib/tse/commons- logging.jar:/opt/bea
/weblogic/v61/lib/tse/dom.jar:/opt/bea/weblogic/v61/lib/tse/ dom4j.jar:/opt/bea/w
eblogic/v61/lib/tse/fscontext.jar:/opt/bea/weblogic/v61/lib/tse/ jaas.jar:/opt/be
a/weblogic/v61/lib/tse/jaxm-api.jar:/opt/bea/weblogic/v61/lib/tse/ jaxm-runtime.j
ar:/opt/bea/weblogic/v61/lib/tse/jaxp-api.jar:/opt/bea/weblogic/v61/ lib/tse/jaxr
-api.jar:/opt/bea/weblogic/v61/lib/tse/jaxr-apidoc.jar:/opt/bea/ weblogic/v61/lib
/tse/jaxr-ri.jar:/opt/bea/weblogic/v61/lib/tse/jaxrpc-api.jar:/opt/ bea/weblogic/
v61/lib/tse/jaxrpc-ri.jar:/opt/bea/weblogic/v61/lib/tse/jcert.jar:/ opt/bea/weblo
gic/v61/lib/tse/jnet.jar:/opt/bea/weblogic/v61/lib/tse/jsse.jar:/opt/ bea/weblogi
c/v61/lib/tse/mail.jar:/opt/bea/weblogic/v61/lib/tse/ providerutil.jar:/opt/bea/w
eblogic/v61/lib/tse/regexp.jar:/opt/bea/weblogic/v61/lib/tse/saaj- api.jar:/opt/b
ea/weblogic/v61/lib/tse/saaj-ri.jar:/opt/bea/weblogic/v61/lib/tse/ sax.jar:/opt/b
ea/weblogic/v61/lib/tse/soap.jar:/opt/bea/weblogic/v61/lib/tse/ xalan.jar:/opt/be
a/weblogic/v61/lib/tse/xercesImpl.jar:/opt/bea/weblogic/v61/lib/tse/ xsltc.jar:/o
pt/bea/weblogic/v61/lib/tse/TSE.jar:/opt/bea/weblogic/v61/config/ wldominfra01/se
rverclasses/CORREODEV.jar:/opt/bea/weblogic/v61/config/wldominfra01/ serverclasse
s/C995_055_srv.jar
2004/07/21 10:10:51:428 CDT [DEBUG] HttpClient - -Operating system name: HP-UX
2004/07/21 10:10:51:430 CDT [DEBUG] HttpClient - -Operating system architecture:
 PA_RISC2.0
2004/07/21 10:10:51:431 CDT [DEBUG] HttpClient - -Operating system version: B.11
.00
2004/07/21 10:10:51:432 CDT [DEBUG] HttpClient - -SUN 1.2: SUN (DSA key/paramete
r generation; DSA signing; SHA-1, MD5 digests; SecureRandom; X.509 certificates;
 JKS keystore)
2004/07/21 10:10:51:432 CDT [DEBUG] HttpClient - -SunRsaSign 1.0: SUN's provider
 for RSA signatures
2004/07/21 10:10:51:433 CDT [DEBUG] HttpClient - -SunJCE 1.22: SunJCE Provider (
implements DES, Triple DES, Blowfish, PBE, Diffie-Hellman, HMAC-MD5, HMAC-SHA1)
2004/07/21 10:10:51:433 CDT [DEBUG] HttpClient - -SunJSSE 1.0302: Sun JSSE provi
der(implements RSA Signatures, PKCS12, SunX509 key/trust factories, SSLv3, TLSv1
)
2004/07/21 10:10:51:711 CDT [DEBUG] HttpConnection - -HttpConnection.setSoTimeou
t(0)
2004/07/21 10:10:51:751 CDT [DEBUG] HttpMethodBase - -Execute loop try 1
2004/07/21 10:10:51:768 CDT [DEBUG] HttpMethodBase - -Adding Host request header
2004/07/21 10:10:52:242 CDT [DEBUG] HttpMethodBase - -Authorization required
2004/07/21 10:10:52:271 CDT [DEBUG] HttpAuthenticator - -Authenticating with the
 'Enter Username and Password ' authentication realm at 10.97.106.2
2004/07/21 10:10:52:278 CDT [DEBUG] HttpMethodBase - -HttpMethodBase.execute():
Server demanded authentication credentials, will try again.
2004/07/21 10:10:52:282 CDT [DEBUG] HttpMethodBase - -Resorting to protocol vers
ion default close connection policy
2004/07/21 10:10:52:282 CDT [DEBUG] HttpMethodBase - -Should NOT close connectio
n, using HTTP/1.1.
2004/07/21 10:10:52:282 CDT [DEBUG] HttpMethodBase - -Execute loop try 2
2004/07/21 10:10:52:283 CDT [DEBUG] HttpMethodBase - -Request to add Host header
 ignored: header already added
2004/07/21 10:10:52:285 CDT [DEBUG] HttpMethodBase - -Closing the connection.
2004/07/21 10:10:52:286 CDT [INFO] HttpMethodBase - -Recoverable exception caugh
t when processing request
2004/07/21 10:10:52:292 CDT [WARN] HttpMethodBase - -Recoverable exception caugh
t but MethodRetryHandler.retryMethod() returned false, rethrowing exception
An recoverable exception occurred,retrying.  org.apache.commons.httpclient.HttpR
ecoverableException: Error in parsing the status  line from the response: unable
 to find line starting with "HTTP"
org.apache.commons.httpclient.HttpRecoverableException: org.apache.commons.httpc
lient.HttpRecoverableException: Error in parsing the status  line from the respo
nse: unable to find line starting with "HTTP"
        at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodB
ase.java:1965)
        at org.apache.commons.httpclient.HttpMethodBase.processRequest(HttpMetho
dBase.java:2659)
        at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.j
ava:1093)
        at org.apache.commons.httpclient.ConnectMethod.execute(ConnectMethod.jav
a:201)
        at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.jav
a:675)
        at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.jav
a:529)
        at Banamex.C734_000.AeromexicoValida.Proc_Saldo(AeromexicoValida.java:35
7)
        at Banamex.C734_000.AeromexicoValida.ValidaServicio(AeromexicoValida.jav
a:134)
        at Banamex.C734_000.AeromexicoValida.run(AeromexicoValida.java:68)
        at java.lang.Thread.run(Unknown Source)
Releasing Connection method 1.....






hope this help to understand the problem

thanks again

Best Regards

Arturo




Content-Type: text/plain; charset=ISO-8859-1; format=flowed From: Michael Becke <[EMAIL PROTECTED]> Subject: Please Help ! Date: Mon, 19 Jul 2004 21:45:25 -0400

Hello Arturo,

This problem could be caused by a number of things.  Please post a wire
log <http://jakarta.apache.org/commons/httpclient/logging.html> and
some sample code and we should be able to get to the bottom of the
problem.


Mike

On Jul 19, 2004, at 2:31 PM, Esquivel Sanchez, Arturo wrote:

>
> Hi,
>
> I'm getting the error: Error in parsing the status line from the
> response:
> unable to find line starting with "HTTP".
> and i´m pretty sure that its related to the consideration documented by
> Daniel C. Amadei :
>
> JSSE prior to Java 1.4 incorrectly reports socket timeout.
> Prior to Java 1.4, in Sun's JSSE implementation, a read operation that
> has
> timed out incorrect reports end of stream condition instead of throwing
> java.io.InterruptedIOException as expected. HttpClient responds to this
> exception by assuming that the connection was dropped and throws a
> recoverable HTTP exception: Error in parsing the status line from the
> response: unable to find line starting with "HTTP". It should instead
> report
> "java.io.InterruptedIOException: Read timed out". If you see the
> "unable to
> find line..." message when working with an older version of JDK and
> JSSE, it
> can be caused by the timeout waiting for data and not by a problem
> with the
> connection.
> Work-around: One possible solution is to increase the timeout value as
> the
> server is taking too long to start sending the response. Alternatively
> you
> may choose to upgrade to Java 1.4 or above which does not exhibit this
> problem
>
> Unfortunely in my company´s tech unit is not going to be easy neither
> quick
> to upgrade to the Java version 1.4.
> And I already tried to increase the client setTimeOut method and didn´t
> work....
>
> So is there a way you can help to modified the necesary components in
> order
> to fix the problem from the HttpClient side.
> Or give me some hints on how to fix it and generate a new
> commons-httpclient-2.0.jar that includes the fix.
> Or if there is already a version of the HttpClient v2.0 that fix this
> problem
>
> The version that i´m using is the 2.0.
>
> I really really appreciate your help
>
> Best Regards
> Arturo
>




---------------------------------------------------------------------
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]




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



Reply via email to