Re: java.lang.NoClassDefFoundError: org/apache/commons/codec/DecoderException

2004-09-30 Thread paul
gao, u need to put this jar into the classpath : commons-codec-1.2.jar
- Original Message - 
From: gao maosen [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, September 30, 2004 6:53 PM
Subject: java.lang.NoClassDefFoundError:
org/apache/commons/codec/DecoderException


 when i run the FormLoginDemo(login to
 developer.java.sun.com)
 it shows

 java.lang.NoClassDefFoundError:
 org/apache/commons/codec/DecoderException
 at

org.apache.commons.httpclient.HttpMethodBase.init(HttpMethodBase.java:216)
 at
 org.apache.commons.httpclient.methods.GetMethod.init(GetMethod.java:88)
 at FormLoginDemo.main(FormLoginDemo.java:33)
 Exception in thread main

 please tell me why ?thanks very much

 _
 Do You Yahoo!?
 

http://cn.rd.yahoo.com/mail_cn/tag/10m/*http://cn.mail.yahoo.com/event/10m.html

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



Re: [VOTE] 3.0 alpha 2 release

2004-09-16 Thread paul
+1
- Original Message - 
From: Mailing Lists [EMAIL PROTECTED]
To: 'Commons HttpClient Project'
[EMAIL PROTECTED]
Sent: Friday, September 17, 2004 12:47 PM
Subject: RE: [VOTE] 3.0 alpha 2 release


 +1

  -Original Message-
  From: Michael Becke [mailto:[EMAIL PROTECTED]
  Sent: Friday, September 17, 2004 7:42 AM
  To: Commons HttpClient Project
  Subject: [VOTE] 3.0 alpha 2 release
 
  It looks like we're ready for a 3.0 alpha 2 release.  Please vote as
  follows:
 
  --
  --
  --
Vote:  HttpClient 3.0 alpha 2 release
[ ] +1 I am in favor of the release, and will help support it.
[ ] +0 I am in favor of the release, but am unable to help
  support it.
[ ] -0 I am not in favor of the release.
[ ] -1 I am against this proposal (must include a reason).
 
  --
  --
  --
 
 
  -
  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]



Re: HttpClient problems

2004-05-28 Thread paul
Ortwin,
About 1, I have added the changes.
2, I need to add some id, pwd into the authentication logic, does 
httpclient api allow for setting this details?

3, Point noted, I will add that in.
Ortwin Glück wrote:
Some comments on the posted code:
1. You should execute releaseConnection in a finally block, to ensure 
the connection is returned to the pool in any case:

PostMethod post = null;
try {
  post = new PostMethod(urlAddress);
  /* ... */
} finally {
  if (post != null) post.releaseConnection();
}
Otherwise you the connection pool might run out of connections if 
exceptions occur.

2. You are setting the Authorization header manually. You could use 
HttpClient's built-in authentication logic instead.

3. You are setting the encoding in the Content-Type header to 
ISO-8859-1, but you do not specify any encoding in xmlStr.getBytes(). 
This assumes that the default platform encoding be ISO-8859-1, which 
is true for Windows in certain locales but not for most other 
platforms. Furthermore this assumes your ?xml ? Header uses 
encoding=ISO-8859-1, which I can not verify from the code. I suggest 
you get the XML Stream (not a String) from a DOM directly and specify 
the same encoding as in the Content-Type header.

paul wrote:
Ortwin,
   It seems from the wire logs I gathered, that's the normal behaviour.
   I am creating a new HttpMethod object for every send.
   Only when I receive the response, then releaseConnection was called.
   Here's the code :
=
//convert trade to xml
String xmlStr = convertTradeToXMLString(trade, some1id, someid);
PostMethod post = new PostMethod(urlAddress);
post.setRequestHeader(Content-type, text/xml; 
charset=ISO-8859-1);
post.setRequestHeader (Authorization, Basic  + encoding);
post.setRequestHeader(HTTP-Version, HTTP/1.1);
post.setRequestHeader (Connection, Keep-Alive);
   xmlInBytes =new ByteArrayInputStream(xmlStr.getBytes());
post.setRequestBody(xmlInBytes);
   if (xmlStr.length()  Integer.MAX_VALUE) {
   post.setRequestContentLength(xmlStr.length());
}
else {
   
post.setRequestContentLength(EntityEnclosingMethod.CONTENT_LENGTH_CHUNKED); 

}
   // Execute request
toConsole(B4 sending xml, 
connMgr.getConnectionsInUse()=+connMgr.getConnectionsInUse());
toConsole( Send xml to somewhere @ + new 
java.sql.Timestamp(System.currentTimeMillis()));
int result = httpClient.executeMethod(post);
   //System.out.println(Response body: );
MQClientConstants.toConsole( Reply from fxlink 
received @ + new java.sql.Timestamp(System.currentTimeMillis()));
String xml = post.getResponseBodyAsString();
post.releaseConnection();

=
Httpclient was created like this :
==
connMgr = new MultiThreadedHttpConnectionManager();
 connMgr.setMaxConnectionsPerHost( MAXHOSTCONNECTIONS );//20 
connections
 MQClientConstants.toConsole(MultiThreadedHttpConnectionManager 
setMaxConnectionsPerHost = +MAXHOSTCONNECTIONS);

 connMgr.setConnectionStaleCheckingEnabled( true );
 MQClientConstants.toConsole(MultiThreadedHttpConnectionManager 
setConnectionStaleCheckingEnabled = +true);
 httpClient = new HttpClient(connMgr);
 httpClient.setTimeout(TIMEOUT);//5 secs
 httpClient.setStrictMode(true);
==

Paul



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


HttpClient problems

2004-05-27 Thread paul
Dear all,
 Need help on using Httpclient 2.0. Currently, I have encountering a 
random problem with sending xml over to a remote site. Here's the debug 
log :

===
2004/05/26 20:09:50:290 SGT [DEBUG] EntityEnclosingMethod - -Request 
body sent
2004/05/26 20:09:50:562 SGT [DEBUG] HttpMethodBase - -Closing the 
connection.
2004/05/26 20:09:50:563 SGT [INFO] HttpMethodBase - -Recoverable 
exception caught when processing request
2004/05/26 20:09:50:563 SGT [WARN] HttpMethodBase - -Recoverable 
exception caught but MethodRetryHandler.retryMethod() returned false, 
rethrow
ing exception
2004/05/26 20:09:50:564 SGT [DEBUG] MultiThreadedHttpConnectionManager - 
-Freeing connection, hostConfig=HostConfiguration[host=somewhere.com, 
protocol=https:443, port=443]
2004/05/26 20:09:50:564 SGT [DEBUG] MultiThreadedHttpConnectionManager - 
-Notifying no-one, there are no waiting threads
org.apache.commons.httpclient.HttpRecoverableException: 
java.net.SocketException: Connection reset
 at 
org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1965) 

 at 
