mapfish / mapfish-print

A component of MapFish for printing templated cartographic maps. This module is the Java serverside module.
http://mapfish.github.io/mapfish-print-doc/
BSD 2-Clause "Simplified" License
185 stars 416 forks source link

Unable to add an WMTS layer to the map (no errors reported) #1948

Open gavinharriss opened 3 years ago

gavinharriss commented 3 years ago

Context

Describe the bug

When adding a WMTS layer to the map, no layer imagery is added and logs report success.

The WMTS service is described here: https://data.linz.govt.nz/services;key=60c2f93ec4dc45448ff7d93df524eb75/wmts/1.0.0/layer/50767/WMTSCapabilities.xml

Further details of the layer can be found here, in case of use for context: https://data.linz.govt.nz/layer/50767-nz-topo50-maps/webservices/

I can successfully use the OSM tile equivalent, but need to use the WMTS service to make the EPSG:2193 projection available.

Any ideas what may be going wrong? Bug or noob mistake with json request?

How to reproduce

Report config: https://www.dropbox.com/s/s8jh6ykv3fxg402/A4-landscape.zip?dl=0

{
    "layout": "A4 landscape",
    "outputFormat": "pdf",
    "geodetic": true,
    "outputFilename": "nztopomap-print",
    "attributes": {
        "map": {
            "projection": "EPSG:2193",
            "dpi": 300,
            "rotation": 0,
            "areaOfInterest": {
                "display": "NONE",
                "area": {
                    "type": "MultiPoint",
                    "coordinates": [
                        [
                            1257372,
                            5023405
                        ],
                        [
                            1262142,
                            5027333
                        ]
                    ]
                }
            },
            "layers": [
                {
                    "type": "WMTS",
                    "baseURL": "https://tiles-a.data-cdn.linz.govt.nz/services;key=60c2f93ec4dc45448ff7d93df524eb75/tiles/v4/layer=50767,style=auto/EPSG:2193/{TileMatrix}/{TileCol}/{TileRow}.png",
                    "opacity": 1,
                    "layer": "layer-50767",
                    "version": "1.0.0",
                    "requestEncoding": "REST",
                    "dimensions": [],
                    "dimensionParams": {},
                    "matrixSet": "EPSG:2193",
                    "matrices": [
                        {
                            "identifier": "0",
                            "matrixSize": [
                                2,
                                4
                            ],
                            "scaleDenominator": 32000000,
                            "tileSize": [
                                256,
                                256
                            ],
                            "topLeftCorner": [
                                10000000.0, -1000000.0
                            ]
                        },
                        {
                            "identifier": "1",
                            "matrixSize": [
                                4,
                                7
                            ],
                            "scaleDenominator": 16000000,
                            "tileSize": [
                                256,
                                256
                            ],
                            "topLeftCorner": [
                                10000000.0, -1000000.0
                            ]
                        },
                        {
                            "identifier": "2",
                            "matrixSize": [
                                8,
                                13
                            ],
                            "scaleDenominator": 8000000,
                            "tileSize": [
                                256,
                                256
                            ],
                            "topLeftCorner": [
                                10000000.0, -1000000.0
                            ]
                        },
                        {
                            "identifier": "3",
                            "matrixSize": [
                                16,
                                25
                            ],
                            "scaleDenominator": 4000000,
                            "tileSize": [
                                256,
                                256
                            ],
                            "topLeftCorner": [
                                10000000.0, -1000000.0
                            ]
                        },
                        {
                            "identifier": "4",
                            "matrixSize": [
                                31,
                                49
                            ],
                            "scaleDenominator": 2000000,
                            "tileSize": [
                                256,
                                256
                            ],
                            "topLeftCorner": [
                                10000000.0, -1000000.0
                            ]
                        },
                        {
                            "identifier": "5",
                            "matrixSize": [
                                61,
                                97
                            ],
                            "scaleDenominator": 1000000,
                            "tileSize": [
                                256,
                                256
                            ],
                            "topLeftCorner": [
                                10000000.0, -1000000.0
                            ]
                        },
                        {
                            "identifier": "6",
                            "matrixSize": [
                                121,
                                193
                            ],
                            "scaleDenominator": 500000,
                            "tileSize": [
                                256,
                                256
                            ],
                            "topLeftCorner": [
                                10000000.0, -1000000.0
                            ]
                        },
                        {
                            "identifier": "7",
                            "matrixSize": [
                                242,
                                386
                            ],
                            "scaleDenominator": 250000,
                            "tileSize": [
                                256,
                                256
                            ],
                            "topLeftCorner": [
                                10000000.0, -1000000.0
                            ]
                        },
                        {
                            "identifier": "8",
                            "matrixSize": [
                                604,
                                965
                            ],
                            "scaleDenominator": 100000,
                            "tileSize": [
                                256,
                                256
                            ],
                            "topLeftCorner": [
                                10000000.0, -1000000.0
                            ]
                        },
                        {
                            "identifier": "9",
                            "matrixSize": [
                                1208,
                                1929
                            ],
                            "scaleDenominator": 50000,
                            "tileSize": [
                                256,
                                256
                            ],
                            "topLeftCorner": [
                                10000000.0, -1000000.0
                            ]
                        },
                        {
                            "identifier": "10",
                            "matrixSize": [
                                3858,
                                2415
                            ],
                            "scaleDenominator": 25000,
                            "tileSize": [
                                256,
                                256
                            ],
                            "topLeftCorner": [
                                10000000.0, -1000000.0
                            ]
                        },
                        {
                            "identifier": "11",
                            "matrixSize": [
                                6037,
                                9645
                            ],
                            "scaleDenominator": 10000,
                            "tileSize": [
                                256,
                                256
                            ],
                            "topLeftCorner": [
                                10000000.0, -1000000.0
                            ]
                        },
                        {
                            "identifier": "12",
                            "matrixSize": [
                                12074,
                                19289
                            ],
                            "scaleDenominator": 5000,
                            "tileSize": [
                                256,
                                256
                            ],
                            "topLeftCorner": [
                                10000000.0, -1000000.0
                            ]
                        },
                        {
                            "identifier": "13",
                            "matrixSize": [
                                24147,
                                38578
                            ],
                            "scaleDenominator": 2500,
                            "tileSize": [
                                256,
                                256
                            ],
                            "topLeftCorner": [
                                10000000.0, -1000000.0
                            ]
                        },
                        {
                            "identifier": "14",
                            "matrixSize": [
                                60366,
                                96443
                            ],
                            "scaleDenominator": 1000,
                            "tileSize": [
                                256,
                                256
                            ],
                            "topLeftCorner": [
                                10000000.0, -1000000.0
                            ]
                        },
                        {
                            "identifier": "15",
                            "matrixSize": [
                                120732,
                                192886
                            ],
                            "scaleDenominator": 500,
                            "tileSize": [
                                256,
                                256
                            ],
                            "topLeftCorner": [
                                10000000.0, -1000000.0
                            ]
                        },
                        {
                            "identifier": "16",
                            "matrixSize": [
                                241463,
                                385771
                            ],
                            "scaleDenominator": 250,
                            "tileSize": [
                                256,
                                256
                            ],
                            "topLeftCorner": [
                                10000000.0, -1000000.0
                            ]
                        }
                    ],
                    "imageFormat": "image/png"
                }
            ]
        }
    }
}

