File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other Open Source Projects and the fly likes Servlet can't find the specified path Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Servlet can Watch "Servlet can New topic
Author

Servlet can't find the specified path

malik ge
Ranch Hand

Joined: May 13, 2011
Posts: 69
Hi,
I am having problem calling Jasper report from servlet.

When I run the following program in main method, it works fine.


But when do public void displayReport(), and calls it from a servlet,


I got an Exception that
net.sf.jasperreports.engine.JRException: java.io.FileNotFoundException: reports\report.jrxml (The system cannot find the path specified)


Any Idea why I am getting an exception that file not found?
endswel shui
Ranch Hand

Joined: Jul 03, 2008
Posts: 33

try to use the request.getRealPath("/")
getServletContext().getRealPath("/");
this.getClass().getClassLoader().getResource("").getPath();
and analyze and reorganize it
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Servlet can't find the specified path
 
Similar Threads
Problem in ireport
Jasper Report and Struts
JSP, Jasper Report in Netbeans 6.1
tomcat connection
jasper report- error