2

I am trying to set up a template in jasper reports to send to MapFish print. I am specifying the map layers in the requestData.json file. I am testing with a single layer, and have tried map services both inside and outside of my network. No matter what services I try to load, I keep getting this error:

Exception in thread "main" java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: java.lang.IllegalArgumentException:

followed by the service call, in this case it is:

Exception in thread "main" java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: https://www.fws.gov/wetlands/arcgis/services/Wetlands/MapServer/WMSServer?SERVICE=WMS&LAYERS=1&FORMAT=image%2Fpng&HEIGHT=683&REQUEST=GetMap&WIDTH=749&BBOX=-97.85928104890104,39.068060413061325,-97.55349673109896,39.28509312021114&STYLES=&SRS=EPSG:4326&VERSION=1.1.1 is denied.

I have started with the json and yaml files for the verbose example given in the MapFish git hub page https://github.com/mapfish/mapfish-print/tree/master/examples/src/test/resources/examples/verboseExample. Here is my requestData.json:

{
  "layout": "11x17 landscape",
  "outputFormat": "pdf",
  "attributes": {
    "number": 45,
    "length": 45.123,
    "table": {
      "columns": ["id", "name", "icon"],
      "data": [
        [1, "blah", "icon_pan"],
        [2, "blip", "icon_zoomin"]
      ]
    },
    "datasource": [
      {
        "displayName": "Feature 1",
        "table" : {
          "columns": ["id", "name", "icon"],
          "data": [
            [1, "blah", "icon_pan"],
            [2, "blip", "icon_zoomin"]
          ]
        }
      },
      {
        "displayName": "Feature 2",
        "table": {
          "columns": ["id", "name", "icon"],
          "data": [
            [10, "blah2", "icon_pan2"],
            [20, "blip2", "icon_zoomin2"]
          ]
        }
      }
    ],
    "legend": {
      "name": "",
       "classes": [{
        "name": "Arbres",
        "icons": ["http://localhost:8080/examples/data/www/legends/arbres.png"]
      }, {
        "name": "Peturbations",
        "icons": ["http://localhost:8080/examples/data/www/legends/perturbations.png"]
      }, {
        "name": "Points de vente",
        "icons": ["http://localhost:8080/examples/data/www/legends/points-de-vente.png"]
      }, {
        "name": "Stationement",
        "icons": ["http://localhost:8080/examples/data/www/legends/stationement.png"]
      }]
    },
    "map": {
      "longitudeFirst": true,
      "center": [-97.70638889, 39.17657778],
      "scale": 100000,
      "projection": "EPSG:4326",
      "dpi": 72,
      "rotation": 0,
      "layers": [
      {
        type: "WMS",
        "layers": [1],
        "baseURL":   "https://www.fws.gov/wetlands/arcgis/services/Wetlands/MapServer/WMSServer?",
        "imageFormat": "image/png",
          "customParams": {
          }
        }

      ]
    }
  }
}

and here is my config.yaml:

pdfConfig: !pdfConfig
  compressed: false
  author: "Mapfish Print"
  subject: "Mapfish Print Verbose example"
  creator: "Mapfish Print"

throwErrorOnExtraParameters: true
templates:
  11x17 landscape: !template
    pdfConfig: !pdfConfig
      title: "Verbose 11x17 landscape"
      keywords: ["legend", "table", "tablelist", "map", "verbose"]
    reportTemplate: simpleReport.jrxml
    attributes:
      number: !integer {}
      length: !float {}
      map: !map
        maxDpi: 400
        dpiSuggestions: [72, 91, 128, 254, 300, 400]
        width: 749
        height: 683
      legend: !legend {}
      table: !table {}
      datasource: !datasource
        attributes:
          displayName: !string {}
          table: !table {}
      scalebar: !scalebar
        width: 150
        height: 40
    processors:
    - !restrictUris
      matchers:
        - !localMatch
          port : 8080
          pathRegex : /.+
    - !reportBuilder # compile all reports in current directory
      directory: '.'
    - !createMap {}
    - !createScalebar {}
    - !prepareLegend # create a datasource for the report with the 'legend' attribute
      template: legend.jrxml
    - !prepareTable {}
    - !createDataSource
      reportTemplate: table.jrxml
      reportKey: reportTemplate
      processors:
        - !prepareTable {}
    tableData: jrDataSource

I am using the MapFish command line tool to generate the print file, version 3.18.2. Can anyone help?

0

Your Answer

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

Browse other questions tagged or ask your own question.