Example map tile url to show the baseUrl should be correct: https://tiles-a.data-cdn.linz.govt.nz/services;key=60c2f93ec4dc45448ff7d93df524eb75/tiles/v4/layer=50767,style=auto/EPSG:2193/0/1/1.png

Actual results

No topo layer is showing on the map: https://www.dropbox.com/s/ykp7orayw802i7w/nztopomap-print%20%2821%29.pdf?dl=0

Not running in multi-instance mode: no DB to connect to
Using CATALINA_BASE:   /usr/local/tomcat
Using CATALINA_HOME:   /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME:        /usr/local/openjdk-11
Using CLASSPATH:       /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar:/usr/local/tomcat/lib/annotations-api.jar:/usr/local/tomcat/lib/catalina-ant.jar:/usr/local/tomcat/lib/catalina-ha.jar:/usr/local/tomcat/lib/catalina-ssi.jar:/usr/local/tomcat/lib/catalina-storeconfig.jar:/usr/local/tomcat/lib/catalina-tribes.jar:/usr/local/tomcat/lib/catalina.jar:/usr/local/tomcat/lib/ecj-4.17.jar:/usr/local/tomcat/lib/el-api.jar:/usr/local/tomcat/lib/jasper-el.jar:/usr/local/tomcat/lib/jasper.jar:/usr/local/tomcat/lib/jaspic-api.jar:/usr/local/tomcat/lib/jsp-api.jar:/usr/local/tomcat/lib/servlet-api.jar:/usr/local/tomcat/lib/tomcat-api.jar:/usr/local/tomcat/lib/tomcat-coyote.jar:/usr/local/tomcat/lib/tomcat-dbcp.jar:/usr/local/tomcat/lib/tomcat-i18n-cs.jar:/usr/local/tomcat/lib/tomcat-i18n-de.jar:/usr/local/tomcat/lib/tomcat-i18n-es.jar:/usr/local/tomcat/lib/tomcat-i18n-fr.jar:/usr/local/tomcat/lib/tomcat-i18n-ja.jar:/usr/local/tomcat/lib/tomcat-i18n-ko.jar:/usr/local/tomcat/lib/tomcat-i18n-pt-BR.jar:/usr/local/tomcat/lib/tomcat-i18n-ru.jar:/usr/local/tomcat/lib/tomcat-i18n-zh-CN.jar:/usr/local/tomcat/lib/tomcat-jdbc.jar:/usr/local/tomcat/lib/tomcat-jni.jar:/usr/local/tomcat/lib/tomcat-util-scan.jar:/usr/local/tomcat/lib/tomcat-util.jar:/usr/local/tomcat/lib/tomcat-websocket.jar:/usr/local/tomcat/lib/websocket-api.jar:/usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
Using CATALINA_OPTS:    -Dlogback.configurationFile=/usr/local/tomcat/conf/logback.xml
NOTE: Picked up JDK_JAVA_OPTIONS:  --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
30-Jun-2021 10:58:45.078 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version name:   Apache Tomcat/9.0.41
30-Jun-2021 10:58:45.090 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built:          Dec 3 2020 11:43:00 UTC
30-Jun-2021 10:58:45.091 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version number: 9.0.41.0
30-Jun-2021 10:58:45.091 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:               Linux
30-Jun-2021 10:58:45.091 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:            5.4.72-microsoft-standard-WSL2
30-Jun-2021 10:58:45.091 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:          amd64
30-Jun-2021 10:58:45.092 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:             /usr/local/openjdk-11
30-Jun-2021 10:58:45.092 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:           11.0.9.1+1
30-Jun-2021 10:58:45.092 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:            Oracle Corporation
30-Jun-2021 10:58:45.093 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         /usr/local/tomcat
30-Jun-2021 10:58:45.093 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:         /usr/local/tomcat
30-Jun-2021 10:58:45.149 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.lang=ALL-UNNAMED
30-Jun-2021 10:58:45.150 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.io=ALL-UNNAMED
30-Jun-2021 10:58:45.150 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
30-Jun-2021 10:58:45.150 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/usr/local/tomcat/conf/logging.properties
30-Jun-2021 10:58:45.151 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
30-Jun-2021 10:58:45.151 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dsun.net.inetaddr.ttl=30
30-Jun-2021 10:58:45.162 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
30-Jun-2021 10:58:45.163 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
30-Jun-2021 10:58:45.163 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dorg.apache.catalina.security.SecurityListener.UMASK=0022
30-Jun-2021 10:58:45.163 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dlogback.configurationFile=/usr/local/tomcat/conf/logback.xml
30-Jun-2021 10:58:45.163 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
30-Jun-2021 10:58:45.164 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/usr/local/tomcat
30-Jun-2021 10:58:45.164 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/usr/local/tomcat
30-Jun-2021 10:58:45.164 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/usr/local/tomcat/temp
30-Jun-2021 10:58:45.174 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded Apache Tomcat Native library [1.2.25] using APR version [1.6.5].
30-Jun-2021 10:58:45.175 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
30-Jun-2021 10:58:45.175 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true]
30-Jun-2021 10:58:45.181 INFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized [OpenSSL 1.1.1d  10 Sep 2019]
30-Jun-2021 10:58:46.446 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
30-Jun-2021 10:58:46.600 INFO [main] org.apache.catalina.startup.Catalina.load Server initialization in [2020] milliseconds
30-Jun-2021 10:58:46.810 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
30-Jun-2021 10:58:46.811 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet engine: [Apache Tomcat/9.0.41]
30-Jun-2021 10:58:46.835 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat/webapps/ROOT]
10:58:55.229 [main] INFO  o.m.print.config.CustomFontLoader - Font java.awt.Font[family=JasperReports Icons,name=JasperReports Icons,style=plain,size=10] from Jasper registered successfully
10:58:55.272 [main] INFO  o.m.print.config.CustomFontLoader - Font java.awt.Font[family=JasperReports Icons,name=JasperReports Icons,style=bold,size=10] from Jasper registered successfully
10:58:55.273 [main] INFO  o.m.print.config.CustomFontLoader - Font java.awt.Font[family=JasperReports Icons,name=JasperReports Icons,style=italic,size=10] from Jasper registered successfully
10:58:55.273 [main] INFO  o.m.print.config.CustomFontLoader - Font java.awt.Font[family=JasperReports Icons,name=JasperReports Icons,style=bolditalic,size=10] from Jasper registered successfully
10:58:55.273 [main] INFO  o.m.print.config.CustomFontLoader - Font java.awt.Font[family=JasperReports Icons,name=JasperReports Icons,style=plain,size=10] from Jasper registered successfully
10:58:55.274 [main] INFO  o.m.print.config.CustomFontLoader - Font java.awt.Font[family=JasperReports Icons,name=JasperReports Icons,style=bold,size=10] from Jasper registered successfully
10:58:55.274 [main] INFO  o.m.print.config.CustomFontLoader - Font java.awt.Font[family=JasperReports Icons,name=JasperReports Icons,style=italic,size=10] from Jasper registered successfully
10:58:55.274 [main] INFO  o.m.print.config.CustomFontLoader - Font java.awt.Font[family=JasperReports Icons,name=JasperReports Icons,style=bolditalic,size=10] from Jasper registered successfully
10:58:55.275 [main] INFO  o.m.print.config.CustomFontLoader - Font java.awt.Font[family=Cadastra,name=Cadastra ,style=plain,size=10] from Jasper registered successfully
10:58:55.275 [main] INFO  o.m.print.config.CustomFontLoader - Font java.awt.Font[family=Cadastra,name=Cadastra Bold,style=bold,size=10] from Jasper registered successfully
10:58:55.275 [main] INFO  o.m.print.config.CustomFontLoader - Font java.awt.Font[family=Cadastra,name=Cadastra Italic,style=italic,size=10] from Jasper registered successfully
10:58:55.275 [main] INFO  o.m.print.config.CustomFontLoader - Font java.awt.Font[family=Cadastra,name=Cadastra Bold Italic,style=bolditalic,size=10] from Jasper registered successfully
10:59:05.519 [Clean up old files] INFO  o.m.print.config.WorkingDirectories - deleted 0 old file(s) in /usr/local/tomcat/temp/mapfish-print/ROOT/reports
10:59:05.527 [Clean up old files] INFO  o.m.print.config.WorkingDirectories - deleted 0 old file(s) in /usr/local/tomcat/temp/mapfish-print/ROOT
10:59:05.528 [Clean up old files] INFO  o.m.print.config.WorkingDirectories - deleted 0 old file(s) in /usr/local/tomcat/temp
10:59:07.948 [main] WARN  org.mapfish.print.VersionInfo - Starting print version 3.25.0 ()
30-Jun-2021 10:59:08.845 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat/webapps/ROOT] has finished in [22,009] ms
30-Jun-2021 10:59:08.870 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
30-Jun-2021 10:59:08.922 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [22320] milliseconds
30-Jun-2021 10:59:17.229 INFO [Thread-4] org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler ["http-nio-8080"]
30-Jun-2021 10:59:17.244 INFO [Thread-4] org.apache.catalina.core.StandardService.stopInternal Stopping service [Catalina]
30-Jun-2021 10:59:17.465 WARNING [Thread-4] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [ROOT] appears to have started a thread named [EMF Reference Cleaner] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 java.base@11.0.9.1/java.lang.Object.wait(Native Method)
 java.base@11.0.9.1/java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:155)
 java.base@11.0.9.1/java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:176)
 org.eclipse.emf.common.util.CommonUtil$1ReferenceClearingQueuePollingThread.run(CommonUtil.java:70)
