[Geoserver-users] WMS GetFeatureInfo: info_format=application/vnd.ogc.gml

Hey folks,

I’m upgrading an application from GeoServer 1.7.x to 2.x, and a WMS
GetFeatureInfo request using info_format=application/vnd.ogc.gml is now
failing with a null pointer error. The request works fine if I change the
info_format to ‘text/plain’. Has the mime string for GML changed, or is
there something else I should know?

Thanks so much, --j


Josh Marcus
Software Engineer

Azavea (formerly Avencia) | T: 215.701.7505 | F: 215.925.2663
www.azavea.com

Josh Marcus ha scritto:

Hey folks,

I'm upgrading an application from GeoServer 1.7.x to 2.x, and a WMS
GetFeatureInfo request using info_format=application/vnd.ogc.gml is now
failing with a null pointer error. The request works fine if I change the
info_format to 'text/plain'. Has the mime string for GML changed, or is
there something else I should know?

Not sure... this one works:

http://demo.opengeo.org/geoserver/wms?REQUEST=GetFeatureInfo&EXCEPTIONS=application%2Fvnd.ogc.se_xml&BBOX=-139.848709%2C18.549282%2C-51.852562%2C55.77842&X=396&Y=222&INFO_FORMAT=application/vnd.ogc.gml&QUERY_LAYERS=topp%3Astates&FEATURE_COUNT=50&Layers=topp%3Astates&Styles=&Srs=EPSG%3A4326&WIDTH=780&HEIGHT=330&format=image%2Fpng

(that demo server is using a recent 2.0.x nightly build though)

If you can still reproduce with a nightly build on your end please
share the full stack trace and possibly also the data and request
so that we can reproduce on our end

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

Thanks for the response.

So, I misunderstood what was going on. Other GML requests are working fine, but the same request for a shapefile layer is working as it should with info_format=text/plain but is giving me a java.lang.NullPointerException when I make the request for GML. Any thoughts on what might be causing the problem?

–j

Here’s the stack trace:

09 Mar 14:36:44 ERROR [geoserver.ows] -
java.lang.NullPointerException
at org.geoserver.wfs.xml.GML2OutputFormat.prepare(GML2OutputFormat.java:150)
at org.geoserver.wfs.xml.GML2OutputFormat.write(GML2OutputFormat.java:283)
at org.geoserver.wfs.WFSGetFeatureOutputFormat.write(WFSGetFeatureOutputFormat.java:137)
at org.vfny.geoserver.wms.responses.featureInfo.GmlFeatureInfoResponse.writeTo(GmlFeatureInfoResponse.java:115)
at org.vfny.geoserver.wms.responses.GetFeatureInfoResponse.writeTo(GetFeatureInfoResponse.java:176)
at org.geoserver.ows.adapters.ResponseAdapter.write(ResponseAdapter.java:60)
at org.geoserver.ows.Dispatcher.response(Dispatcher.java:725)
at org.geoserver.ows.Dispatcher.handleRequestInternal(Dispatcher.java:233)
at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:809)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:501)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.vfny.geoserver.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265)
at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:124)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
at org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:174)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:149)
at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.geoserver.filters.LoggingFilter.doFilter(LoggingFilter.java:73)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.geoserver.filters.ReverseProxyFilter.doFilter(ReverseProxyFilter.java:183)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.geoserver.filters.GZIPFilter.doFilter(GZIPFilter.java:41)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Unknown Source)

On Tue, Mar 9, 2010 at 11:41 AM, Andrea Aime <aaime@anonymised.com1…> wrote:

Josh Marcus ha scritto:

Hey folks,

I’m upgrading an application from GeoServer 1.7.x to 2.x, and a WMS
GetFeatureInfo request using info_format=application/vnd.ogc.gml is now
failing with a null pointer error. The request works fine if I change the
info_format to ‘text/plain’. Has the mime string for GML changed, or is
there something else I should know?

