0

I have installed GeoServer 2.23.1 on Ubuntu 20.04.6 LTS with Java OpenJDK version 11.0.19.

I tried to setup print plugin geoserver-2.23.1-printing-plugin. However when I call geoserver/pdf/info.json I have the following error :

HTTP ERROR 500 javax.servlet.ServletException: javax.servlet.ServletException: Error occurred while reading configuration file '/usr/share/geoserver/data_dir/printing/config.yaml': org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'mapPrinter': Unsatisfied dependency expressed through field 'configFactory'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'configFactory': Unsatisfied dependency expressed through field 'threadResources'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'threadResources': Lookup method resolution failed; nested exception is java.lang.IllegalStateException: Failed to introspect Class [org.mapfish.print.ThreadResources] from ClassLoader [WebAppClassLoader{GeoServer}@40a4337a] URI: /geoserver/pdf/info.json STATUS: 500 MESSAGE: javax.servlet.ServletException: javax.servlet.ServletException: Error occurred while reading configuration file '/usr/share/geoserver/data_dir/printing/config.yaml': org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'mapPrinter': Unsatisfied dependency expressed through field 'configFactory'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'configFactory': Unsatisfied dependency expressed through field 'threadResources'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'threadResources': Lookup method resolution failed; nested exception is java.lang.IllegalStateException: Failed to introspect Class [org.mapfish.print.ThreadResources] from ClassLoader [WebAppClassLoader{GeoServer}@40a4337a] SERVLET: dispatcher CAUSED BY: javax.servlet.ServletException: javax.servlet.ServletException: Error occurred while reading configuration file '/usr/share/geoserver/data_dir/printing/config.yaml': org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'mapPrinter': Unsatisfied dependency expressed through field 'configFactory'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'configFactory': Unsatisfied dependency expressed through field 'threadResources'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'threadResources': Lookup method resolution failed; nested exception is java.lang.IllegalStateException: Failed to introspect Class [org.mapfish.print.ThreadResources] from ClassLoader [WebAppClassLoader{GeoServer}@40a4337a] CAUSED BY: javax.servlet.ServletException: Error occurred while reading configuration file '/usr/share/geoserver/data_dir/printing/config.yaml': org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'mapPrinter': Unsatisfied dependency expressed through field 'configFactory'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'configFactory': Unsatisfied dependency expressed through field 'threadResources'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'threadResources': Lookup method resolution failed; nested exception is java.lang.IllegalStateException: Failed to introspect Class [org.mapfish.print.ThreadResources] from ClassLoader [WebAppClassLoader{GeoServer}@40a4337a]

I have also tried with other versions of the plugin but same error occurs. Any advice?

-- EDIT -- The content of the config.yaml file

#===========================================================================
# allowed DPIs
#===========================================================================
dpis: [75, 150, 300]

#===========================================================================
# the allowed scales
#===========================================================================
scales:
  - 25000
  - 50000
  - 100000
  - 200000
  - 500000
  - 1000000
  - 2000000
  - 4000000

#===========================================================================
# the list of allowed hosts
#===========================================================================
hosts:
  - !localMatch
    dummy: true
  - !ipMatch
    ip: www.camptocamp.org
  - !dnsMatch
    host: demo.opengeo.org
    port: 80
  - !dnsMatch
    host: terraservice.net
    port: 80
  - !dnsMatch
    host: sigma.openplans.org
  - !dnsMatch
    host: demo.mapfish.org

layouts:
  Legal:
    mainPage:
      pageSize: LEGAL
      items:
        - !map
          spacingAfter: 30
          width: 440
          height: 483
  #===========================================================================
  A4 portrait:
  #===========================================================================
    metaData:
#      title: '${mapTitle}'
      author: 'MapFish print module'
      subject: 'Simple layout'
      keywords: 'map,print'
      creator: 'MapFish'

    titlePage:
      pageSize: A4
      items:
        - !text
          spacingAfter: 150
        - !text
          font: Helvetica
          fontSize: 40
          spacingAfter: 100
          align: center
          text: '${layout}'
        - !image
          maxWidth: 160
          maxHeight: 160
          spacingAfter: 100
          align: center
          url: http://trac.mapfish.org/trac/mapfish/attachment/ticket/3/logo_v8_sphere.svg?format=raw

      footer: &commonFooter
        height: 30
        items:
          - !columns
            config:
              cells:
                - paddingBottom: 5   
            items:
              - !text
                backgroundColor: #FF0000
                align: left
                text: a red box
              - !text
                align: left
                text: 'Page ${pageNum}'
              - !image
                align: center
                maxWidth: 100
                maxHeight: 30
                spacingAfter: 200
                url: 'http://geoserver.org/img/geoserver-logo.png'

    #-------------------------------------------------------------------------
    mainPage:
      pageSize: A4
      rotation: true
#      header:
#        height: 50
#        items:
#          - !text
#            font: Helvetica
#            fontSize: 30
#            align: left
#            text: '${layout}'
      items:
        - !text
          text: '${mapTitle}'
          fontSize: 30
          spacingAfter: 30
        - !map
          spacingAfter: 30
          width: 440
          height: 483
        - !columns
          # columns can have an absolute position. In that case, they need the 3 following fields:
          absoluteX: 410
          absoluteY: 310
          width: 100
          items:
            - !scalebar
              type: bar
              maxSize: 100
              barBgColor: white
              fontSize: 8
              align: left
        - !text
          text: '${comment}'
          spacingAfter: 30
        - !attributes
          source: data
          spacingAfter: 30
          columnDefs:
            id:
              columnWeight: 2
              header: !text
                text: ID
                backgroundColor: #A0A0A0
              cell: !text
                text: '${id}'
            name:
              columnWeight: 5
              header: !text
                text: Name
                backgroundColor: #A0A0A0
              cell: !columns
                config:
                  cells:
                    - backgroundColor: '${nameBackgroundColor}'
                      borderWidth: 1
                      borderColor: '${nameBorderColor}'
                items:
                  - !text
                    text: '${name}'
            icon:
              columnWeight: 2
              header: !text
                text: Symbol
                backgroundColor: #A0A0A0
              cell: !image
                align: center
                maxWidth: 15
                maxHeight: 15
                url: 'http://www.mapfish.org/svn/mapfish/trunk/MapFish/client/mfbase/mapfish/img/${icon}.png'
        - !text
          font: Helvetica
          fontSize: 9
          align: left
          text: '1:${scale} ${now MM.dd.yyyy}'
      footer: *commonFooter

version of plugin

4
  • are you sure you installed the 2.23.1 version of the extension? ans what is in /usr/share/geoserver/data_dir/printing/config.yaml'?
    – Ian Turton
    Commented Jun 5, 2023 at 13:28
  • @IanTurton yes for the version. I have added the content of the config.yaml in the question
    – Gregoire
    Commented Jun 5, 2023 at 14:23
  • Do those http references need to be https?
    – alexGIS
    Commented Jun 7, 2023 at 20:31
  • 1
    @alexGIS same error when I replace http references by https
    – Gregoire
    Commented Jun 12, 2023 at 6:50

1 Answer 1

0
+50

The issue stems from an unavailable dependency in the plugin, perhaps caused by a misconfiguration in the .yaml that the plugin team did not anticipate, or perhaps caused by an incomplete installation of GeoServer or the plugin itself. It could also be a Tomcat configuration error.

I see another user encountered a very similar issue to this in 2.22 with a server error stemming from unsatisfied dependencies when they tried to access info.json. They fixed it by installing the Apache Commons HttpClient 3.1 library. You might try installing the dependency yourself and see if that helps. If that doesn't work, you might try the GeoServer Users mailing list.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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