rakeshenoch Posted November 17, 2009 Share Posted November 17, 2009 Hi All,I have an application which renders jasper reports as HTML view (default). There are others view available like PDF, RTF and XLS in the application. All my reports use a logo image and the path for which is provided by a parameter $P{LogoPath} of type String (I supply the url). The problem I'm facing is that the logo image is not visible in the HTML view, whereas in other views the logo image is visible. The exception I get when viewing HTML view is attached below Nov 17, 2009 2:58:38 PM org.apache.catalina.core.StandardWrapperValve invokeSEVERE: Servlet.service() for servlet ImageServlet threw exceptionjavax.servlet.ServletException: No JasperPrint documents found on the HTTP session. at net.sf.jasperreports.j2ee.servlets.ImageServlet.service(ImageServlet.java:93) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Thread.java:619)For your information I have also registered ImageServlet in web.xml as<servlet> <servlet-name>ImageServlet</servlet-name> <servlet-class>net.sf.jasperreports.j2ee.servlets.ImageServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>ImageServlet</servlet-name> <url-pattern>/servlets/image</url-pattern> </servlet-mapping>Thanks in advance,Rakesh Link to comment Share on other sites More sharing options...
vpremkumar Posted December 1, 2009 Share Posted December 1, 2009 Hi Rakesh ,Did you find a solution to this issue? I was facing the same issue..It will be great if you can gv suggestion. I'm using Jasper-pro 3.5 and trying to get the report through webservice. Im able to generate the report in html format. but the chart(image) is not appearing. The chart is displaying when the report is run on jasper server directly. Any suggestions will be appreciated.Thank you,Vandana Link to comment Share on other sites More sharing options...
rakeshenoch Posted December 2, 2009 Author Share Posted December 2, 2009 Hi Vandana,If I have understood your problem your problem correctly, then I have two suggestions for you. I hope you have registered your ImageServlet in web.xml<servlet> <servlet-name>ImageServlet</servlet-name> <servlet-class>net.sf.jasperreports.j2ee.servlets.ImageServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>ImageServlet</servlet-name> <url-pattern>/servlets/image</url-pattern> </servlet-mapping> Secondly, the JasperPrint object created after filling the report must be available in the session object. You can do this as mentioned below.JasperPrint jasperPrint = JasperFillManager.fillReport(jreport, paramHashMap, connection);request.getSession().setAttribute(ImageServlet.DEFAULT_JASPER_PRINT_SESSION_ATTRIBUTE, jasperPrint);exporter.setParameter(JRHtmlExporterParameter.IMAGES_URI, "servlets/image?image=");Hope this helps you. Link to comment Share on other sites More sharing options...
vpremkumar Posted December 4, 2009 Share Posted December 4, 2009 Thank you So much Rakesh ! The issue is resolved by the two steps you mentioned. Regards,Vandana Link to comment Share on other sites More sharing options...
ldcl289 Posted November 23, 2010 Share Posted November 23, 2010 Hi,rakeshenochWrote: Hi Vandana, If I have understood your problem your problem correctly, then I have two suggestions for you. I hope you have registered your ImageServlet in web.xml <servlet> <servlet-name>ImageServlet</servlet-name> <servlet-class>net.sf.jasperreports.j2ee.servlets.ImageServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>ImageServlet</servlet-name> <url-pattern>/servlets/image</url-pattern> </servlet-mapping> Secondly, the JasperPrint object created after filling the report must be available in the session object. You can do this as mentioned below. JasperPrint jasperPrint = JasperFillManager.fillReport(jreport, paramHashMap, connection); request.getSession().setAttribute(ImageServlet.DEFAULT_JASPER_PRINT_SESSION_ATTRIBUTE, jasperPrint); exporter.setParameter(JRHtmlExporterParameter.IMAGES_URI, "servlets/image?image="); Hope this helps you. I use all this, but, since I update to 3.6.7, it doesn't work!! Link to comment Share on other sites More sharing options...
elainetmy Posted July 30, 2013 Share Posted July 30, 2013 Hi Idcl289,I at first also facing the problem that you are facing.I solved mine by changing the struts.xml. It is configuration problem in my case. I added this line <constant name="struts.action.excludePattern" value="/servlets/images*"/>Hope it helps.Elaine Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now