Click here to Skip to main content
11,811,971 members (57,197 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: Java Servlet
Exception in thread "AWT-EventQueue-0" java.lang.NoSuchMethodError: org.apache.http.message.LineParser.hasProtocolVersion(Lorg/apache/http/util/CharArrayBuffer;I)Z
	at org.apache.http.impl.conn.DefaultResponseParser.parseHead(
	at org.apache.http.impl.AbstractHttpClientConnection.receiveResponseHeader(
	at org.apache.http.impl.conn.DefaultClientConnection.receiveResponseHeader(
	at org.apache.http.impl.conn.AbstractClientConnAdapter.receiveResponseHeader(
	at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(
	at org.apache.http.protocol.HttpRequestExecutor.execute(
	at org.apache.http.impl.client.DefaultClientRequestDirector.execute(
	at org.apache.http.impl.client.AbstractHttpClient.execute(
	at org.apache.http.impl.client.AbstractHttpClient.execute(
	at org.apache.http.impl.client.AbstractHttpClient.execute(
	at MyPack.Enc7.actionPerformed(
	at javax.swing.AbstractButton.fireActionPerformed(
	at javax.swing.AbstractButton$Handler.actionPerformed(
	at javax.swing.DefaultButtonModel.fireActionPerformed(
	at javax.swing.DefaultButtonModel.setPressed(
	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(
	at java.awt.Component.processMouseEvent(
	at javax.swing.JComponent.processMouseEvent(
	at java.awt.Component.processEvent(
	at java.awt.Container.processEvent(
	at java.awt.Component.dispatchEventImpl(
	at java.awt.Container.dispatchEventImpl(
	at java.awt.Component.dispatchEvent(
	at java.awt.LightweightDispatcher.retargetMouseEvent(
	at java.awt.LightweightDispatcher.processMouseEvent(
	at java.awt.LightweightDispatcher.dispatchEvent(
	at java.awt.Container.dispatchEventImpl(
	at java.awt.Window.dispatchEventImpl(
	at java.awt.Component.dispatchEvent(
	at java.awt.EventQueue.dispatchEventImpl(
	at java.awt.EventQueue.access$200(
	at java.awt.EventQueue$
	at java.awt.EventQueue$
	at Method)
	at java.awt.EventQueue$
	at java.awt.EventQueue$
	at Method)
	at java.awt.EventQueue.dispatchEvent(
	at java.awt.EventDispatchThread.pumpOneEventForFilters(
	at java.awt.EventDispatchThread.pumpEventsForFilter(
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(
	at java.awt.EventDispatchThread.pumpEvents(
	at java.awt.EventDispatchThread.pumpEvents(

Not able to understand the problem,. Please tell me the problem....
Posted 20-Mar-13 1:05am
Tadit Dash at 20-Mar-13 7:15am
Please elaborate what exactly you want to do and where are you getting exception.
lalitk369 at 20-Mar-13 7:19am
i am communicating between client and server using java class and servlet but i am getting this error on this 3rd line.

(1) DefaultHttpClient client = new DefaultHttpClient();
(2) HttpPost post = new HttpPost("http://localhost:8080/Encrypt2-war/Servlet1");
(3) HttpResponse response = client.execute(post);

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Two probable reasons :
1. the class doesn't contain the method it expected
2. Mis-matched versions of that class. You compiled with the version that has that method and then tried to execute with another version that did not.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 KrunalRohit 354
1 Palash Mondal_ 185
2 CHill60 180
3 OriginalGriff 178
4 Abhinav S 175
0 OriginalGriff 3,888
1 KrunalRohit 2,392
2 CPallini 2,240
3 Maciej Los 2,155
4 ppolymorphe 1,725

Advertise | Privacy | Mobile
Web02 | 2.8.151002.1 | Last Updated 20 Mar 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100