Print error

12 views
Skip to first unread message
Assigned to lorenzo...@geosolutionsgroup.com by me

Reda Mrini Derhmira

unread,
Nov 10, 2022, 6:01:14 AM11/10/22
to mapstore-users
Hi everyone,
I'm using mapstore but I only start the front ent with ---npm run fe:start---- and I have build mapstore.war with the command ./build.sh and I deployed it in tomcat 8.5 and it runs in port 8086 and I have already changed the port in DevServer.js file.
In other words I have conncet my front-end with a deployed mapstore in tomcat and it runs in port:8086.
I tried to use the print module and I followed the steps in the documentation and now when I try to print it I got this error message:

Error on printing: Error while generating PDF: org.mapfish.print.InvalidValueException: url has an invalid value: file://${configDir}/print_header.png at org.mapfish.print.config.layout.ImageBlock.render(ImageBlock.java:61) at org.mapfish.print.PDFUtils.createCell(PDFUtils.java:657) at org.mapfish.print.PDFUtils.buildTable(PDFUtils.java:642) at org.mapfish.print.config.layout.ColumnsBlock$1.render(ColumnsBlock.java:58) at org.mapfish.print.PDFCustomBlocks.addAbsoluteDrawer(PDFCustomBlocks.java:186) at org.mapfish.print.config.layout.ColumnsBlock.render(ColumnsBlock.java:56) at org.mapfish.print.config.layout.Page.render(Page.java:80) at org.mapfish.print.config.layout.Layout.render(Layout.java:64) at org.mapfish.print.output.AbstractOutputFormat.doPrint(AbstractOutputFormat.java:31) at org.mapfish.print.output.PdfOutputFactory.print(PdfOutputFactory.java:58) at org.mapfish.print.MapPrinter.print(MapPrinter.java:176) at org.mapfish.print.servlet.MapPrinterServlet.doCreatePDFFile(MapPrinterServlet.java:385) at org.mapfish.print.servlet.MapPrinterServlet.createPDF(MapPrinterServlet.java:185) at org.mapfish.print.servlet.MapPrinterServlet.doPost(MapPrinterServlet.java:113) at javax.servlet.http.HttpServlet.service(HttpServlet.java:682) at javax.servlet.http.HttpServlet.service(HttpServlet.java:765) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:543) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:698) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:367) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:639) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:885) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1693) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.base/java.lang.Thread.run(Unknown Source) Caused by: java.net.URISyntaxException: Illegal character in path at index 16: file:/C:/Program Files/Apache Software Foundation/Tomcat 8.5/webapps/mapstore/printing/print_header.png at java.base/java.net.URI$Parser.fail(Unknown Source) at java.base/java.net.URI$Parser.checkChars(Unknown Source) at java.base/java.net.URI$Parser.parseHierarchical(Unknown Source) at java.base/java.net.URI$Parser.parse(Unknown Source) at java.base/java.net.URI.<init>(Unknown Source) at org.mapfish.print.config.layout.ImageBlock.render(ImageBlock.java:59) ... 41 more 

Is there any solution

Lorenzo Natali

unread,
Nov 15, 2022, 6:28:48 AM11/15/22
to mapstore-users
Hi, 
Looks like the URL 'file://${configDir}/print_header.png' in config.yml is not recognized as valid.
configDir is replaced with the current directory, but I think that it doesn't support spaces --> file:/C:/Program Files/<something> is probably the location of your tomcat. 

try to deploy it in a path that do not includes spaces.
Reply all
Reply to author
Forward
0 new messages