• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

HTTPServletRequest containing an HTTPEntity

 
Greenhorn
Posts: 9
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to have a simple Java application running on the client machine communicate with a HttpServlet on server machine. But, I am not able to get it working. I know this means mixing two different technologies.. but it will make my life much simpler if I can get this to work. Have you tried this before?

The code is some what like this..

Client

Server:


This fails with a ClassNotFoundException.
 
Saloon Keeper
Posts: 7585
176
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That means a required class is not the classpath. Without seeing the stack trace (which includes the information about which class is missing) there's not much else we can do.
 
Vikas Solegaonkar
Greenhorn
Posts: 9
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The Class is there in the classpath - I am running it in eclipse. Here is the stack trace



 
Tim Moores
Saloon Keeper
Posts: 7585
176
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which classpath is that? It needs to be in the servlet container's WEB-INF/lib directory if it's used in the web app.
 
Vikas Solegaonkar
Greenhorn
Posts: 9
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Moores wrote:Which classpath is that? It needs to be in the servlet container's WEB-INF/lib directory if it's used in the web app.



Thanks Tim for your time on this..
Yes, I have added the Apache jars (httpclient-4.1.3.jar, httpcore-4.1.4.jar, commons-logging-1.1.1.jar) to the WEB-INF/lib directory as well as in the eclipse project build configuration. I believe the HttpEntity is a part of the httpcore. The strange thing is that none of the println traces are visible on the console.

I have a feeling the problem is something really silly that I have missed in the sequence of calls either on client or server. But unable to get to it.
 
Vikas Solegaonkar
Greenhorn
Posts: 9
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Found the problem! I had dropped the jar files in the WEB-INF/lib folder. But did not refresh the eclipse project after that !!
It worked well after a refresh !
 
reply
    Bookmark Topic Watch Topic
  • New Topic