30-Jun-2021 10:59:17.469 SEVERE [Thread-4] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [ROOT] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@5b23f4]) and a value of type [io.sentry.NoOpHub] (value [io.sentry.NoOpHub@1c54a764]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
30-Jun-2021 10:59:17.523 INFO [Thread-4] org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler ["http-nio-8080"]
30-Jun-2021 10:59:17.568 INFO [Thread-4] org.apache.coyote.AbstractProtocol.destroy Destroying ProtocolHandler ["http-nio-8080"]
Not running in multi-instance mode: no DB to connect to
Using CATALINA_BASE:   /usr/local/tomcat
Using CATALINA_HOME:   /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME:        /usr/local/openjdk-11
Using CLASSPATH:       /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar:/usr/local/tomcat/lib/annotations-api.jar:/usr/local/tomcat/lib/catalina-ant.jar:/usr/local/tomcat/lib/catalina-ha.jar:/usr/local/tomcat/lib/catalina-ssi.jar:/usr/local/tomcat/lib/catalina-storeconfig.jar:/usr/local/tomcat/lib/catalina-tribes.jar:/usr/local/tomcat/lib/catalina.jar:/usr/local/tomcat/lib/ecj-4.17.jar:/usr/local/tomcat/lib/el-api.jar:/usr/local/tomcat/lib/jasper-el.jar:/usr/local/tomcat/lib/jasper.jar:/usr/local/tomcat/lib/jaspic-api.jar:/usr/local/tomcat/lib/jsp-api.jar:/usr/local/tomcat/lib/servlet-api.jar:/usr/local/tomcat/lib/tomcat-api.jar:/usr/local/tomcat/lib/tomcat-coyote.jar:/usr/local/tomcat/lib/tomcat-dbcp.jar:/usr/local/tomcat/lib/tomcat-i18n-cs.jar:/usr/local/tomcat/lib/tomcat-i18n-de.jar:/usr/local/tomcat/lib/tomcat-i18n-es.jar:/usr/local/tomcat/lib/tomcat-i18n-fr.jar:/usr/local/tomcat/lib/tomcat-i18n-ja.jar:/usr/local/tomcat/lib/tomcat-i18n-ko.jar:/usr/local/tomcat/lib/tomcat-i18n-pt-BR.jar:/usr/local/tomcat/lib/tomcat-i18n-ru.jar:/usr/local/tomcat/lib/tomcat-i18n-zh-CN.jar:/usr/local/tomcat/lib/tomcat-jdbc.jar:/usr/local/tomcat/lib/tomcat-jni.jar:/usr/local/tomcat/lib/tomcat-util-scan.jar:/usr/local/tomcat/lib/tomcat-util.jar:/usr/local/tomcat/lib/tomcat-websocket.jar:/usr/local/tomcat/lib/websocket-api.jar:/usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
Using CATALINA_OPTS:    -Dlogback.configurationFile=/usr/local/tomcat/conf/logback.xml
NOTE: Picked up JDK_JAVA_OPTIONS:  --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
30-Jun-2021 10:59:21.415 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version name:   Apache Tomcat/9.0.41
30-Jun-2021 10:59:21.451 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built:          Dec 3 2020 11:43:00 UTC
30-Jun-2021 10:59:21.451 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version number: 9.0.41.0
30-Jun-2021 10:59:21.452 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:               Linux
30-Jun-2021 10:59:21.452 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:            5.4.72-microsoft-standard-WSL2
30-Jun-2021 10:59:21.453 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:          amd64
30-Jun-2021 10:59:21.454 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:             /usr/local/openjdk-11
30-Jun-2021 10:59:21.455 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:           11.0.9.1+1
30-Jun-2021 10:59:21.455 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:            Oracle Corporation
30-Jun-2021 10:59:21.455 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         /usr/local/tomcat
30-Jun-2021 10:59:21.456 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:         /usr/local/tomcat
30-Jun-2021 10:59:21.522 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.lang=ALL-UNNAMED
30-Jun-2021 10:59:21.525 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.io=ALL-UNNAMED
30-Jun-2021 10:59:21.529 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
30-Jun-2021 10:59:21.530 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/usr/local/tomcat/conf/logging.properties
30-Jun-2021 10:59:21.532 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
30-Jun-2021 10:59:21.533 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dsun.net.inetaddr.ttl=30
30-Jun-2021 10:59:21.533 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
30-Jun-2021 10:59:21.534 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
30-Jun-2021 10:59:21.534 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dorg.apache.catalina.security.SecurityListener.UMASK=0022
30-Jun-2021 10:59:21.534 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dlogback.configurationFile=/usr/local/tomcat/conf/logback.xml
30-Jun-2021 10:59:21.534 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
30-Jun-2021 10:59:21.535 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/usr/local/tomcat
30-Jun-2021 10:59:21.535 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/usr/local/tomcat
30-Jun-2021 10:59:21.537 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/usr/local/tomcat/temp
30-Jun-2021 10:59:21.554 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded Apache Tomcat Native library [1.2.25] using APR version [1.6.5].
30-Jun-2021 10:59:21.555 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
30-Jun-2021 10:59:21.555 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true]
30-Jun-2021 10:59:21.566 INFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized [OpenSSL 1.1.1d  10 Sep 2019]
30-Jun-2021 10:59:22.735 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
30-Jun-2021 10:59:22.855 INFO [main] org.apache.catalina.startup.Catalina.load Server initialization in [2217] milliseconds
30-Jun-2021 10:59:23.068 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
30-Jun-2021 10:59:23.069 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet engine: [Apache Tomcat/9.0.41]
30-Jun-2021 10:59:23.088 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat/webapps/ROOT]
10:59:32.599 [main] INFO  o.m.print.config.CustomFontLoader - Font java.awt.Font[family=JasperReports Icons,name=JasperReports Icons,style=plain,size=10] from Jasper registered successfully
10:59:32.647 [main] INFO  o.m.print.config.CustomFontLoader - Font java.awt.Font[family=JasperReports Icons,name=JasperReports Icons,style=bold,size=10] from Jasper registered successfully
10:59:32.659 [main] INFO  o.m.print.config.CustomFontLoader - Font java.awt.Font[family=JasperReports Icons,name=JasperReports Icons,style=italic,size=10] from Jasper registered successfully
10:59:32.659 [main] INFO  o.m.print.config.CustomFontLoader - Font java.awt.Font[family=JasperReports Icons,name=JasperReports Icons,style=bolditalic,size=10] from Jasper registered successfully
10:59:32.659 [main] INFO  o.m.print.config.CustomFontLoader - Font java.awt.Font[family=JasperReports Icons,name=JasperReports Icons,style=plain,size=10] from Jasper registered successfully
10:59:32.660 [main] INFO  o.m.print.config.CustomFontLoader - Font java.awt.Font[family=JasperReports Icons,name=JasperReports Icons,style=bold,size=10] from Jasper registered successfully
10:59:32.660 [main] INFO  o.m.print.config.CustomFontLoader - Font java.awt.Font[family=JasperReports Icons,name=JasperReports Icons,style=italic,size=10] from Jasper registered successfully
10:59:32.660 [main] INFO  o.m.print.config.CustomFontLoader - Font java.awt.Font[family=JasperReports Icons,name=JasperReports Icons,style=bolditalic,size=10] from Jasper registered successfully
10:59:32.661 [main] INFO  o.m.print.config.CustomFontLoader - Font java.awt.Font[family=Cadastra,name=Cadastra ,style=plain,size=10] from Jasper registered successfully
10:59:32.661 [main] INFO  o.m.print.config.CustomFontLoader - Font java.awt.Font[family=Cadastra,name=Cadastra Bold,style=bold,size=10] from Jasper registered successfully
10:59:32.661 [main] INFO  o.m.print.config.CustomFontLoader - Font java.awt.Font[family=Cadastra,name=Cadastra Italic,style=italic,size=10] from Jasper registered successfully
10:59:32.661 [main] INFO  o.m.print.config.CustomFontLoader - Font java.awt.Font[family=Cadastra,name=Cadastra Bold Italic,style=bolditalic,size=10] from Jasper registered successfully
10:59:46.435 [Clean up old files] INFO  o.m.print.config.WorkingDirectories - deleted 0 old file(s) in /usr/local/tomcat/temp/mapfish-print/ROOT/reports
10:59:46.438 [Clean up old files] INFO  o.m.print.config.WorkingDirectories - deleted 0 old file(s) in /usr/local/tomcat/temp/mapfish-print/ROOT
10:59:46.440 [Clean up old files] INFO  o.m.print.config.WorkingDirectories - deleted 0 old file(s) in /usr/local/tomcat/temp
10:59:49.148 [main] WARN  org.mapfish.print.VersionInfo - Starting print version 3.25.0 ()
30-Jun-2021 10:59:50.193 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat/webapps/ROOT] has finished in [27,105] ms
30-Jun-2021 10:59:50.225 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
30-Jun-2021 10:59:50.256 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [27395] milliseconds
10:59:51.230 [http-nio-8080-exec-1] INFO  o.m.p.s.ServletMapPrinterFactory - Configuration file modified. Reloading...
10:59:51.230 [http-nio-8080-exec-1] INFO  o.m.p.s.ServletMapPrinterFactory - Loading configuration file: file:/usr/local/tomcat/webapps/ROOT/print-apps/nztopomap/config.yaml
10:59:51.665 [http-nio-8080-exec-1] INFO  o.m.p.s.j.impl.ThreadPoolJobManager - Submitted print job 73c6b724-b055-4895-b39a-9c924024d638@f983ae99-47e1-4c81-aad2-40dadbcaea9a
10:59:51.781 [PrintJobManager-1] INFO  o.mapfish.print.servlet.job.PrintJob - Starting print job 73c6b724-b055-4895-b39a-9c924024d638@f983ae99-47e1-4c81-aad2-40dadbcaea9a
30-Jun-2021 10:59:55.702 INFO [PrintJobManager-1] org.hsqldb.persist.Logger.logInfoEvent dataFileCache open start
10:59:57.061 [ForkJoinPool-1-worker-229] INFO  o.m.p.p.jasper.JasperReportBuilder - Building Jasper report: /usr/local/tomcat/webapps/ROOT/print-apps/nztopomap/./A4-landscape.jrxml
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by net.sf.jasperreports.engine.util.ClassUtils (file:/usr/local/tomcat/webapps/ROOT/WEB-INF/lib/jasperreports-6.16.0.jar) to constructor com.sun.org.apache.xerces.internal.util.XMLGrammarPoolImpl()
WARNING: Please consider reporting this to the maintainers of net.sf.jasperreports.engine.util.ClassUtils
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
10:59:57.460 [ForkJoinPool-1-worker-115] INFO  o.m.p.processor.ProcessorGraphNode - Time taken to run processor: 'class org.mapfish.print.processor.map.AddStaticLayersProcessor' was 408 ms
11:00:03.853 [ForkJoinPool-1-worker-229] INFO  o.m.p.p.jasper.JasperReportBuilder - Report '/usr/local/tomcat/webapps/ROOT/print-apps/nztopomap/./A4-landscape.jrxml' built in 6781ms.
11:00:03.887 [ForkJoinPool-1-worker-229] INFO  o.m.p.processor.ProcessorGraphNode - Time taken to run processor: 'class org.mapfish.print.processor.jasper.JasperReportBuilder' was 6834 ms
30-Jun-2021 11:00:05.614 INFO [ForkJoinPool-1-worker-229] org.geotools.image.ImageWorker.<clinit> Warp/affine reduction enabled: true
11:00:09.313 [ForkJoinPool-1-worker-115] INFO  o.m.p.processor.ProcessorGraphNode - Time taken to run processor: 'class org.mapfish.print.processor.map.CreateMapProcessor' was 11839 ms
11:00:09.924 [ForkJoinPool-1-worker-115] INFO  o.m.p.processor.ProcessorGraphNode - Time taken to run processor: 'class org.mapfish.print.processor.map.scalebar.CreateScalebarProcessor' was 609 ms
11:00:10.010 [ForkJoinPool-1-worker-229] INFO  o.m.p.processor.ProcessorGraphNode - Time taken to run processor: 'class org.mapfish.print.processor.map.CreateNorthArrowProcessor' was 695 ms
11:00:10.014 [PrintJobManager-1] INFO  o.mapfish.print.output.ValuesLogger - This log message details the parameters available for use in the Jasper templates for
  Mapfish Template: A4 landscape
  Jasper Template name: A4-landscape.jrxml
  The following parameters are available for use in the templates: 
    * template (org.mapfish.print.config.Template)
    * layerGraphics (java.util.ArrayList)
    * mapSubReport (java.lang.String)
    * scalebarSubReport (java.lang.String)
    * northArrowSubReport (java.lang.String)
    * values (org.mapfish.print.output.Values)
    * REPORT_LOCALE (java.util.Locale)
    * SUBREPORT_DIR (java.lang.String)
    * overlayLayers (org.mapfish.print.attribute.map.StaticLayersAttribute$StaticLayersAttributeValue)
    * northArrow (org.mapfish.print.attribute.NorthArrowAttribute$NorthArrowAttributeValues)
    * jobId (java.lang.String)
    * pdfConfig (org.mapfish.print.config.PDFConfig)
    * requestHeaders (org.mapfish.print.attribute.HttpRequestHeadersAttribute$Value)
    * mapContext (org.mapfish.print.attribute.map.MapfishMapContext)
    * scalebarGraphic (java.lang.String)
    * clientHttpRequestFactoryProvider (org.mapfish.print.processor.http.MfClientHttpRequestFactoryProvider)
    * tempTaskDirectory (java.io.File)
    * map (org.mapfish.print.attribute.map.MapAttribute$MapAttributeValues)
    * northArrowGraphic (java.lang.String)
    * scalebar (org.mapfish.print.attribute.ScalebarAttribute$ScalebarAttributeValues)