org.apache.commons.httpclient.HttpMethodBase.processRequest(HttpMethodBase.java:2659) 

 at 
org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1093) 

 at 
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:675)
 at 
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:529)
==

Does anybody know what causes the SocketException ? Is it becos I didn't 
set a higher maximum connection per host using setMaxConnectionsPerHost 
on the MultiThreadedHttpConnectionManager object ?

Pls help. This is urgent as I am currently using it on a production system.
Paul
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: HttpClient problems

2004-05-27 Thread paul
Here's the wire log :
==
2004/05/26 20:09:50:262 SGT [DEBUG] MultiThreadedHttpConnectionManager - 
-HttpConnectionManager.getConnection:  config = HostConfiguration[hos
t=somewhere.com, protocol=https:443, port=443], timeout = 0
2004/05/26 20:09:50:262 SGT [DEBUG] MultiThreadedHttpConnectionManager - 
-Getting free connection, 
hostConfig=HostConfiguration[host=somewhere.com, protocol=https:443, 
port=443]
2004/05/26 20:09:50:263 SGT [DEBUG] HttpConnection - 
-HttpConnection.setSoTimeout(0)
2004/05/26 20:09:50:270 SGT [DEBUG] HttpMethodBase - -Execute loop try 1
2004/05/26 20:09:50:280 SGT [DEBUG] wire - - POST 
/fxlweb/XMLGateway.asp HTTP/1.1[\r][\n]
2004/05/26 20:09:50:281 SGT [DEBUG] HttpMethodBase - -Adding Host 
request header
2004/05/26 20:09:50:282 SGT [DEBUG] wire - - Content-type: text/xml; 
charset=ISO-8859-1[\r][\n]
2004/05/26 20:09:50:283 SGT [DEBUG] wire - - Authorization: Basic 
someencrypteddata[\r][\n]
2004/05/26 20:09:50:283 SGT [DEBUG] wire - - HTTP-Version: 
HTTP/1.1[\r][\n]
2004/05/26 20:09:50:284 SGT [DEBUG] wire - - Connection: 
Keep-Alive[\r][\n]
2004/05/26 20:09:50:285 SGT [DEBUG] wire - - User-Agent: Jakarta 
Commons-HttpClient/2.0final[\r][\n]
2004/05/26 20:09:50:286 SGT [DEBUG] wire - - Host: somewhere.com[\r][\n]
2004/05/26 20:09:50:287 SGT [DEBUG] wire - - Cookie: $Version=0; 
ASPSESSIONIDAACRQATR=DKBJEFCAIKAHLGIMJKIBEGBH; $Path=/[\r][\n]
2004/05/26 20:09:50:287 SGT [DEBUG] wire - - Content-Length: 594[\r][\n]
2004/05/26 20:09:50:288 SGT [DEBUG] wire - - [\r][\n]
2004/05/26 20:09:50:289 SGT [DEBUG] EntityEnclosingMethod - -Using 
unbuffered request body
2004/05/26 20:09:50:290 SGT [DEBUG] wire - - ?xml version=1.0 
encoding=UTF-8?xmldata here
2004/05/26 20:09:50:290 SGT [DEBUG] EntityEnclosingMethod - -Request 
body sent
2004/05/26 20:09:50:562 SGT [DEBUG] HttpMethodBase - -Closing the 
connection.
2004/05/26 20:09:50:563 SGT [INFO] HttpMethodBase - -Recoverable 
exception caught when processing request
2004/05/26 20:09:50:563 SGT [WARN] HttpMethodBase - -Recoverable 
exception caught but MethodRetryHandler.retryMethod() returned false, 
rethrow
ing exception
2004/05/26 20:09:50:564 SGT [DEBUG] MultiThreadedHttpConnectionManager - 
-Freeing connection, hostConfig=HostConfiguration[host=somewhere.com, 
protocol=https:443, port=443]
2004/05/26 20:09:50:564 SGT [DEBUG] MultiThreadedHttpConnectionManager - 
-Notifying no-one, there are no waiting threads
org.apache.commons.httpclient.HttpRecoverableException: 
java.net.SocketException: Connection reset
   at 