Not sure… this one works:

http://demo.opengeo.org/geoserver/wms?REQUEST=GetFeatureInfo&EXCEPTIONS=application%2Fvnd.ogc.se_xml&BBOX=-139.848709%2C18.549282%2C-51.852562%2C55.77842&X=396&Y=222&INFO_FORMAT=application/vnd.ogc.gml&QUERY_LAYERS=topp%3Astates&FEATURE_COUNT=50&Layers=topp%3Astates&Styles=&Srs=EPSG%3A4326&WIDTH=780&HEIGHT=330&format=image%2Fpng

(that demo server is using a recent 2.0.x nightly build though)

If you can still reproduce with a nightly build on your end please
share the full stack trace and possibly also the data and request
so that we can reproduce on our end

Cheers
Andrea


Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.


Josh Marcus
Software Engineer

Azavea (formerly Avencia) | T: 215.701.7505 | F: 215.925.2663
www.azavea.com

Josh Marcus ha scritto:

Hey folks,

I'm upgrading an application from GeoServer 1.7.x to 2.x, and a WMS
GetFeatureInfo request using info_format=application/vnd.ogc.gml is now
failing with a null pointer error. The request works fine if I change the
info_format to 'text/plain'. Has the mime string for GML changed, or is
there something else I should know?

Hum... I don't know. It seems the feature type cannot be located for some reason.

Are you prefixing the layer name with the namespace prefix? If not,
is the layer in the default namespace?

