1

I've installed OpenGeo 3.1 and I want to do some changes in config.yaml. The thing is that after certain changes like changing font color or adding font type it cause the print provider to crush.

for example :

In A4:

- !text
   text: "${mapTitle}"
   fontSize: 30
   spacingAfter: 30
   align: center

if I add font: Helvetica or add fontColor:black I get error from

http://localhost:8080/geoserver/pdf/info.json

This makes me think that the printing provider i'm using doesn't support these configurations

I've checked in geoserver , These 2 jars are installed :

printing-2.2-SNAPSHOT.jar
print-lib-1.2-20101018133712.jar

What am I missing here ?!

HTTP ERROR: 500

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.ho.yaml.exception.YamlException: Error near line 0: End of document expected.

RequestURI=/geoserver/pdf/info.json
Caused by:

java.lang.RuntimeException: org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.ho.yaml.exception.YamlException: Error near line 0: End of document expected.
    at org.geoserver.monitor.MonitorFilter.doFilter(MonitorFilter.java:177)
    at org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:70)
    at org.geoserver.filters.SpringDelegatingFilter.doFilter(SpringDelegatingFilter.java:45)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
    at org.geoserver.platform.AdvancedDispatchFilter.doFilter(AdvancedDispatchFilter.java:49)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
    at org.vfny.geoserver.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:109)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:311)
    at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:68)
    at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:116)
    at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
    at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:72)
    at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:91)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
    at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:68)
    at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
    at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:72)
    at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:91)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
    at org.geoserver.security.filter.GeoServerAnonymousAuthenticationFilter.doFilter(GeoServerAnonymousAuthenticationFilter.java:53)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
    at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter

This is the originl config.yaml :

dpis: [75, 150, 300]

scales:
    - 524288000
    - 262144000
    - 131072000
    - 65536000
    - 32768000
    - 16384000
    - 8192000
    - 4096000
    - 2048000
    - 1024000
    - 512000
    - 256000
    - 128000
    - 64000
    - 32000
    - 16000
    - 8000
    - 4000
    - 2000
    - 1000

hosts:
    - !localMatch
        dummy: true
    - !ipMatch
        ip: 0.0.0.0
        mask: 0.0.0.0

layouts:

    A4:
        metaData: &commonMetaData
            title: "${mapTitle}"
            author: "GeoExplorer"
            subject: "Map printed with the OpenGeo Suite"
            keywords: "map,print"
            creator: "OpenGeo Suite"
        mainPage:
            pageSize: A4
            rotation: true
            items:
                - !text
                    text: "${mapTitle}"
                    fontSize: 30
                    spacingAfter: 30
                    align: center
                - !map
                    spacingAfter: 10
                    width: 440
                    height: 600
                - !scalebar
                    type: bar
                    maxSize: 100
                    barBgColor: white
                    fontSize: 8
                    align: right
                    spacingAfter: 10
                - !text
                    text: "${comment}"

    Legal:
        metaData: *commonMetaData
        mainPage:
            pageSize: LEGAL
            rotation: true
            items:
                - !text
                    text: "${mapTitle}"
                    fontSize: 30
                    spacingAfter: 30
                    align: center
                - !map
                    spacingAfter: 10
                    width: 440
                    height: 650
                - !scalebar
                    type: bar
                    maxSize: 100
                    barBgColor: white
                    fontSize: 8
                    align: right
                    spacingAfter: 10
                - !text
                    text: "${comment}"

    Letter:
        metaData: *commonMetaData
        mainPage:
            pageSize: LETTER
            rotation: true
            items:
                - !text
                    text: "${mapTitle}"
                    fontSize: 30
                    spacingAfter: 30
                    align: center
                - !map
                    spacingAfter: 10
                    width: 440
                    height: 550
                - !scalebar
                    type: bar
                    maxSize: 100
                    barBgColor: white
                    fontSize: 8
                    align: right
                    spacingAfter: 10
                - !text
                    text: "${comment}"
1

You are adding the correct variables as I have tried adding fontColor and changing font in my config.yaml (snippet below) and it works ok.

- !text
    marginTop: 10
    text: '${copyrightText}'
    font: Helvetica
    fontColor: Red
    fontSize: 9
    align: left
    vertAlign: middle

Are you maintaining the correct indentation using spaces rather than tabs? yaml can be very picky about this so when I am editing in notepad++ I have to use 4 spaces rather than 1 tab to indent.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.