org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1965)
   at 
org.apache.commons.httpclient.HttpMethodBase.processRequest(HttpMethodBase.java:2659)
   at 
org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1093)
   at 
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:675)
   at 
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:529)
  

=
Thanks a lot for the info.
Ortwin Glück wrote:

paul wrote:
2004/05/26 20:09:50:564 SGT [DEBUG] 
MultiThreadedHttpConnectionManager - -Notifying no-one, there are no 
waiting threads
org.apache.commons.httpclient.HttpRecoverableException: 
java.net.SocketException: Connection reset
 at 
org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1965) 

 at 
org.apache.commons.httpclient.HttpMethodBase.processRequest(HttpMethodBase.java:2659) 


Does anybody know what causes the SocketException ? 

Not yet, but we're gonna find out for you :-)
Please produce a wirelog and send the section with the request / 
response immediately preceding the exception.
For instructions about how to make a wirelog please see our Logging 
Guide:
http://jakarta.apache.org/commons/httpclient/logging.html

Please note that wire logging will slow down your application 
considerably! This is escpecially bad, because the problem you are 
experiencing seems to happen randomly. Please make sure you disable 
logging after you have successfully captured the output.


Is it becos I didn't
set a higher maximum connection per host using 
setMaxConnectionsPerHost on the MultiThreadedHttpConnectionManager 
object ?

