Click here to Skip to main content
11,920,641 members (56,590 online)
Rate this:
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 20-Mar-13 7:15am
Please elaborate what exactly you want to do and where are you getting exception.
lalitk369 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 415
1 phil.o 170
2 Dave Kreskowiak 155
3 KrunalRohit 134
4 F-ES Sitecore 130
0 OriginalGriff 6,778
1 KrunalRohit 4,530
2 Sergey Alexandrovich Kryukov 3,203
3 George Jonsson 2,815
4 Suvendu Shekhar Giri 2,181

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