Hi Angelos,

Looks like App-Schema datastore is trying to locate the database table
primary key and an exception arises due to it's unable to find at least one
PK.
Some improvements with query count were added in recent versions and this
code portion is part of these improvements, probably making having a PK
required now, maybe this could be handled even better and backward
compatible making it optional.

I would recommend checking the DB table and see if it has a PK, if not
create one and check the output.


Regards,

Fernando Mino

==

GeoServer Professional Services from the experts!

Visit http://bit.ly/gs-services-us for more information.

==

Fernando Mino

Software Engineer

@fmy2kec

GeoSolutions Group
phone: +39 0584 962313

fax:     +39 0584 1660272

https://www.geosolutionsgroup.com/

http://twitter.com/geosolutions_it

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

Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE
2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si
precisa che ogni circostanza inerente alla presente email (il suo
contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è
riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il
messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra
operazione è illecita. Le sarei comunque grato se potesse darmene notizia.

This email is intended only for the person or entity to which it is
addressed and may contain information that is privileged, confidential or
otherwise protected from disclosure. We remind that - as provided by
European Regulation 2016/679 “GDPR” - copying, dissemination or use of this
e-mail or the information herein by anyone other than the intended
recipient is prohibited. If you have received this email by mistake, please
notify us immediately by telephone or e-mail.


On Tue, Jul 20, 2021 at 12:15 PM Angelos Tzotsos <gcpp.kal...@gmail.com>
wrote:

> Hi all,
>
> I am trying to create an INSPIRE compliant application schema for a
> dataset.
> I created the application schema mappings manually and copied to the
> workspace folder.
>
> After restarting GeoServer, I am able to see the app-schema store, layer
> preview works as expected for WMS.
>
>  From the layer preview page, when I select GML3.2 option I get the
> features file without a problem, but I 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 I manually make the same request using WFS 2.0.0 or WFS 1.1.0. I
> 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)
>
>
> Any ides why this happens?
> Working on GeoServer version 2.18.4 with PostGIS version 3.0 as a backend.
>
> Best,
> Angelos
>
>
> --
> Angelos Tzotsos, PhD
> President
> Open Source Geospatial Foundation
> http://users.ntua.gr/tzotsos
>
>
>
> _______________________________________________
> Geoserver-users mailing list
>
> Please make sure you read the following two resources before posting to
> this list:
> - Earning your support instead of buying it, but Ian Turton:
> http://www.ianturton.com/talks/foss4g.html#/
> - The GeoServer user list posting guidelines:
> http://geoserver.org/comm/userlist-guidelines.html
>
> If you want to request a feature or an improvement, also see this:
> https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer
>
>
> Geoserver-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>
_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this 
list:
- Earning your support instead of buying it, but Ian Turton: 
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: 
http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: 
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


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

Reply via email to