Probably not - just doesn't look like it.
Pls help. This is urgent as I am currently using it on a production 
system.

You are welcome. Maybe we should start offering commercial support and 
make A LOT of money :-)


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


Re: HttpClient problems

2004-05-27 Thread Paul Wee Tian Jou
Yes, I have set checking enabled to true. 

As for the IIS , I will need to check the logs. 

Is it possible to catch the HttpRecoverableException , and retry the Post 
method again?
-Original Message-
From: Michael Becke [EMAIL PROTECTED]
To: Commons HttpClient Project commons-httpclient-
[EMAIL PROTECTED]
Date: Thu, 27 May 2004 08:50:18 -0400
Subject: Re: HttpClient problems

 Hi Paul,
 
 Two quick questions.
 
   - Have you set  
 MultiThreadedHttpConnectionManager.setConnectionStaleCheckingEnabled() 
 to false?  If so this could be causing the problem.
 
   - It seems that the server is closing the request in mid stream. 
 Have  
 you checked the IIS logs?  There might be something there.
 
 Mike
 
 On May 27, 2004, at 8:25 AM, paul wrote:
 
  Here's the wire log :
  ==
  2004/05/26 20:09:50:262 SGT [DEBUG]
 MultiThreadedHttpConnectionManager  
  - -HttpConnectionManager.getConnection:  config =  
  HostConfiguration[hos
  t=somewhere.com, protocol=https:443, port=443], timeout = 0
  2004/05/26 20:09:50:262 SGT [DEBUG]
 MultiThreadedHttpConnectionManager  
  - -Getting free connection,  
  hostConfig=HostConfiguration[host=somewhere.com, protocol=https:443, 
  port=443]
  2004/05/26 20:09:50:263 SGT [DEBUG] HttpConnection -  
  -HttpConnection.setSoTimeout(0)
  2004/05/26 20:09:50:270 SGT [DEBUG] HttpMethodBase - -Execute loop
 try  
  1
  2004/05/26 20:09:50:280 SGT [DEBUG] wire - - POST  
  /fxlweb/XMLGateway.asp HTTP/1.1[\r][\n]
  2004/05/26 20:09:50:281 SGT [DEBUG] HttpMethodBase - -Adding Host  
  request header
  2004/05/26 20:09:50:282 SGT [DEBUG] wire - - Content-type:  
  text/xml; charset=ISO-8859-1[\r][\n]
  2004/05/26 20:09:50:283 SGT [DEBUG] wire - - Authorization: Basic 
  someencrypteddata[\r][\n]
  2004/05/26 20:09:50:283 SGT [DEBUG] wire - - HTTP-Version:  
  HTTP/1.1[\r][\n]
  2004/05/26 20:09:50:284 SGT [DEBUG] wire - - Connection:  
  Keep-Alive[\r][\n]
  2004/05/26 20:09:50:285 SGT [DEBUG] wire - - User-Agent: Jakarta  
  Commons-HttpClient/2.0final[\r][\n]
  2004/05/26 20:09:50:286 SGT [DEBUG] wire - - Host:  
  somewhere.com[\r][\n]
  2004/05/26 20:09:50:287 SGT [DEBUG] wire - - Cookie: $Version=0;  
  ASPSESSIONIDAACRQATR=DKBJEFCAIKAHLGIMJKIBEGBH; $Path=/[\r][\n]
  2004/05/26 20:09:50:287 SGT [DEBUG] wire - - Content-Length:  
  594[\r][\n]
  2004/05/26 20:09:50:288 SGT [DEBUG] wire - - [\r][\n]
  2004/05/26 20:09:50:289 SGT [DEBUG] EntityEnclosingMethod - -Using  
  unbuffered request body
  2004/05/26 20:09:50:290 SGT [DEBUG] wire - - ?xml version=1.0  
  encoding=UTF-8?xmldata here
  2004/05/26 20:09:50:290 SGT [DEBUG] EntityEnclosingMethod - -Request 
  body sent
  2004/05/26 20:09:50:562 SGT [DEBUG] HttpMethodBase - -Closing the  
  connection.
  2004/05/26 20:09:50:563 SGT [INFO] HttpMethodBase - -Recoverable  
  exception caught when processing request
  2004/05/26 20:09:50:563 SGT [WARN] HttpMethodBase - -Recoverable  
  exception caught but MethodRetryHandler.retryMethod() returned false,
  
  rethrow
  ing exception
  2004/05/26 20:09:50:564 SGT [DEBUG]
 MultiThreadedHttpConnectionManager  
  - -Freeing connection,  
  hostConfig=HostConfiguration[host=somewhere.com, protocol=https:443, 
  port=443]
  2004/05/26 20:09:50:564 SGT [DEBUG]
 MultiThreadedHttpConnectionManager  
  - -Notifying no-one, there are no waiting threads
  org.apache.commons.httpclient.HttpRecoverableException:  
  java.net.SocketException: Connection reset
 at  
 
 org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBas
  e.java:1965)
 at  
 
 org.apache.commons.httpclient.HttpMethodBase.processRequest(HttpMethodB
  ase.java:2659)
 at  
 
 org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.jav
  a:1093)
 at  
 
 org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:
  675)
 at  
 
 org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:
  529)
 
  =
  Thanks a lot for the info.
 
  Ortwin Glück wrote:
 
 
 
  paul wrote:
 
  2004/05/26 20:09:50:564 SGT [DEBUG]  
  MultiThreadedHttpConnectionManager - -Notifying no-one, there are
 no  
  waiting threads
  org.apache.commons.httpclient.HttpRecoverableException:  
  java.net.SocketException: Connection reset
   at  
 
 org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodB 
  ase.java:1965)
   at  
 
 org.apache.commons.httpclient.HttpMethodBase.processRequest(HttpMetho 
  dBase.java:2659)
 
 
 
 
  Does anybody know what causes the SocketException ?
 
 
  Not yet, but we're gonna find out for you :-)
 
  Please produce a wirelog and send the section with the request /  
  response immediately preceding the exception.
  For instructions about how to make a wirelog please see our Logging 
  Guide:
  http://jakarta.apache.org/commons/httpclient/logging.html
 
  Please note that wire logging

