• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HTTPServletRequest containing an HTTPEntity

 
Vikas Solegaonkar
Greenhorn
Posts: 9
Java
  • Mark post as helpful
  • send pies
  • 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.
 
Tim Moores
Bartender
Posts: 2856
46
  • Likes 1
  • Mark post as helpful
  • send pies
  • 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
  • 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
Bartender
Posts: 2856
46
  • Likes 1
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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 !
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic