Regression in app-schema feature chaining? ------------------------------------------
Key: GEOT-3436 URL: http://jira.codehaus.org/browse/GEOT-3436 Project: GeoTools Issue Type: Bug Components: data app-schema Affects Versions: 2.7-RC1, 2.8-M1 Reporter: Ben Caradoc-Davies Assignee: Rini Angreani Priority: Critical Rini, I think you have Morten's mapping files. -------- Original Message -------- Subject: Re: SV: SV: [ExternalEmail] Re: [Geoserver-users] ORA-01427 in RC1, app-schema Date: Thu, 17 Feb 2011 11:59:04 +0800 From: Ben Caradoc-Davies To: Lindegaard, Morten CC: geoserver-us...@lists.sourceforge.net Thanks, Morten. It looks like something has gone horribly wrong in the conversion of a filter to SQL. The SELECT with the clause "WHERE 0 = 1" is never going to return any rows. :-( I will create a Jira issue. Kind regards, Ben. On 16/02/11 20:43, Lindegaard, Morten wrote: > Hi Ben, > > Yes, the original SQL error has gone away. However, it might be because of > more immediate errors. > > When I use GeoServer 2.1 beta 3, my configuration seems to give the desired > results. > > The query > http://localhost:8080/geoserver21b3/kms/wfs?version=1.1.0&service=WFS&request=GetFeature&typename=kms:Jordstykke&maxfeatures=4&filter=%3CFilter%20xmlns=%22http://www.opengis.net/ogc%22%3E%3CPropertyIsEqualTo%3E%3CPropertyName%3Ekms:featureID%3C/PropertyName%3E%3CLiteral%3E1613974%3C/Literal%3E%3C/PropertyIsEqualTo%3E%3C/Filter%3E > > yields a response with data in GML, and the following is in the log: > > 2011-02-16 13:17:35,337 INFO [geoserver.wfs] - > Request: getFeature > handle = null > service = WFS > version = 1.1.0 > baseUrl = http://localhost:8080/geoserver21b3/ > providedVersion = null > extendedProperties = {} > query = [net.opengis.wfs.impl.QueryTypeImpl@117e4ff (group: null, > propertyName: null, function: null, filter: [ kms:featureID = 1613974 ], > sortBy: null, featureVersion: null, handle: null, srsName: null, typeName: > [{http://schemas.kms.dk/wfs}Jordstykke])] > maxFeatures = 4 > outputFormat = text/xml; subtype=gml/3.1.1 > resultType = results > traverseXlinkDepth = null > traverseXlinkExpiry = null > formatOptions = {} > metadata = null > > I then use the same workspace configuration in GeoServer 2.1 RC 1, and the > query results in an error that puts the below entries in the log. > > I had expected that I would have been able to simply copy a configuration > from beta 3 to RC 1. > > > Kind regards, > Morten > > > 2011-02-16 12:53:05,476 DEBUG [geoserver.requests] - Query is > net.opengis.wfs.impl.QueryTypeImpl@b162fa (group: [], propertyName: [], > function: null, filter: [ kms:featureID = 1613974 ], sortBy: [], > featureVersion: null, handle: null, srsName: null, typeName: > [{http://schemas.kms.dk/wfs}Jordstykke]) > To gt2: Query: > feature type: Jordstykke > filter: [ kms:featureID = 1613974 ] > [properties: ALL ] > 2011-02-16 12:53:05,476 DEBUG [geotools.jdbc] - CREATE CONNECTION > 2011-02-16 12:53:05,476 TRACE [geotools.core] - ENTRY 14 > 2011-02-16 12:53:05,476 DEBUG [geotools.filter] - exporting SQL > ComparisonFilter > 2011-02-16 12:53:05,476 DEBUG [geotools.filter] - exporting PropertyName > 2011-02-16 12:53:05,476 DEBUG [geotools.jdbc] - SELECT > KFID,UUID,FEATUREID,FEATURETYPE,FEATURECODE,DATASETIDENTIFIER,DATAQUALITYSPECIFICATION,DATAQUALITYSTATEMENT,DATAQUALITYDESCRIPTION,DATAQUALITYPROCESSOR,DATAQUALITYRESPONSIBLEPARTY,TIMEOFCREATION,TIMEOFPUBLICATION,TIMEOFREVISION,ESR_EJENDOMSNUMMER,KMS_SAGSID,KMS_JOURNALNUMMER,REGISTRERINGSDATO,EJERLAVSNAVN,LANDSEJERLAVSKODE,MATRIKELNUMMER,FAELLESLOD,MODERJORDSTYKKE,SUPMSAGSID,SKELFORRETNINGSSAGSID,REGISTRERETAREAL,AREALBEREGN,VEJAREAL,VEJAREALBEREGN,VANDAREALBEREGN,AREALTYPE,REGIONSKODE,REGIONSNAVN,KOMMUNEKODE,KOMMUNENAVN,SOGNEKODE,SOGNENAVN,RETSKREDSKODE,RETSKREDSNAVN,SURFACEPROPERTY > as SURFACEPROPERTY FROM LDS_2.KF_JORDSTYKKE_V WHERE FEATUREID = ? > 2011-02-16 12:53:05,476 DEBUG [geotools.jdbc] - 1 = 1613974 > 2011-02-16 12:53:05,617 DEBUG [geotools.jdbc] - CREATE CONNECTION > 2011-02-16 12:53:05,695 TRACE [geotools.core] - ENTRY -12.345 > 2011-02-16 12:53:05,695 DEBUG [geotools.jdbc] - SELECT > KFID,UUID,FEATUREID,FEATURETYPE,FEATURECODE,DATASETIDENTIFIER,DATAQUALITYSPECIFICATION,DATAQUALITYSTATEMENT,DATAQUALITYDESCRIPTION,DATAQUALITYPROCESSOR,DATAQUALITYRESPONSIBLEPARTY,TIMEOFCREATION,TIMEOFPUBLICATION,TIMEOFREVISION,ESR_EJENDOMSNUMMER,KMS_SAGSID,KMS_JOURNALNUMMER,REGISTRERINGSDATO,EJERLAVSNAVN,LANDSEJERLAVSKODE,MATRIKELNUMMER,FAELLESLOD,MODERJORDSTYKKE,SUPMSAGSID,SKELFORRETNINGSSAGSID,REGISTRERETAREAL,AREALBEREGN,VEJAREAL,VEJAREALBEREGN,VANDAREALBEREGN,AREALTYPE,REGIONSKODE,REGIONSNAVN,KOMMUNEKODE,KOMMUNENAVN,SOGNEKODE,SOGNENAVN,RETSKREDSKODE,RETSKREDSNAVN,SURFACEPROPERTY > as SURFACEPROPERTY FROM LDS_2.KF_JORDSTYKKE_V WHERE 0 = 1 > 2011-02-16 12:53:05,710 WARN [data.complex] - This shouldn't have > happened.There should be at least 1 features with > id='KF_JORDSTYKKE_V.fid-58777fea_12e2decb235_-7fdf'. > 2011-02-16 12:53:05,710 DEBUG [geotools.jdbc] - CLOSE CONNECTION > 2011-02-16 12:53:05,710 ERROR [geoserver.ows] - > java.lang.RuntimeException: Error applying mapping with targetAttribute > kms:featureID > at > org.geotools.data.complex.DataAccessMappingFeatureIterator.computeNext(DataAccessMappingFeatureIterator.java:739) > at > org.geotools.data.complex.AbstractMappingFeatureIterator.next(AbstractMappingFeatureIterator.java:171) > at > org.geotools.data.complex.MappingFeatureCollection.size(MappingFeatureCollection.java:300) > at org.geoserver.wfs.GetFeature.run(GetFeature.java:372) > at > org.geoserver.wfs.DefaultWebFeatureService.getFeature(DefaultWebFeatureService.java:114) [snip bunch of reflection, spring, and tomcat] > Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 > at java.util.ArrayList.RangeCheck(Unknown Source) > at java.util.ArrayList.get(Unknown Source) > at > org.geotools.data.complex.DataAccessMappingFeatureIterator.computeNext(DataAccessMappingFeatureIterator.java:736) > ... 155 more > > > -----Oprindelig meddelelse----- > Fra: Ben Caradoc-Davies > Sendt: 15. februar 2011 03:51 > Til: Lindegaard, Morten > Cc: geoserver-us...@lists.sourceforge.net > Emne: Re: SV: [ExternalEmail] Re: [Geoserver-users] ORA-01427 in RC1, > app-schema > > [I'm putting this discussion back on the list where it belongs. There > are a lot more on the list who might be able to help.] > > Morten, > > turning on VERBOSE_LOGGING should show you all SQL statements. They > should be on lines containing "[geotools.jdbc]". You might have to > reload the GeoServer servlet (logging can be a bit twitchy). It looks > like your SQL error has gone away. > > Rini thinks you should be seeing more in your error messages (see > below). Niels added these diagnostics so might be able to help. > > Kind regards, > Ben. > > > > -------- Original Message -------- > Subject: RE: SV: [ExternalEmail] Re: [Geoserver-users] ORA-01427 in RC1, > app-schema > Date: Tue, 15 Feb 2011 10:36:54 +0800 > From: Angreani, Rini (CESRE, Kensington)<rini.angre...@csiro.au> > > > Hmm, the error is there to isolate the problem to an attribute mapping. > It was done for catching invalid attribute mapping, e.g. if the column > it's mapped to doesn't exist. > But, it should have the original exception printed as well, e.g. > something like: > > java.lang.RuntimeException: Error applying mapping with targetAttribute > gml:name[4] > Error applying mapping with targetAttribute gml:name[4] > Could not find working property accessor for attribute (DESCRIPTIO) in > object > (SimpleFeatureImpl:InvalidColumnGeologicUnit=[SimpleFeatureImpl.Attribute: > NAME&lt;NAME id=gu.93&gt;=Yaugher Volcanic Group, > SimpleFeatureImpl.Attribute: CODE&lt;CODE id=gu.93&gt;=-Py, > SimpleFeatureImpl.Attribute: URN&lt;URN > id=gu.93&gt;=urn:x-test:GeologicUnit:16777549126931093, > SimpleFeatureImpl.Attribute: DESCRIPTION&lt;DESCRIPTION > id=gu.93&gt;=Olivine basalt, tuff, microgabbro, minor sedimentary > rocks]) > No value for xpath: DESCRIPTIO > > So, without the full stack trace, it's hard to determine the cause. > > > > > On 14/02/11 18:21, Lindegaard, Morten wrote: >> Hi Ben, >> >> Thank you for the suggestions! >> >> I used verbose logging, but I didn't find the SQL. I'll take a closer look >> at the view. >> >> I have attached a zip-file containing the workspace with my mapping files. >> >> However, I'm unable to reproduce the ORA-01427 error at the moment. So I'm >> afraid it is no help. Since I tried various things to fix the error, I have >> most likely changed something in the mapping files and forgotten about it. >> >> Right now, I run into this error: >> java.lang.RuntimeException: Error applying mapping with targetAttribute >> kms:harSamletFastEjendom >> Error applying mapping with targetAttribute kms:harSamletFastEjendom >> Error applying mapping with targetAttribute FEATURE_LINK >> Index: 0, Size: 0 >> >> So that's what I'm trying to get around now... >> >> If there is anything in my mapping files that looks suspicious at a glance, >> I'll be happy to know. >> >> Kind regards, >> Morten >> >> Miljøministeriet, Kort& Matrikelstyrelsen, direkte tlf. 72545506. Officiel >> kommunikation bedes dirigeret via e-mail k...@kms.dk eller telefon 72545000 >> >> -----Oprindelig meddelelse----- >> Fra: Ben Caradoc-Davies >> Sendt: 11. februar 2011 05:56 >> Til: Lindegaard, Morten >> Cc: geoserver-us...@lists.sourceforge.net >> Emne: Re: [ExternalEmail] Re: [Geoserver-users] ORA-01427 in RC1, app-schema >> >> Morten, here are some suggestions from a colleague: >> >> On 11/02/11 11:21, Warren, Peter (CESRE, North Ryde) wrote: >> > Does Geoserver build SQL with subqueries? I wouldn't have thought >> so. If it doesn't then this is likely an error in a view definition. >> > If it does build SQL with subqueries then this could be caused by >> duplicate feature_IDs used in the chaining. >> > Note: We really don't have much to go on here so I could be wrong. >> >> >> On 11/02/11 10:30, Ben Caradoc-Davies wrote: >>> Morten, >>> >>> please turn on verbose logging and let us know if you can see the SQL >>> that is generated when you get this error. >>> >>> Can we please see your app-schema mapping file? >>> >>> Kind regards, >>> Ben. >>> >>> On 10/02/11 20:22, Lindegaard, Morten wrote: >>>> Hi, >>>> >>>> I have installed 2.1-RC1 recently, and I have copied a configuration that >>>> use the app-schema and oracle extensions from beta3 to RC1. >>>> >>>> The configuration nests features, and selects from various views and >>>> tables. >>>> >>>> It works fine in beta3, but RC1 fails with "java.lang.RuntimeException: >>>> java.sql.SQLException: ORA-01427: single-row subquery returns more than >>>> one row". >>>> >>>> Does anyone know of changes from beta3 to RC1 that would explain the >>>> change in behaviour? >>>> >>>> Thanks in advance! >>>> >>>> Kind regards, >>>> Morten Lindegaard >>>> >>>> >>>> >>> -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira ------------------------------------------------------------------------------ The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: Pinpoint memory and threading errors before they happen. Find and fix more than 250 security defects in the development cycle. Locate bottlenecks in serial and parallel code that limit performance. http://p.sf.net/sfu/intel-dev2devfeb _______________________________________________ Geotools-devel mailing list Geotools-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-devel