RE: HttpClient problems

2004-05-27 Thread Paul Wee Tian Jou
Thanks a lot, I will go and check with the server admin guys.

Its not a authentication issue as this problem happens randomly. 
-Original Message-
From: Kalnichevski, Oleg [EMAIL PROTECTED]
To: Commons HttpClient Project commons-httpclient-
[EMAIL PROTECTED]
Date: Thu, 27 May 2004 13:47:13 +0100
Subject: RE: HttpClient problems

 Paul,
 
 The problem is obviously caused by the server's dropping connection
 right after HttpClient is done sending the request. If you have access
 to the target server, check the server logs to find out what prompted
 the server to do so.
 
 I can think of two possibilities:
 
 (1) The server did not accept the request due to an authentication
 error (wrong credentials and stuff), immediately sent back
 'unauthorized' response and dropped the connection while HttpClient was
 still busy sending the request body. 
 
 If unsuccessful authentication is indeed the cause of the problem you
 can solve it by activating the '100-continue' handshake. See
 EntityEnclosingMethod javadocs for details
 
 (2) The server dropped the connection due to a very high load or any
 other reason preventing it from successfully processing the request.
 Server log file is your best friend in this case
 
 Hope this helps
 
 Oleg
 
 -Original Message-
 From: paul [mailto:[EMAIL PROTECTED]
 Sent: Thu 5/27/2004 14:25
 To:   Commons HttpClient Project
 Cc:   
 Subject:  Re: HttpClient problems
 Here's the wire log :
 ==
 2004/05/26 20:09:50:262 SGT [DEBUG] MultiThreadedHttpConnectionManager
 - 
 -HttpConnectionManager.getConnection:  config = HostConfiguration[hos
 t=somewhere.com, protocol=https:443, port=443], timeout = 0
 2004/05/26 20:09:50:262 SGT [DEBUG] MultiThreadedHttpConnectionManager
 - 
 -Getting free connection, 
 hostConfig=HostConfiguration[host=somewhere.com, protocol=https:443, 
 port=443]
 2004/05/26 20:09:50:263 SGT [DEBUG] HttpConnection - 
 -HttpConnection.setSoTimeout(0)
 2004/05/26 20:09:50:270 SGT [DEBUG] HttpMethodBase - -Execute loop try
 1
 2004/05/26 20:09:50:280 SGT [DEBUG] wire - - POST 
 /fxlweb/XMLGateway.asp HTTP/1.1[\r][\n]
 2004/05/26 20:09:50:281 SGT [DEBUG] HttpMethodBase - -Adding Host 
 request header
 2004/05/26 20:09:50:282 SGT [DEBUG] wire - - Content-type: text/xml;
 charset=ISO-8859-1[\r][\n]
 2004/05/26 20:09:50:283 SGT [DEBUG] wire - - Authorization: Basic 
 someencrypteddata[\r][\n]
 2004/05/26 20:09:50:283 SGT [DEBUG] wire - - HTTP-Version: 
 HTTP/1.1[\r][\n]
 2004/05/26 20:09:50:284 SGT [DEBUG] wire - - Connection: 
 Keep-Alive[\r][\n]
 2004/05/26 20:09:50:285 SGT [DEBUG] wire - - User-Agent: Jakarta 
 Commons-HttpClient/2.0final[\r][\n]
 2004/05/26 20:09:50:286 SGT [DEBUG] wire - - Host:
 somewhere.com[\r][\n]
 2004/05/26 20:09:50:287 SGT [DEBUG] wire - - Cookie: $Version=0; 
 ASPSESSIONIDAACRQATR=DKBJEFCAIKAHLGIMJKIBEGBH; $Path=/[\r][\n]
 2004/05/26 20:09:50:287 SGT [DEBUG] wire - - Content-Length:
 594[\r][\n]
 2004/05/26 20:09:50:288 SGT [DEBUG] wire - - [\r][\n]
 2004/05/26 20:09:50:289 SGT [DEBUG] EntityEnclosingMethod - -Using 
 unbuffered request body
 2004/05/26 20:09:50:290 SGT [DEBUG] wire - - ?xml version=1.0 
 encoding=UTF-8?xmldata here
 2004/05/26 20:09:50:290 SGT [DEBUG] EntityEnclosingMethod - -Request 
 body sent
 2004/05/26 20:09:50:562 SGT [DEBUG] HttpMethodBase - -Closing the 
 connection.
 2004/05/26 20:09:50:563 SGT [INFO] HttpMethodBase - -Recoverable 
 exception caught when processing request
 2004/05/26 20:09:50:563 SGT [WARN] HttpMethodBase - -Recoverable 
 exception caught but MethodRetryHandler.retryMethod() returned false, 
 rethrow
 ing exception
 2004/05/26 20:09:50:564 SGT [DEBUG] MultiThreadedHttpConnectionManager
 - 
 -Freeing connection, hostConfig=HostConfiguration[host=somewhere.com, 
 protocol=https:443, port=443]
 2004/05/26 20:09:50:564 SGT [DEBUG] MultiThreadedHttpConnectionManager
 - 
 -Notifying no-one, there are no waiting threads
 org.apache.commons.httpclient.HttpRecoverableException: 
 java.net.SocketException: Connection reset
 at 
 org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBas
 e.java:1965)
 at 
 org.apache.commons.httpclient.HttpMethodBase.processRequest(HttpMethodB
 ase.java:2659)
 at 
 org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.jav
 a:1093)
 at 
 org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:
 675)
 at 
 org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:
 529)

 
 =
 Thanks a lot for the info.
 
 Ortwin Glück wrote:
 
 
 
  paul wrote:
 
  2004/05/26 20:09:50:564 SGT [DEBUG] 
  MultiThreadedHttpConnectionManager - -Notifying no-one, there are no
  waiting threads
  org.apache.commons.httpclient.HttpRecoverableException: 
  java.net.SocketException: Connection reset

