EOFarm / geoportal.ypen.gr

0 stars 0 forks source link

GeoServer App-schema WFS index out of bounds error #13

Closed kalxas closed 2 years ago

kalxas commented 2 years ago

When creating the application schema mappings manually, copying to the workspace folder and restarting GeoServer, we see the app-schema store, layer preview works as expected for WMS.

From the layer preview page, when we select GML3.2 option we get the features file without a problem, but we realize that this is a WFS 1.0.0 request by default with GML3.2 as output format.

http://localhost:8080/geoserver/sd/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=sd%3ASpeciesDistributionDataSet&outputFormat=gml32&maxFeatures=50

and logs are fine:

20 Jul 20:00:29 INFO [geoserver.wfs] -
Request: getServiceInfo
20 Jul 20:00:29 INFO [geoserver.wfs] -
Request: getFeature
     service = WFS
     version = 1.0.0
     baseUrl = http://localhost:8080/geoserver/
     query[0]:
         typeName[0] = 
{http://inspire.ec.europa.eu/schemas/sd/4.0}SpeciesDistributionDataSet
     maxFeatures = 50
     outputFormat = gml32
     resultType = results

When we manually make the same request using WFS 2.0.0 or WFS 1.1.0. we see the following error:

http://localhost:8080/geoserver/sd/ows?service=WFS&version=1.1.0&request=GetFeature&typeName=sd%3ASpeciesDistributionDataSet&outputFormat=gml32&maxFeatures=50

<ows:ExceptionReport version="1.0.0" 
xsi:schemaLocation="http://www.opengis.net/ows 
http://localhost:8080/geoserver/schemas/ows/1.0.0/owsExceptionReport.xsd">;
<ows:Exception exceptionCode="NoApplicableCode">
<ows:ExceptionText>
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 Index: 0, Size: 0
</ows:ExceptionText>
</ows:Exception>
</ows:ExceptionReport>

and the log:

20 Jul 19:58:20 INFO [geoserver.wfs] -
Request: getServiceInfo
20 Jul 19:58:20 ERROR [geoserver.ows] -
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
     at java.util.ArrayList.rangeCheck(ArrayList.java:659)
     at java.util.ArrayList.get(ArrayList.java:435)
     at 
org.geotools.appschema.jdbc.JoiningJDBCFeatureSource.getIdColumnName(JoiningJDBCFeatureSource.java:1566)
     at 
org.geotools.appschema.jdbc.JoiningJDBCFeatureSource.getCountInternal(JoiningJDBCFeatureSource.java:1444)
     at 
org.geotools.data.store.ContentFeatureSource.getCount(ContentFeatureSource.java:473)
     at 
org.geotools.data.complex.AppSchemaDataAccess.getCount(AppSchemaDataAccess.java:303)
     at 
org.geotools.data.complex.MappingFeatureCollection.size(MappingFeatureCollection.java:321)
     at 
org.geotools.feature.collection.DecoratingFeatureCollection.size(DecoratingFeatureCollection.java:103)
     at org.geoserver.wfs.GetFeature.run(GetFeature.java:692)
     at 
org.geoserver.wfs.DefaultWebFeatureService.getFeature(DefaultWebFeatureService.java:105)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
     at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
     at java.lang.reflect.Method.invoke(Method.java:498)
     at 
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343)
     at 
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
     at 
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
     at 
org.geoserver.ows.util.RequestObjectLogger.invoke(RequestObjectLogger.java:50)
     at 
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
     at 
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
kalxas commented 2 years ago

https://sourceforge.net/p/geoserver/mailman/geoserver-users/thread/9e674205-a516-e902-c609-933b73e2d453%40gmail.com/#msg37323169

kalxas commented 2 years ago

Linked to #7

kalxas commented 2 years ago

https://sourceforge.net/p/geoserver/mailman/message/37328170/

kalxas commented 2 years ago

https://sourceforge.net/p/geoserver/mailman/message/37327102/

kalxas commented 2 years ago

Issue fixed with moving from database views to materialized views and defining a primary key