[Geoserver-users] Intermittent WFS Exception

Hi

I’m suddenly getting an intermittent WFS error from Geoserver. WFS requests will work fine for a while and then seemingly without reason start returning a NullPointerException. If I log in to Geoserver and make a GetFeature request from the demo console that request works and that seems to fix the problem and all WFS will work until it breaks again. The demo request always fixes the problem.

I am using Geoserver 2.5.2 deployed through Tomcat. I have tried deploying a separate instance of Geoserver (2.4.7) and if I point it at the same data dir it has the same error but using a separate data dir the WFS request will work.

So I’m guessing it’s an issue with the data but I can’t imagine what. It affects any WFS requests and it doesn’t seem to be a request to a particular layer that triggers the problem.

Any ideas on what might be happening would be greatly appreciated. Below is a sample request and the exception that is returned.

Thanks

Tom

Sample request:

<wfs:GetFeature xmlns:wfs=“http://www.opengis.net/wfs” service=“WFS” version=“1.0.0” xsi:schemaLocation=“http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”>

<wfs:Query typeName=“feature:web_walks2” xmlns:feature=“http://www.npt.gov.uk”></wfs:Query>

</wfs:GetFeature>

Error response:

java.lang.NullPointerException null

Hi,
could you please share the full stack trace? You can find it in the
GeoServer logs (accessible from the UI, if you don’t have direct
access to the file system)

Cheers
Andrea

···

On Fri, Aug 15, 2014 at 2:53 PM, Thomas Colley <t.colley@anonymised.com> wrote:

Hi

I’m suddenly getting an intermittent WFS error from Geoserver. WFS requests will work fine for a while and then seemingly without reason start returning a NullPointerException. If I log in to Geoserver and make a GetFeature request from the demo console that request works and that seems to fix the problem and all WFS will work until it breaks again. The demo request always fixes the problem.

I am using Geoserver 2.5.2 deployed through Tomcat. I have tried deploying a separate instance of Geoserver (2.4.7) and if I point it at the same data dir it has the same error but using a separate data dir the WFS request will work.

So I’m guessing it’s an issue with the data but I can’t imagine what. It affects any WFS requests and it doesn’t seem to be a request to a particular layer that triggers the problem.

Any ideas on what might be happening would be greatly appreciated. Below is a sample request and the exception that is returned.

Thanks

Tom

Sample request:

<wfs:GetFeature xmlns:wfs=“http://www.opengis.net/wfs” service=“WFS” version=“1.0.0” xsi:schemaLocation=“http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”>

<wfs:Query typeName=“feature:web_walks2” xmlns:feature=“http://www.npt.gov.uk”></wfs:Query>

</wfs:GetFeature>

Error response:

java.lang.NullPointerException null



Geoserver-users mailing list
Geoserver-users@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

==

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 for the Andrea,

I’ve changed the URI of the workspace namespace, is that enough to pull it back in synch or would I need to edit the catalog directly?

It was confusing me because the problem was intermittent. I thought if something had corrupted in the data dir it would just not work at all.

Cheers

Tom

From: andrea.aime@…84… [mailto:andrea.aime@…84…] On Behalf Of Andrea Aime
Sent: 15 August 2014 15:21
To: Thomas Colley; geoserver-user@lists.sourceforge.net
Subject: Re: [Geoserver-users] Intermittent WFS Exception

On Fri, Aug 15, 2014 at 3:46 PM, Thomas Colley <t.colley@…5248…> wrote:

2014-08-15 14:38:22,881 ERROR [geoserver.ows] -

java.lang.NullPointerException

at org.geoserver.wfs.xml.FeatureTypeSchemaBuilder.buildSchemaInternal(FeatureTypeSchemaBuilder.java:192)

at org.geoserver.wfs.xml.FeatureTypeSchemaBuilder.addApplicationTypes(FeatureTypeSchemaBuilder.java:487)

Hmm… it would seem there is something wrong with the workspace/namespace configuration?

The code balks here:

String targetPrefix = (String) ns2featureTypeInfos.keySet().iterator().next();

String targetNamespace = catalog.getNamespaceByPrefix(targetPrefix).getURI(); ← here

Which means that somehow it’s not able to find the namespace associated to the specified workspace

(the target prefix is the workspace name).

The data dir that makes it fail has likely a workspace.xml/namespace.xml that have gone out of synch

with each other.

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


On Mon, Aug 18, 2014 at 9:35 AM, Thomas Colley <
t.colley@anonymised.com> wrote:

Thanks for the Andrea,

I’ve changed the URI of the workspace namespace, is that enough to pull it
back in synch or would I need to edit the catalog directly?

Eh, I don't know, you'll have to try and see.

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

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

Hi Andrea

I still haven’t managed to get around this WFS problem.

I tried altering the Namespace URI, hoping that might pull them back in synch.

That didn’t work so I tried creating a completely new Workspace. Then I moved all of the datastore folders out of the old workspace and into the new one and did a global replace on the Workspace/Namespace references in all the XMLs but I’m still getting the same problem.

If you have any ideas what I could try as a next step I’d be very grateful.

Thanks

Tom

From: andrea.aime@…84… [mailto:andrea.aime@…84…] On Behalf Of Andrea Aime
Sent: 18 August 2014 08:38
To: Thomas Colley
Cc: GeoServer Mailing List List
Subject: Re: [Geoserver-users] Intermittent WFS Exception

On Mon, Aug 18, 2014 at 9:35 AM, Thomas Colley <t.colley@…5248…> wrote:

Thanks for the Andrea,

I’ve changed the URI of the workspace namespace, is that enough to pull it back in synch or would I need to edit the catalog directly?

Eh, I don’t know, you’ll have to try and see.

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