[Geoserver-devel] Geoserver print module issue with WMS layers

Hello everyone,

I searched for many hours for my issue, I hope I'll get some answers here.

The context : I installed Geoserver (2.11.1) and configured some layers
coming from stores "Oracle NG" and "WMS". I also installed the print module
"Mapfish" to be able to send print request from a web application to
generate map reports.

After many searches, I can now configure well the "config.yaml" file to
configure the print layouts, and I understand how works the GET and POST
http print requests and parameters.

Here is my issue : the print request work well with layers coming from
"Oracle NG" store, but not the ones from the "WMS" store. When I download
the generated PDF, I get my report with a blank map and an exception message
in a little yellow box near the map area : "java.io.IOException: The byte
array is not a recognized imageformat."

<http://osgeo-org.1560.x6.nabble.com/file/t370398/mapfish_print_error_1.png&gt;
<http://osgeo-org.1560.x6.nabble.com/file/t370398/mapfish_print_error_2.png&gt;

Here is a working request :
http://localhost:9100/geoserver/pdf/print.pdf?spec=\{outputFilename:&#39;print\-$\{yyyyMMddHHmmss\}&#39;,layout:&#39;MY\_MAP\_LAYOUT&#39;,pages:\[\{center:\[88861\.938477485,100786\.976035025\],scale:10000,rotation:0\}],dpi:75,units:'m',srs:'EPSG:2169',layers:[{baseURL:'http://localhost:9100/geoserver/wms’,type:'WMS’,layers:['WS:ORACLE_LAYER'],format:'image/png'}]}

Here is a NOT working request :
http://localhost:9100/geoserver/pdf/print.pdf?spec=\{outputFilename:&#39;print\-$\{yyyyMMddHHmmss\}&#39;,layout:&#39;MY\_MAP\_LAYOUT&#39;,pages:\[\{center:\[88861\.938477485,100786\.976035025\],scale:10000,rotation:0\}],dpi:75,units:'m',srs:'EPSG:2169',layers:[{baseURL:'http://localhost:9100/geoserver/wms’,type:'WMS’,layers:['WS:WMS_LAYER'],format:'image/png'}]}

Only the layer asked changes in the parameters.

The only thing I found for now is about authentification issue on WMS
layers, but my WMS layers don't have any authentification, they can be
reached as it.

Is anyone here already had this issue ? Or have an explanation on what I'm
doing wrong ?
Any help will be really appreciated !

--
Sent from: http://osgeo-org.1560.x6.nabble.com/GeoServer-Dev-f3819232.html

Hi,
this is usually a symptom of the request for getting the map image failing (it returns an XML instead of an image). You should have a look at GeoServer log files to understand if you can get the real exception. If you send me the log file of GeoServer immediately after a failing print I can try to help you.

Mauro

···

2017-12-06 16:12 GMT+01:00 jcb81 <jcbastin@anonymised.com>:

Hello everyone,

I searched for many hours for my issue, I hope I’ll get some answers here.

The context : I installed Geoserver (2.11.1) and configured some layers
coming from stores “Oracle NG” and “WMS”. I also installed the print module
“Mapfish” to be able to send print request from a web application to
generate map reports.

After many searches, I can now configure well the “config.yaml” file to
configure the print layouts, and I understand how works the GET and POST
http print requests and parameters.

Here is my issue : the print request work well with layers coming from
“Oracle NG” store, but not the ones from the “WMS” store. When I download
the generated PDF, I get my report with a blank map and an exception message
in a little yellow box near the map area : “java.io.IOException: The byte
array is not a recognized imageformat.”

<http://osgeo-org.1560.x6.nabble.com/file/t370398/mapfish_print_error_1.png>
<http://osgeo-org.1560.x6.nabble.com/file/t370398/mapfish_print_error_2.png>

Here is a working request :
http://localhost:9100/geoserver/pdf/print.pdf?spec={outputFilename:'print-${yyyyMMddHHmmss}',layout:‘MY_MAP_LAYOUT’,pages:[{center:[88861.938477485,100786.976035025],scale:10000,rotation:0}],dpi:75,units:‘m’,srs:‘EPSG:2169’,layers:[{baseURL:‘http://localhost:9100/geoserver/wms’,type:‘WMS’,layers:[‘WS:ORACLE_LAYER’],format:‘image/png’}]}

Here is a NOT working request :
http://localhost:9100/geoserver/pdf/print.pdf?spec={outputFilename:'print-${yyyyMMddHHmmss}',layout:‘MY_MAP_LAYOUT’,pages:[{center:[88861.938477485,100786.976035025],scale:10000,rotation:0}],dpi:75,units:‘m’,srs:‘EPSG:2169’,layers:[{baseURL:‘http://localhost:9100/geoserver/wms’,type:‘WMS’,layers:[‘WS:WMS_LAYER’],format:‘image/png’}]}

Only the layer asked changes in the parameters.

The only thing I found for now is about authentification issue on WMS
layers, but my WMS layers don’t have any authentification, they can be
reached as it.

Is anyone here already had this issue ? Or have an explanation on what I’m
doing wrong ?
Any help will be really appreciated !


Sent from: http://osgeo-org.1560.x6.nabble.com/GeoServer-Dev-f3819232.html


Check out the vibrant tech community on one of the world’s most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot


Geoserver-devel mailing list
Geoserver-devel@anonymised.com.366…sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Regards,

Mauro Bartolomeoli

==
GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information.

Dott. Mauro Bartolomeoli
@mauro_bart
Technical Lead

GeoSolutions S.A.S.
Via di Montramito 3/A
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272

http://www.geo-solutions.it
http://twitter.com/geosolutions_it


