Win a copy of Java EE 8 High Performance this week in the Java/Jakarta EE forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to invoke a servlet running on IIS server from a java application??  RSS feed

Ranch Hand
Posts: 200
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everybody,
We are developing a Chat kinda application. Both the client and the server programs are written in java. We are running the IIS Server with ServletExec servlet engine.
We have put our servlets in the "Servlets" directory. We are able to invoke this servlet from the browser. But when we try to execute the servlet from our client java application using URL connection, we get the "FileNotFound" exception. Why is this so?... A fragment of the clinet code that makes a connection to the servlet is given below
1 URL url = new URL("http://SomeServer/servlet/MyServlet");
2 URLConnection connection = url.openConnection();
3 connection.connect();
4 in= new BufferedReader( new InputStreamReader(connection.getInputStream()));
The exception is got at the 4th line. Ie the Exception is thrown when we try to read the input stream. Another thing is that this servlet worked fine when we used Java WebServer instead of IIS server...
Pls help me out
......Sajee Joseph
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!