Re: Logging issue

2004-04-07 Thread paul
Ortwin,
  
   We are running jdk 1.4 on both machines. Yes, I will try your System 
properties method and see the results. Thanks.

Paul

Ortwin Glück wrote:

paul wrote:

Michael,

   Both classpaths are the same and both don't have log4j. The jars 
are commons-httpclient-2.0.jar  commons-logging.jar . But when 
compiling, it have log4j before commons-logging.jar, does it matter?

Paul


Are you running the same JDK version on both machines? Commons-logging 
will use JDK 1.4 logging automatically if available. You can also try 
and pass the System properties on the java command line (-D option).

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


Logging issue

2004-04-06 Thread paul
Dear all,

   I am encountering some peculiar behaviour with printing out the wire 
logs. Here's what I did in my application :

=
System.setProperty(org.apache.commons.logging.Log, 
org.apache.commons.logging.impl.SimpleLog);
System.setProperty(org.apache.commons.logging.simplelog.showdatetime, 
true);
System.setProperty(org.apache.commons.logging.simplelog.log.httpclient.wire, 
debug);
System.setProperty(org.apache.commons.logging.simplelog.log.org.apache.commons.httpclient, 
debug);

MultiThreadedHttpConnectionManager connMgr = new 
MultiThreadedHttpConnectionManager();
httpClient = new HttpClient(connMgr);
httpClient.setStrictMode(true);
===