AVVERTENZE AI SENSI DEL D.Lgs. 196/2003

Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora riceviate questo messaggio senza esserne il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse, costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for the attention and use of the named addressee(s) and may be confidential or proprietary in nature or covered by the provisions of privacy act (Legislative Decree June, 30 2003, no.196 - Italy’s New Data Protection Code).Any use not in accord with its purpose, any disclosure, reproduction, copying, distribution, or either dissemination, either whole or partial, is strictly forbidden except previous formal approval of the named addressee(s). If you are not the intended recipient, please contact immediately the sender by telephone, fax or e-mail and delete the information in this message that has been received in error. The sender does not give any warranty or accept liability as the content, accuracy or completeness of sent messages and accepts no responsibility for changes made after they were sent or for other risks which arise as a result of e-mail transmission, viruses, etc.

Hello Mauro,

Thank you for your answer.

I did a fresh log just for my print request. Here it is in attachment.

Regards,

JCB

(attachments)

wrapper.log (78.9 KB)

···

Le 06/12/2017 à 16:25, Mauro Bartolomeoli a écrit :

Hi,
this is usually a symptom of the request for getting the map image failing (it returns an XML instead of an image). You should have a look at GeoServer log files to understand if you can get the real exception. If you send me the log file of GeoServer immediately after a failing print I can try to help you.

Mauro

2017-12-06 16:12 GMT+01:00 jcb81 <jcbastin@…4838…>:

Hello everyone,

I searched for many hours for my issue, I hope I’ll get some answers here.

The context : I installed Geoserver (2.11.1) and configured some layers
coming from stores “Oracle NG” and “WMS”. I also installed the print module
“Mapfish” to be able to send print request from a web application to
generate map reports.

After many searches, I can now configure well the “config.yaml” file to
configure the print layouts, and I understand how works the GET and POST
http print requests and parameters.

Here is my issue : the print request work well with layers coming from
“Oracle NG” store, but not the ones from the “WMS” store. When I download
the generated PDF, I get my report with a blank map and an exception message
in a little yellow box near the map area : “java.io.IOException: The byte
array is not a recognized imageformat.”

<http://osgeo-org.1560.x6.nabble.com/file/t370398/mapfish_print_error_1.png>
<http://osgeo-org.1560.x6.nabble.com/file/t370398/mapfish_print_error_2.png>

Here is a working request :
http://localhost:9100/geoserver/pdf/print.pdf?spec={outputFilename:'print-${yyyyMMddHHmmss}',layout:‘MY_MAP_LAYOUT’,pages:[{center:[88861.938477485,100786.976035025],scale:10000,rotation:0}],dpi:75,units:‘m’,srs:‘EPSG:2169’,layers:[{baseURL:‘http://localhost:9100/geoserver/wms’,type:‘WMS’,layers:[‘WS:ORACLE_LAYER’],format:‘image/png’}]}

Here is a NOT working request :
http://localhost:9100/geoserver/pdf/print.pdf?spec={outputFilename:'print-${yyyyMMddHHmmss}',layout:‘MY_MAP_LAYOUT’,pages:[{center:[88861.938477485,100786.976035025],scale:10000,rotation:0}],dpi:75,units:‘m’,srs:‘EPSG:2169’,layers:[{baseURL:‘http://localhost:9100/geoserver/wms’,type:‘WMS’,layers:[‘WS:WMS_LAYER’],format:‘image/png’}]}

Only the layer asked changes in the parameters.

The only thing I found for now is about authentification issue on WMS
layers, but my WMS layers don’t have any authentification, they can be
reached as it.

Is anyone here already had this issue ? Or have an explanation on what I’m
doing wrong ?
Any help will be really appreciated !


Sent from: http://osgeo-org.1560.x6.nabble.com/GeoServer-Dev-f3819232.html


Check out the vibrant tech community on one of the world’s most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot


Geoserver-devel mailing list
Geoserver-devel@…366…sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Regards,

Mauro Bartolomeoli

== GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information. == Dott. Mauro Bartolomeoli @mauro_bart Technical Lead GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa (LU) Italy phone: +39 0584 962313 fax: +39 0584 1660272 http://www.geo-solutions.it http://twitter.com/geosolutions_it -------------------------------------------------------

AVVERTENZE AI SENSI DEL D.Lgs. 196/2003

Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora riceviate questo messaggio senza esserne il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse, costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for the attention and use of the named addressee(s) and may be confidential or proprietary in nature or covered by the provisions of privacy act (Legislative Decree June, 30 2003, no.196 - Italy’s New Data Protection Code).Any use not in accord with its purpose, any disclosure, reproduction, copying, distribution, or either dissemination, either whole or partial, is strictly forbidden except previous formal approval of the named addressee(s). If you are not the intended recipient, please contact immediately the sender by telephone, fax or e-mail and delete the information in this message that has been received in error. The sender does not give any warranty or accept liability as the content, accuracy or completeness of sent messages and accepts no responsibility for changes made after they were sent or for other risks which arise as a result of e-mail transmission, viruses, etc.

Hello again.

First, I would like to thank Mauro that helped me to solve my issue.

Then, I would like to share a summary of the explanation.

So, my generated PDF from Mapfish print module of Geoserver gave me an error
like "java.io.IOException: The byte array is not a recognized imageformat.".
It was because the response from the http request was not an image, but an
XML response as Mauro mentionned.
To have the details, you have to go to the log file of Geoserver :
{GeoServer directory}\logs\wrapper.log
In the logs, I had more details of the called request and what was wrong. In
my case, it was "WMS server error. Image size out of range, WIDTH and HEIGHT
must be between 1 and 2048 pixels". The external WMS that I was calling was
coming from MapServer. I edited the map file an set the MAXSIZE parameter at
4096. Then, the error disapperead.

--
Sent from: http://osgeo-org.1560.x6.nabble.com/GeoServer-Dev-f3819232.html