[Geoserver-users] WFS: XML Parsing Error

Hello everybody,

I have a problem with an exposed layer in geoserver 2.3.2 (deployed from war file).

I upload a layer before as shp file (in a SHP datastore), then as postgis table (in postgis datastore).
I’m able to see the wms as openlayer (from layer preview) but not as gml.
In both cases I got the error:

XML Parsing Error: not well-formed

How can I check the layer?
I guess my problem could be in the origin SHP file, but checking the geometry in QGis, I had not found errors.

Could someone suggest me which kind of control may I do?

Kind regards

Eugenio

On Mon, Jul 21, 2014 at 3:25 PM, Eugenio Trumpy <frippe12573@anonymised.com>
wrote:

Hello everybody,

I have a problem with an exposed layer in geoserver 2.3.2 (deployed from
war file).

I upload a layer before as shp file (in a SHP datastore), then as postgis
table (in postgis datastore).
I'm able to see the wms as openlayer (from layer preview) but not as gml.
In both cases I got the error:

XML Parsing Error: not well-formed

How can I check the layer?
I guess my problem could be in the origin SHP file, but checking the
geometry in QGis, I had not found errors.

Could someone suggest me which kind of control may I do?

Version 2.3.x is out of support, any chance you can upgrade to 2.5.x?

Anyways, it may be interesting to see the generated GML, maybe the encoder
is failing
mid way on a specific feature in your dataset.
Try to save the output instead of viewing it in the browser.

Cheers
Andrea

--

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

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

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

-------------------------------------------------------

Thank you Andrea for the answer,
of course I can move to 2.5.x I don’t know how long does it take, and if the migration
is soft or hard. If I have to deploy the new version only repointing the data_dir
I can do it in a while.

I wondering if it does solve my problem.
However put the gml output here in attach.

Hope it could help.

regards

Eugenio


Date: Mon, 21 Jul 2014 15:38:10 +0200
Subject: Re: [Geoserver-users] WFS: XML Parsing Error
From: andrea.aime@anonymised.com
To: frippe12573@anonymised.com
CC: geoserver-users@lists.sourceforge.net

On Mon, Jul 21, 2014 at 3:25 PM, Eugenio Trumpy <frippe12573@anonymised.com…> wrote:

Hello everybody,

I have a problem with an exposed layer in geoserver 2.3.2 (deployed from war file).

I upload a layer before as shp file (in a SHP datastore), then as postgis table (in postgis datastore).
I’m able to see the wms as openlayer (from layer preview) but not as gml.
In both cases I got the error:

XML Parsing Error: not well-formed

How can I check the layer?
I guess my problem could be in the origin SHP file, but checking the geometry in QGis, I had not found errors.

Could someone suggest me which kind of control may I do?

Version 2.3.x is out of support, any chance you can upgrade to 2.5.x?

Anyways, it may be interesting to see the generated GML, maybe the encoder is failing
mid way on a specific feature in your dataset.
Try to save the output instead of viewing it in the browser.

Cheers
Andrea

==

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

==

Ing. Andrea Aime

@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

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


geoserver-GetFeature.text (735 KB)

On Mon, Jul 21, 2014 at 3:47 PM, Eugenio Trumpy <frippe12573@anonymised.com>
wrote:

Thank you Andrea for the answer,
of course I can move to 2.5.x I don't know how long does it take, and if
the migration
is soft or hard. If I have to deploy the new version only repointing the
data_dir
I can do it in a while.

I wondering if it does solve my problem.
However put the gml output here in attach.

Ah ok, found the reason, you are using attribute names that make the xml
invalid:

<IGG:name>France</IGG:name>
      <IGG:area>5.48780908430388E11</IGG:area>
      <IGG:1990_mwe>4.2</IGG:1990_mwe>
      <IGG:1995_mwt>599.0</IGG:1995_mwt>
      <IGG:1995_h_tjy>7350.0</IGG:1995_h_tjy>
      <IGG:1995_mwe>4.2</IGG:1995_mwe>
      <IGG:2000_mwt>326.0</IGG:2000_mwt>
      <IGG:2000_h_tjy>4895.0</IGG:2000_h_tjy>
      <IGG:2000_mwe>4.2</IGG:2000_mwe>
      <IGG:2005_mwt>308.0</IGG:2005_mwt>
      <IGG:2005_h_tjy>5195.7</IGG:2005_h_tjy>
      <IGG:2005_mwe>15.0</IGG:2005_mwe>
      <IGG:2010_mwt>1345.0</IGG:2010_mwt>
      <IGG:2010_h_tjy>12929.0</IGG:2010_h_tjy>
      <IGG:2010_mwe>16.0</IGG:2010_mwe>
      <IGG:2013_mwe>17.0</IGG:2013_mwe>

An attribute name in xml cannot start with a number. It is your
responsibility
to ensure that, you'll have to either modify your source data, or if you
are working
against a database, use a sql view to rename the fields starting with a
number

Cheers
Andrea

--

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

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

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

-------------------------------------------------------

Thanks a lot Andrea,
I provide the correct name.

Regards

E.


Date: Mon, 21 Jul 2014 15:54:49 +0200
Subject: Re: [Geoserver-users] WFS: XML Parsing Error
From: andrea.aime@anonymised.com
To: frippe12573@anonymised.com
CC: geoserver-users@lists.sourceforge.net

On Mon, Jul 21, 2014 at 3:47 PM, Eugenio Trumpy <frippe12573@anonymised.com> wrote:

Thank you Andrea for the answer,
of course I can move to 2.5.x I don’t know how long does it take, and if the migration
is soft or hard. If I have to deploy the new version only repointing the data_dir
I can do it in a while.

I wondering if it does solve my problem.
However put the gml output here in attach.

Ah ok, found the reason, you are using attribute names that make the xml invalid:

IGG:nameFrance</IGG:name>
IGG:area5.48780908430388E11</IGG:area>
IGG:1990_mwe4.2</IGG:1990_mwe>
IGG:1995_mwt599.0</IGG:1995_mwt>
IGG:1995_h_tjy7350.0</IGG:1995_h_tjy>
IGG:1995_mwe4.2</IGG:1995_mwe>
IGG:2000_mwt326.0</IGG:2000_mwt>
IGG:2000_h_tjy4895.0</IGG:2000_h_tjy>
IGG:2000_mwe4.2</IGG:2000_mwe>
IGG:2005_mwt308.0</IGG:2005_mwt>
IGG:2005_h_tjy5195.7</IGG:2005_h_tjy>
IGG:2005_mwe15.0</IGG:2005_mwe>
IGG:2010_mwt1345.0</IGG:2010_mwt>
IGG:2010_h_tjy12929.0</IGG:2010_h_tjy>
IGG:2010_mwe16.0</IGG:2010_mwe>
IGG:2013_mwe17.0</IGG:2013_mwe>

An attribute name in xml cannot start with a number. It is your responsibility
to ensure that, you’ll have to either modify your source data, or if you are working
against a database, use a sql view to rename the fields starting with a number

Cheers
Andrea

==

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

==

Ing. Andrea Aime

@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

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