11:00:10.065 [http-nio-8080-exec-2] WARN  o.m.print.servlet.BaseMapServlet - Error while processing request: Report has not yet completed processing
11:00:15.365 [PrintJobManager-1] INFO  o.mapfish.print.servlet.job.PrintJob - Successfully completed print job 73c6b724-b055-4895-b39a-9c924024d638@f983ae99-47e1-4c81-aad2-40dadbcaea9a
11:01:37.602 [http-nio-8080-exec-7] INFO  o.m.p.s.j.impl.ThreadPoolJobManager - Submitted print job 7b76ff0a-84e1-435f-8707-3b85e19a2a03@f983ae99-47e1-4c81-aad2-40dadbcaea9a
11:01:37.608 [PrintJobManager-2] INFO  o.mapfish.print.servlet.job.PrintJob - Starting print job 7b76ff0a-84e1-435f-8707-3b85e19a2a03@f983ae99-47e1-4c81-aad2-40dadbcaea9a
11:01:38.172 [ForkJoinPool-1-worker-173] INFO  o.m.p.processor.ProcessorGraphNode - Time taken to run processor: 'class org.mapfish.print.processor.jasper.JasperReportBuilder' was 14 ms
11:01:38.184 [ForkJoinPool-1-worker-229] INFO  o.m.p.processor.ProcessorGraphNode - Time taken to run processor: 'class org.mapfish.print.processor.map.AddStaticLayersProcessor' was 41 ms
11:01:45.998 [ForkJoinPool-1-worker-229] INFO  o.m.p.processor.ProcessorGraphNode - Time taken to run processor: 'class org.mapfish.print.processor.map.CreateMapProcessor' was 7814 ms
11:01:46.237 [ForkJoinPool-1-worker-229] INFO  o.m.p.processor.ProcessorGraphNode - Time taken to run processor: 'class org.mapfish.print.processor.map.scalebar.CreateScalebarProcessor' was 237 ms
11:01:46.271 [ForkJoinPool-1-worker-173] INFO  o.m.p.processor.ProcessorGraphNode - Time taken to run processor: 'class org.mapfish.print.processor.map.CreateNorthArrowProcessor' was 261 ms
11:01:46.273 [PrintJobManager-2] INFO  o.mapfish.print.output.ValuesLogger - This log message details the parameters available for use in the Jasper templates for
  Mapfish Template: A4 landscape
  Jasper Template name: A4-landscape.jrxml
  The following parameters are available for use in the templates: 
    * template (org.mapfish.print.config.Template)
    * layerGraphics (java.util.ArrayList)
    * mapSubReport (java.lang.String)
    * scalebarSubReport (java.lang.String)
    * northArrowSubReport (java.lang.String)
    * values (org.mapfish.print.output.Values)
    * REPORT_LOCALE (java.util.Locale)
    * SUBREPORT_DIR (java.lang.String)
    * overlayLayers (org.mapfish.print.attribute.map.StaticLayersAttribute$StaticLayersAttributeValue)
    * northArrow (org.mapfish.print.attribute.NorthArrowAttribute$NorthArrowAttributeValues)
    * jobId (java.lang.String)
    * pdfConfig (org.mapfish.print.config.PDFConfig)
    * requestHeaders (org.mapfish.print.attribute.HttpRequestHeadersAttribute$Value)
    * mapContext (org.mapfish.print.attribute.map.MapfishMapContext)
    * scalebarGraphic (java.lang.String)
    * clientHttpRequestFactoryProvider (org.mapfish.print.processor.http.MfClientHttpRequestFactoryProvider)
    * tempTaskDirectory (java.io.File)
    * map (org.mapfish.print.attribute.map.MapAttribute$MapAttributeValues)
    * northArrowGraphic (java.lang.String)
    * scalebar (org.mapfish.print.attribute.ScalebarAttribute$ScalebarAttributeValues)