I deployed it on one machine, and the wire logs are printed out. But on 
another machine, I deployed the same application and the logs weren't 
printed out. Can anybody help?

Paul

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


Re: Logging issue

2004-04-06 Thread paul
Michael,

   Both classpaths are the same and both don't have log4j. The jars are 
commons-httpclient-2.0.jar  commons-logging.jar . But when compiling, 
it have log4j before commons-logging.jar, does it matter?

Paul

Michael Becke wrote:

Hi Paul,

Most likely this other machine has log4j on the classpath. If present  
it will be used.  In this case you will have to enable the  
httpclient.wire log with log4j.

Mike

On Apr 6, 2004, at 9:58 PM, paul wrote:

Dear all,

   I am encountering some peculiar behaviour with printing out the  
wire logs. Here's what I did in my application :

=
System.setProperty(org.apache.commons.logging.Log,  
org.apache.commons.logging.impl.SimpleLog);
System.setProperty(org.apache.commons.logging.simplelog.showdatetime, 
 true);
System.setProperty(org.apache.commons.logging.simplelog.log.httpclient 
.wire, debug);
System.setProperty(org.apache.commons.logging.simplelog.log.org.apache 
.commons.httpclient, debug);

MultiThreadedHttpConnectionManager connMgr = new  
MultiThreadedHttpConnectionManager();
httpClient = new HttpClient(connMgr);
httpClient.setStrictMode(true);
===

