Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

sending jar file to client using OutputStream

 
Joshua Antony
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am a newbie in servlet.Just wrote a servlet to send jar file to client using OutputStream. Below is the code.




While running the above servlet in server I get following error:
java.io.FileNotFoundException: bootstrap.jar (The system cannot find the file specified)
java.io.FileInputStream.open(Native Method)
java.io.FileInputStream.<init>(FileInputStream.java:106)
ReadingJarFile.doGet(ReadingJarFile.java:16)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

The file bootstrap.jar is present in the bin directory of Tomcat. Please let me know where I am making mistake.
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

File file = new File("bootstrap.jar");

Did you put the file in the local directory of the Web server? If not, please specify the full path of your JAR file, e.g. /root/home/http/xxx/bootstrap.jar

Nick
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mention the fully qualified path for the file or put the jar file in the directory that the web container looks in
 
Joshua Antony
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The jar file is inside the bin directory of Tomcat.Does'nt the web server look here for the jar?

Kind Regards,
Joshua.
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by joshua antony:
The jar file is inside the bin directory of Tomcat.Does'nt the web server look here for the jar?

For itself and its own purposes, yes. But that doesn't mean the File class magically knows where to find the jar.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic