[Geoserver-users] Geoserver 2.5.4 getFeatureInfo template processing error intermittently for specific templates

Hi,

I posted this on gis.stackexchange too but it vanished from the main page
with no reply rather quickly and I think perhaps a geoserver audience is the
better place for it, but if I'm causing grievance then do tell.

*Issue*: When two polygon layers are shown in a webmap and a getfeatureinfo
is sent for a spot where both layers have a feature, a freemarker.runtime
template processing error often occurs for either layer's content ftl,
resulting in only one layer's info being shown in the info popup.

*Setup:* PostGIS -> Geoserver 2.5.4, WMS 1.1.1 (Jetty9, Windows Server 2008
r2, 64bit jdk 8 so no native jai, have noticed no significant slowdown with
marlin helping)

The problem areas of the two content.ftls are in their beginning:
/<#list features as feature>
    
      LocalID: ${feature.LocalID.value}/
...and:
/
<#list features as feature>
Link to designation
<\documents\pdf\designations\${feature.designation.value?replace(>
/

When a point in the web map is clicked a
http://server/geoserver/workspace/wms?SERVICE=WMS&LAYERS=layer&QUERY_LAYERS=layer&STYLES=&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&BBOX=bbox&FEATURE_COUNT=10&HEIGHT=620&WIDTH=1346&FORMAT=image%2Fpng&INFO_FORMAT=text%2Fhtml&SRS=EPSG%3A3006&X=600&Y=403

request is sent for each visible layer with a feature on the spot.

When the issue manifests the log says:
/ERROR [freemarker.runtime] - Template processing error: "Expression
feature.designation is undefined on line 13, column 67 in content.ftl/

..and it is only undefined sometimes and only when trying to fetch info for
both layers and not in QGIS 2.8.1 even if HTML output is chosen and the
templating engine obviously engages there too.

Does anyone have an idea what might need fixing? Am currently thinking
webmap client, geoserver version, or that it somehow is a network timings
issue. Any suggestions are welcome : )

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Geoserver-2-5-4-getFeatureInfo-template-processing-error-intermittently-for-specific-templates-tp5228955.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Sorry for half the post being in italics, previewing does not appear to work
well in firefox 40.

The first content.ftl was supposed to be:

<#list features as feature>
LocalID: ${feature.LocalID.value} ..

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Geoserver-2-5-4-getFeatureInfo-template-processing-error-intermittently-for-specific-templates-tp5228955p5228957.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Hallo.

Have done some tests and found a few things. The issue is that two
simultaneous getfeatureinfo requests, to two different layers - one each,
with content.ftls that extracts an attribute value like so:
<ul>
<#list features as feature>
<li>
${feature.type.title}

${feature.KNNAMN.value}

<ul>

- one content.ftl per layer, requesting feature attributes of different
names - will have one request fail because Geoserver applies the same
content.ftl to both layers and as such can't find the field name to extract
a value from for one of the requests.

It happens for some layers regardless of Geoserver version, OS version /
type, java version, shape or Postgis table / view, heavy geometry, weird
characters in attribute table.

http://www.arcgis.com/home/item.html?id=41f5d23fef8f410590f2d934c7dba81a#!
and
http://www.arcgis.com/home/item.html?id=912b806e3b864b5f83596575a2f7cb01#!
appear affected.

The issue has to do with Getfeatureinfo 1.1.1 and only when requesting
Freemarker transformation = feature.value, i.e text/html . GML or text
replies have no issues.

I tried replacing the freemarker libs in geoservers /lib/ but it didn't make
a difference regarding this.

If anyone has any suggestions I would be very grateful.

Thanks for reading,
David

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Geoserver-2-5-4-getFeatureInfo-template-processing-error-intermittently-for-specific-templates-tp5228955p5252902.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Hi David,
you should run tests against GeoServer 2.8, version 2.5 has been out of
support for a while (2.7 just had its last release, even if not yet announced,
2.8 is about to get into bug fix only mode)

Cheers
Andrea

···

On Thu, Feb 25, 2016 at 6:55 PM, David I <perssond9@anonymised.com> wrote:

Hallo.

Have done some tests and found a few things. The issue is that two
simultaneous getfeatureinfo requests, to two different layers - one each,
with content.ftls that extracts an attribute value like so:

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

Ing. Andrea Aime

@geowolf
Technical Lead

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

fax: +39 0584 1660272
mob: +39 339 8844549

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.


Hi Andrea, many thanks for your reply.

Mysticism abounds , in that I have tried various versions above 2.5.4,
certainly 2.5.5 and an early 2.7 and I think (shall verify) 2.8 on an ubuntu
server.

Right now though I replaced 2.5.5 with 2.8.2 and then republished the
original two problematic layers, using the production db and a copy of the
production ftls- and the gfi popup showed both links 5/5 times. Replaced
2.8.2 with 2.5.5 again, kept the published layers, gfi popup behaved as
prior - i.e showed both links 1/5 times. More tests will be needed but you
may have just saved us with 2.8.2; I'll report back when a definitive answe
has been had.

Regards,
David

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Geoserver-2-5-4-getFeatureInfo-template-processing-error-intermittently-for-specific-templates-tp5228955p5253662.html
Sent from the GeoServer - User mailing list archive at Nabble.com.