I've quickly tried different combinations and cannot reproduce.
So I'd suggest, first to try out a nightly build of 2.0.x
(http://gridlock.openplans.org/geoserver/2.0.x/) and if you can still
reproduce the problem with that one, then send us the data you're using
and the GS configuration and we can have a look into it as time allows

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

Andrea,

Thanks for pointing me in the right direction. Some combination of restarting GeoServer, saving changes to the layer, and moving the datasource from its namespace to an old namespace and back to the new namespace caused the request to start working. Sorry I didn’t isolate the exact workaround to this bug. I appreciate the assistance!

–j

On Tue, Mar 9, 2010 at 3:33 PM, Andrea Aime <aaime@anonymised.com> wrote:

Josh Marcus ha scritto:

Hey folks,

I’m upgrading an application from GeoServer 1.7.x to 2.x, and a WMS
GetFeatureInfo request using info_format=application/vnd.ogc.gml is now
failing with a null pointer error. The request works fine if I change the
info_format to ‘text/plain’. Has the mime string for GML changed, or is
there something else I should know?

Hum… I don’t know. It seems the feature type cannot be located for some reason.

Are you prefixing the layer name with the namespace prefix? If not,
is the layer in the default namespace?

I’ve quickly tried different combinations and cannot reproduce.
So I’d suggest, first to try out a nightly build of 2.0.x
(http://gridlock.openplans.org/geoserver/2.0.x/) and if you can still
reproduce the problem with that one, then send us the data you’re using
and the GS configuration and we can have a look into it as time allows

Cheers
Andrea


Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.


Josh Marcus
Software Engineer

Azavea (formerly Avencia) | T: 215.701.7505 | F: 215.925.2663
www.azavea.com

Hi everybody,

that sounds a bit like the problem I faced a couple of
weeks ago with Geoserver 2.0.1

I imported Postgis-Data into Geoserver and tried to
edit it using WFS/OpenLayers. At the beginning it didn't
work at all as I also faced a nullPointerException while
getting the data from within OpenLayers. But on the other
hand I could get the "Layer preview" perfectly running
from within Geoserver-WMS but not Geoserver-WFS.

After some research I found out what the problem was: I didn't
use the default namespace ("topp") but created a new one ("tp")
and set it as default.
Then I created a new store and directly added the layer from this
new PostGIS-store. But it seemed, that the new namespace wasn't
correctly added to this layer. I found out about this when
I clicked in the map in the Geoserver "Layer Preview" (WMS,
"OpenLayers") and there received the clear error that this
layer could not be found in the "topp" namespace. Now I
simply changed the workspace to "topp" (which it wasn't)
and back to "tp" and since then everything is allright.

Greetings,
Leo Dietze

Am 09.03.2010 22:11, schrieb Josh Marcus:

Andrea,

Thanks for pointing me in the right direction. Some combination of
restarting GeoServer, saving changes to the layer, and moving the
datasource from its namespace to an old namespace and back to the new
namespace caused the request to start working. Sorry I didn't isolate
the exact workaround to this bug. I appreciate the assistance!

--j

On Tue, Mar 9, 2010 at 3:33 PM, Andrea Aime <aaime@anonymised.com
<mailto:aaime@anonymised.com>> wrote:

    Josh Marcus ha scritto:

        Hey folks,

        I'm upgrading an application from GeoServer 1.7.x to 2.x, and a WMS
        GetFeatureInfo request using info_format=application/vnd.ogc.gml
        is now
        failing with a null pointer error. The request works fine if I
        change the
        info_format to 'text/plain'. Has the mime string for GML
        changed, or is
        there something else I should know?

    Hum... I don't know. It seems the feature type cannot be located for
    some reason.

    Are you prefixing the layer name with the namespace prefix? If not,
    is the layer in the default namespace?

    I've quickly tried different combinations and cannot reproduce.
    So I'd suggest, first to try out a nightly build of 2.0.x
    (http://gridlock.openplans.org/geoserver/2.0.x/) and if you can still
    reproduce the problem with that one, then send us the data you're using
    and the GS configuration and we can have a look into it as time allows

    Cheers
    Andrea

    --
    Andrea Aime
    OpenGeo - http://opengeo.org
    Expert service straight from the developers.

--
Josh Marcus
Software Engineer

Azavea (formerly Avencia) | T: 215.701.7505 | F: 215.925.2663
www.azavea.com <http://www.azavea.com>

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev

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

Leonhard Dietze ha scritto:

Hi everybody,

that sounds a bit like the problem I faced a couple of
weeks ago with Geoserver 2.0.1

I imported Postgis-Data into Geoserver and tried to
edit it using WFS/OpenLayers. At the beginning it didn't
work at all as I also faced a nullPointerException while
getting the data from within OpenLayers. But on the other
hand I could get the "Layer preview" perfectly running
from within Geoserver-WMS but not Geoserver-WFS.

After some research I found out what the problem was: I didn't
use the default namespace ("topp") but created a new one ("tp")
and set it as default.
Then I created a new store and directly added the layer from this
new PostGIS-store. But it seemed, that the new namespace wasn't
correctly added to this layer. I found out about this when
I clicked in the map in the Geoserver "Layer Preview" (WMS,
"OpenLayers") and there received the clear error that this
layer could not be found in the "topp" namespace. Now I
simply changed the workspace to "topp" (which it wasn't)
and back to "tp" and since then everything is allright.

Can you open a Jira about this one?
Having a set of steps to follow to reproduce the error
on the data directory we release GS with would help getting
it fixed quicker (as we would not have to invest time trying
to reproduce it by tentatives)

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

Am 10.03.2010 10:15, schrieb Andrea Aime:

Leonhard Dietze ha scritto:

that sounds a bit like the problem I faced a couple of
weeks ago with Geoserver 2.0.1

I imported Postgis-Data into Geoserver and tried to
edit it using WFS/OpenLayers. At the beginning it didn't
work at all as I also faced a nullPointerException while
getting the data from within OpenLayers. But on the other
hand I could get the "Layer preview" perfectly running
from within Geoserver-WMS but not Geoserver-WFS.

After some research I found out what the problem was: I didn't
use the default namespace ("topp") but created a new one ("tp")
and set it as default.
Then I created a new store and directly added the layer from this
new PostGIS-store. But it seemed, that the new namespace wasn't
correctly added to this layer. I found out about this when
I clicked in the map in the Geoserver "Layer Preview" (WMS,
"OpenLayers") and there received the clear error that this
layer could not be found in the "topp" namespace. Now I
simply changed the workspace to "topp" (which it wasn't)
and back to "tp" and since then everything is allright.

Can you open a Jira about this one?
Having a set of steps to follow to reproduce the error
on the data directory we release GS with would help getting
it fixed quicker (as we would not have to invest time trying
to reproduce it by tentatives)

I just tried to reproduce the error but didn't get it yet. I'll
open a new issue in Jira about it as soon as I get it
running (resp. not running).

greetings,
Leo

Leonard,

Your description fits my problem, as well. I created a new namespace, created a datasource and layer, the openlayers preview worked fine (basic WMS requests were working) but WMS GetFeatureInfo – which uses WFS code – was failing. My resolution was the same.

–j

On Wed, Mar 10, 2010 at 1:52 AM, Leonhard Dietze <news@anonymised.com> wrote:

Hi everybody,

that sounds a bit like the problem I faced a couple of
weeks ago with Geoserver 2.0.1

I imported Postgis-Data into Geoserver and tried to
edit it using WFS/OpenLayers. At the beginning it didn’t
work at all as I also faced a nullPointerException while
getting the data from within OpenLayers. But on the other
hand I could get the “Layer preview” perfectly running
from within Geoserver-WMS but not Geoserver-WFS.

After some research I found out what the problem was: I didn’t
use the default namespace (“topp”) but created a new one (“tp”)
and set it as default.
Then I created a new store and directly added the layer from this
new PostGIS-store. But it seemed, that the new namespace wasn’t
correctly added to this layer. I found out about this when
I clicked in the map in the Geoserver “Layer Preview” (WMS,
“OpenLayers”) and there received the clear error that this
layer could not be found in the “topp” namespace. Now I
simply changed the workspace to “topp” (which it wasn’t)
and back to “tp” and since then everything is allright.

Greetings,
Leo Dietze

Am 09.03.2010 22:11, schrieb Josh Marcus:

Andrea,

Thanks for pointing me in the right direction. Some combination of
restarting GeoServer, saving changes to the layer, and moving the
datasource from its namespace to an old namespace and back to the new
namespace caused the request to start working. Sorry I didn’t isolate
the exact workaround to this bug. I appreciate the assistance!

–j

On Tue, Mar 9, 2010 at 3:33 PM, Andrea Aime <aaime@anonymised.com

mailto:[aaime@anonymised.com](mailto:aaime@anonymised.com)> wrote:

Josh Marcus ha scritto:

Hey folks,

I’m upgrading an application from GeoServer 1.7.x to 2.x, and a WMS
GetFeatureInfo request using info_format=application/vnd.ogc.gml
is now
failing with a null pointer error. The request works fine if I
change the
info_format to ‘text/plain’. Has the mime string for GML
changed, or is
there something else I should know?

Hum… I don’t know. It seems the feature type cannot be located for
some reason.

Are you prefixing the layer name with the namespace prefix? If not,
is the layer in the default namespace?

I’ve quickly tried different combinations and cannot reproduce.
So I’d suggest, first to try out a nightly build of 2.0.x
(http://gridlock.openplans.org/geoserver/2.0.x/) and if you can still
reproduce the problem with that one, then send us the data you’re using
and the GS configuration and we can have a look into it as time allows

Cheers
Andrea


Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.


Josh Marcus
Software Engineer

Azavea (formerly Avencia) | T: 215.701.7505 | F: 215.925.2663

www.azavea.com <http://www.azavea.com>


Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev


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


Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev


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


Josh Marcus
Software Engineer

Azavea (formerly Avencia) | T: 215.701.7505 | F: 215.925.2663
www.azavea.com