11:01:48.319 [PrintJobManager-2] INFO  o.mapfish.print.servlet.job.PrintJob - Successfully completed print job 7b76ff0a-84e1-435f-8707-3b85e19a2a03@f983ae99-47e1-4c81-aad2-40dadbcaea9a

Expected results

Expected similar results to the OSM tile version: https://www.dropbox.com/s/e4txvr4k994tu6k/nztopomap-print%20%2820%29.pdf?dl=0

gavinharriss commented 3 years ago

It seems that the matrices topLeftCorner x and y values needed reversing in my JSON requests.

So instead of:

"topLeftCorner": [ 10000000.0, -1000000.0 ]

using the following worked:

"topLeftCorner": [ -1000000.0, 10000000.0 ]

I'm not sure if this is an issue with MapFish Print 3 (southern hemisphere vs. northern hemisphere values?) or the capabilities reported by the LINZ service. I suspect it's a bug in MapFish Print 3 as QGIS has no issues consuming the WMTS layer.

jwkaltz commented 3 years ago

Hi @gavinharriss, thanks the detailed report. Regarding what you have described, if no other user has already encountered this and can provide an answer here, please note that the maintainers of MapFish Print would welcome any pull request addressing the issue. Alternatively, you can contact a professional services company to assist you, please see the README of the project for that.

gavinharriss commented 3 years ago

@jwkaltz no problem, the reversing of the topLeftCorner x & y values is a work-around for me but I figured it was worth sharing the solution in case others encounter the same issue. Unfortunately my Java dev skills are out of date by a decade, but I may have to dust them off as there's a few enhancements I'd like e.g. magnetic north compass based on WMM2020.