I deployed it on one machine, and the wire logs are printed out. But  
on another machine, I deployed the same application and the logs  
weren't printed out. Can anybody help?

Paul

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


Encountering problems with httpclient

2004-03-30 Thread paul
Dear all,

   Need some help here. I am sending many xml to a IIS webserver using 
the same Httpclient object  same PostMethod object to sent. Wheneven I 
sent xmls within intervals of less than 2 secs,
the following exceptions occurred :
=
Mar 31, 2004 10:19:36 AM org.apache.commons.httpclient.HttpMethodBase 
readResponse
INFO: Discarding unexpected response: HTTP/1.1 100 Continue
Mar 31, 2004 10:19:36 AM org.apache.commons.httpclient.HttpMethodBase 
processRequest
INFO: Recoverable exception caught when processing request
Mar 31, 2004 10:19:36 AM org.apache.commons.httpclient.HttpMethodBase 
processRequest
WARNING: Recoverable exception caught but 
MethodRetryHandler.retryMethod() returned false, rethrowing exception
org.apache.commons.httpclient.HttpRecoverableException: 
java.net.SocketTimeoutException: Read timed out
   at 
org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1965)
   at 
org.apache.commons.httpclient.HttpMethodBase.processRequest(HttpMethodBase.java:2659)
   at 
org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1093)
   at 
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:675)
   at 
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:529)
=

Pls help. Thanks

Paul

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


Re: Post Method

2003-06-10 Thread Paul Philion
In theory I agree, but I see a lot of uses of the O'Reilly multipart stuff,
which expects multipart/form-data (see:
http://www.servlets.com/cos/javadoc/com/oreilly/servlet/multipart/MultipartParser.html)

I had a specific problem with the and x-www-form-urlencoded last week, which
is why I'm using PostMethod instead of the multipart version.

What I would really like to see is the ability to set an encoding for a POST
method, and have the data be correctly encoded when the method is executed.
At very least, it would be nice to be able to set the encoding and enforce
the encoding myself when adding the name/values.


Paul Philion
[EMAIL PROTECTED]

- Original Message - 
From: Michael Becke [EMAIL PROTECTED]
To: Commons HttpClient Project [EMAIL PROTECTED]
Sent: Tuesday, June 10, 2003 10:29 PM
Subject: Re: Post Method


 There seems to be quite a bit of discussion regarding this question but
 not too much that seems ultimately definitive.  This one seems to be
 the best:

 http://groups.google.com/groups?oi=djqselm=an_537840002

 Essentially the author says that form encoding and URI encoding are two
 unrelated things.  When posting via a form the data should be encoded
 as per (http://www.w3.org/MarkUp/html-spec/html-spec_8.html#SEC8.2.1).
 When building a URI rfc2396 should be used.

 If this is correct, which I think it is, PostMethod is incorrectly
 encoding values.  It also seems that query parameters are being
 incorrectly encoded as they should be using x-www-form-urlencoded. My
 guess is that most web servers will accept data encoded either way as
 there is some general confusion regarding this.  My feeling is that
 PostMethod and HttpMethodBase should be changed to conform to the
 x-www-form-urlencoded standard.  What does everyone think?

 Mike

 On Tuesday, June 10, 2003, at 01:13 PM, Mike Moran wrote:

  Michael Becke wrote:
  I think there may be a bug here as well.  According to the spec,
  space characters should be represented as '+' but URIUtil is encoding
  them as '%20'.  I think the resevered character set is perhaps also
  incorrect. According to rfc 1738 ;, /, ?, :, @, = and 
  are the reserved chars but URI is also uncluding +, $ and ,.
  My guess is that most servers translate all hex encoded characters
  but it seems that we are not quite to spec.
 
  You may want to double-check this with rfc2396, which updates rfc1738.
  My interpretation of the '+'/'%20' issue was that both were legal
  escapings of space, however it may be worth another reading on my 
part.
 
  -- 
  Mike Moran
 
 
  -
  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]