Geoserver Mapfish Printing error while reading configuration file config.yaml

981 views Asked by At

I have installed Geoserver 2.8 in my server and mapfish Print plugin 2.8. I have deployed Geoserver Tomcat 8.0. I followed all steps mentioned in http://docs.geoserver.org/latest/en/user/extensions/printing/

When I restarted tomcat server 'printing' folder with config.yaml file created under Geoserver/ data folder. When I tried to verify installation by giving url : http://localhost:8081/geoserver/pdf/info.json

I get the below error :

    javax.servlet.ServletException: Error occurred while reading configuration file 'D:\Program Files (x86)\Apache Software Foundation\Tomcat 8.0\webapps\geoserver\data\printing\config.yaml': org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mapPrinter': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.mapfish.print.config.ConfigFactory org.mapfish.print.MapPrinter.configFactory; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'configFactory': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.mapfish.print.ThreadResources org.mapfish.print.config.ConfigFactory.threadResources; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'threadResources': Invocation of init method failed; nested exception is java.lang.OutOfMemoryError: unable to create new native thread
org.mapfish.print.servlet.BaseMapServlet.getMapPrinter(BaseMapServlet.java:132)
org.mapfish.print.servlet.MapPrinterServlet.getInfo(MapPrinterServlet.java:279)
org.mapfish.print.servlet.MapPrinterServlet.doGet(MapPrinterServlet.java:99)
javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.springframework.web.servlet.mvc.ServletWrappingController.handleRequestInternal(ServletWrappingController.java:159)
org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
org.apache.catalina.filters.CorsFilter.handleNonCORS(CorsFilter.java:436)
org.apache.catalina.filters.CorsFilter.doFilter(CorsFilter.java:177)
org.geoserver.filters.ThreadLocalsCleanupFilter.doFilter(ThreadLocalsCleanupFilter.java:28)
org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:75)
org.geoserver.wms.animate.AnimatorFilter.doFilter(AnimatorFilter.java:71)
org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:71)
org.geoserver.filters.SpringDelegatingFilter.doFilter(SpringDelegatingFilter.java:46)
org.geoserver.platform.AdvancedDispatchFilter.doFilter(AdvancedDispatchFilter.java:50)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:311)
org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:69)
org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:116)
org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:73)
org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:92)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:69)
org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:73)
org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:92)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
org.geoserver.security.filter.GeoServerAnonymousAuthenticationFilter.doFilter(GeoServerAnonymousAuthenticationFilter.java:54)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:69)
org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150)
org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:73)
org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:92)
org.geoserver.security.filter.GeoServerBasicAuthenticationFilter.doFilter(GeoServerBasicAuthenticationFilter.java:83)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:69)
org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
org.geoserver.security.filter.GeoServerSecurityContextPersistenceFilter$1.doFilter(GeoServerSecurityContextPersistenceFilter.java:53)
org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:73)
org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:92)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:173)
org.geoserver.security.GeoServerSecurityFilterChainProxy.doFilter(GeoServerSecurityFilterChainProxy.java:135)
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
org.geoserver.filters.LoggingFilter.doFilter(LoggingFilter.java:87)
org.geoserver.filters.GZIPFilter.doFilter(GZIPFilter.java:42)
org.geoserver.filters.SessionDebugFilter.doFilter(SessionDebugFilter.java:48)
org.geoserver.filters.FlushSafeFilter.doFilter(FlushSafeFilter.java:44)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)

It says error reading config.yaml file. Can't find what is the error with Config.yaml.

2

There are 2 answers

0
Shrikant On

I solved it. The problem was with the Printing-plugin version. I tried with another version and it worked.

0
qwerps On

Since this is still an issue with current docker images for geoserver, this is how i solved the problem:

Download the common-httpclient-3.1.jar

Copy it into the docker container and paste it into the /WEB-INF/lib folder (e.g /usr/local/tomcat/webapps/geoserver/WEB-INF/lib). Then restart Geoserver.