0

I am trying to use Jetty to connect to an HTTP server that uses websocket. The problem is that the compiler cannot resolve the class HTTPClient. I've searched here on stackoverflow, i've found a solution but the link with the useful resource is no more available... What JAR should i include to run this example? http://wiki.eclipse.org/Jetty/Tutorial/HttpClient

The page doesn't tell anything about... Thank you

Stephen C
  • 698,415
  • 94
  • 811
  • 1,216
mark
  • 939
  • 2
  • 13
  • 36

3 Answers3

0

The class in the jetty-client.jar. You can find it in the lib directory of the jetty distribution.

obourgain
  • 8,856
  • 6
  • 42
  • 57
0

Did you copy http-client jar to yourapp/WEB-INF/lib? Adding jar to eclipse classpath adds that to your compile time classpath but also you need to add it to runtime classpath ( in case of webapps by adding it to WEB-INF/lib

OR

if you are using eclipse/ any other IDE:

  1. delete the project from eclipse.
  2. delete the folder in .
  3. Restart eclipse and Import the project back into eclipse.
r3ap3r
  • 2,775
  • 2
  • 17
  • 16
  • Solved, but i still get a compiling error, CONNECTOR_SELECT_CHANNEL cannot be resolved or is not a field .... – mark Aug 06 '13 at 08:30
0

I had the exact same problem and the solution I figured out is to use another version of Jetty. The current latest (v9.2.6) was giving me the same error what's in the title above. Then I download jetty v8.1.16 and added in Eclipse (JUNO) to the "Java Build Path -> Libraries" (instead of v9.2.6) and the problem was resolved. Good luck!

Imre
  • 474
  • 5
  • 11