You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Vikas <vi...@unnat-e.com> on 2007/06/26 13:17:21 UTC

PostMethod problem - Can't understanding what is happening?

Hi Friends,

I am able to POST message from normal stand alone application using HttpClient.
But when I integrate sample code with my project; it is failing to send POST request. It is not creating "PostMethod" object.

code is here -->
String url = "http://localhost:8080/solr/update";

HttpClient client = new HttpClient();
PostMethod post = new PostMethod(url);

It is not creating object of PostMethod class, it is NOT throwing any error message also, but when I debug with Eclipse 3.2.2, it is loosing it's control, and on axis 1 client side it is thowing exception 

AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
 faultSubcode:
 faultString: java.lang.reflect.InvocationTargetException
 faultActor:
 faultNode:
 faultDetail:
        {http://xml.apache.org/axis/}hostname:Rajgad

java.lang.reflect.InvocationTargetException



With best regards

From
Vikas R. Khengare

Re: PostMethod problem - Can't understanding what is happening?

Posted by Vikas <vi...@unnat-e.com>.
Hi Roland / Friends,

    Thanks Roland, problem is solved.

you are really great, You solved my problem. I was getting error on (3) i.e.
when creating the "PostMethod" object. As you said, I have include
"commons-codec-1.3.jar" in CLASSPATH and /lib directory of my application,
and it works fine now.

Thanks once again.

With best regards

From
Vikas R. Khengare

----- Original Message ----- 
From: "Roland Weber" <os...@dubioso.net>
To: "HttpClient User Discussion" <ht...@jakarta.apache.org>
Sent: Thursday, June 28, 2007 8:03 PM
Subject: Re: PostMethod problem - Can't understanding what is happening?


> 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


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


Re: PostMethod problem - Can't understanding what is happening?

Posted by Roland Weber <os...@dubioso.net>.
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