You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Foran, Christopher" <Ch...@fmr.com> on 2004/06/03 18:38:51 UTC

Suppressing stack dump in executeMethod()

I most likely should know how to find the answer to this question,
but...

I am doing SSL and when I use an incorrect password for the keystore it
looks like somewhere in HttpClient.executeMethod() the stack dump is
being printed..  In my application I am catching everything I should be,
and I don't want to user to see this information.  Is there a way for me
to tell HttpClient to suppress this output. I want to handle this
exception in my application. Thanks.

java.lang.RuntimeException: KeyManagerFactoryImpl: Keystore was tampered
with, or password was incorrect
        at com.ibm.jsse.w.a(Unknown Source)
        at com.ibm.jsse.w.engineInit(Unknown Source)
        at javax.net.ssl.KeyManagerFactory.init(Unknown Source)
        at javax.net.ssl.SSLSocketFactory.getDefault(Unknown Source)
        at
org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSo
cket(SSLProtocolSocketFactory.java:112)
        at
org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:66
3)
        at
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpCon
nectionAdapter.open(MultiThreadedHttpConnectionManager.java:959)
        at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:6
61)
        at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:5
29)
        at xxx.xxxxxxxx.xxxxxx.xxxxxx.run(Unknown Source)

christopher.foran@fmr.com | 617.563.4785



Re: Suppressing stack dump in executeMethod()

Posted by Oleg Kalnichevski <ol...@apache.org>.
Christopher,

What makes you think that HttpClient dumps the stack? What I read from
the stacks tells me that is was not HttpClient#executeMethod

org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:529)
>         at xxx.xxxxxxxx.xxxxxx.xxxxxx.run(Unknown Source)
> 

Then, HttpClient NEVER dumps exception stack using
Throwable#printStackTrace(). NEVER EVER. HttpClient always uses
commons-logging to log its events. 

In order to disable all output generated by HttpClient you may want to
set HttpClient's logging verbosity to FATAL or disable logging output
altogether by using NoLog as a logger implementation. 

Feel free to examine HttpClient's source code to double-check

Oleg

On Thu, 2004-06-03 at 18:38, Foran, Christopher wrote:
> I most likely should know how to find the answer to this question,
> but…
> 
> I am doing SSL and when I use an incorrect password for the keystore
> it looks like somewhere in HttpClient.executeMethod() the stack dump
> is being printed..  In my application I am catching everything I
> should be, and I don't want to user to see this information.  Is there
> a way for me to tell HttpClient to suppress this output. I want to
> handle this exception in my application. Thanks.
> 
> java.lang.RuntimeException: KeyManagerFactoryImpl: Keystore was
> tampered with, or password was incorrect
>         at com.ibm.jsse.w.a(Unknown Source)
>         at com.ibm.jsse.w.engineInit(Unknown Source)
>         at javax.net.ssl.KeyManagerFactory.init(Unknown Source)
>         at javax.net.ssl.SSLSocketFactory.getDefault(Unknown Source)
>         at
> org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSocket(SSLProtocolSocketFactory.java:112)
> 
>         at
> org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:663)
>         at
> org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:959)
> 
>         at
> org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:661)
>         at
> org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:529)
>         at xxx.xxxxxxxx.xxxxxx.xxxxxx.run(Unknown Source)
> 
> christopher.foran@fmr.com | 617.563.4785
> 
> 
> 
> 
> ______________________________________________________________________
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org