Click here to Skip to main content
11,412,159 members (64,909 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 2: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 OriginalGriff 348
1 Sergey Alexandrovich Kryukov 225
2 Sascha Lefévre 175
3 ProgramFOX 130
4 Maciej Los 110
0 Sergey Alexandrovich Kryukov 8,980
1 OriginalGriff 7,263
2 Maciej Los 3,500
3 Abhinav S 3,248
4 Peter Leow 3,059

Advertise | Privacy | Mobile
Web03 | 2.8.150414.5 | 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