hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roland Weber <ossf...@dubioso.net>
Subject Re: PostMethod problem - Can't understanding what is happening?
Date Thu, 28 Jun 2007 14:33:45 GMT
Hello Vikas,

> code is here -->
> String url = "http://localhost:8080/solr/update";
// (1)
> HttpClient client = new HttpClient();
// (2)
> PostMethod post = new PostMethod(url);
// (3)

> It is not creating object of PostMethod class,
> it is NOT throwing any error message also,

Are you sure about that? Do you check for exceptions,
or also for errors? Use catch (Throwable t) rather
than catch (Exception x).

> but when I debug with Eclipse 3.2.2,
> it is loosing it's control

??? What do you mean by that?

I suggest you put debug print statements at the
positions marked // (?) above. A simple System.out
statement should do.

If you don't get output from (1), your application
is misbehaving.
If you get output from (1) but not from (2), check
the classpath for dependencies. Is commons-logging
in the classpath? Is a specific logging implementation
in the classpath and correctly configured? Is the
correct version of httpclient in the classpath, and
only once? Use a try/catch statement to get errors
related to class loading. If the thread blocks
somewhere when creating the HttpClient object,
generate a thread dump (javacore) and see where
exactly the thread locks up.
If you get output from (2) but not from (3), check
the classpath for dependencies. Is commons-codec
in the classpath? Use a try/catch statement to get
errors related to class loading. If the thread blocks
somewhere when creating the PostMethod object,
generate a thread dump (javacore) and see where
exactly the thread locks up.

hope that helps,
  Roland

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


Mime
View raw message