Details
Description
My application throws an exception when I use a DataStore connected to a PostGIS
table with a column named "name". I am using Geoserver.
There is a bug that make it impossible to use a table with a column
named "name".
The problem happens only when Geoserver query answers have a column named "name".
Debugging the xml parser code, I have found in
org.geotools.xml.handlers.ComplexElementHandler that the class attribute "type"
contains the name of all table columns and some other objects.
But there are **TWO** instances with a name "name", when the table has such
a column. The second occurrence is related to the desired column, but the
first occurrence is something else. Maybe every type has automatically this
object with name "name", even when there is no column named "name".
The two occurrences of "name" should be treated differently.
I have fixed this bug by searching "type" backwards, from the end to the beginning, in
org.geotools.xml.handlers.xsi.ComplexTypeHandler.DefaultSequence.findChildElement.
But I donīt think it is an elegant solution - I even donīt know it is a solution
for all similar cases ![]()
Activity
| Field | Original Value | New Value |
|---|---|---|
| Environment | ||
| Description |
My application throws an exception when I use a DataStore connected to a PostGIS table with a column named "name". I am using Geoserver. There is a bug that make it impossible to use a table with a column named "name". The problem happens only when Geoserver query answers have a column named "name". Debugging the xml parser code, I have found in org.geotools.xml.handlers.ComplexElementHandler that the class attribute "type" contains the name of all table columns and some other objects. But there are ***TWO*** instances with a name "name", when the table has such a column. The second occurrence is related to the desired column, but the first occurrence is something else. Maybe every type has automatically this object with name "name", even when there is no column named "name". The two occurrences of "name" should be treated differently. I have fixed this bug by searching "type" backwards, from the end to the beginning, in org.geotools.xml.handlers.xsi.ComplexTypeHandler.DefaultSequence.findChildElement. But I don´t think it is an elegant solution - I even don´t know it is a solution for all similar cases :-( |
My application throws an exception when I use a DataStore connected to a PostGIS table with a column named "name". I am using Geoserver. There is a bug that make it impossible to use a table with a column named "name". The problem happens only when Geoserver query answers have a column named "name". Debugging the xml parser code, I have found in org.geotools.xml.handlers.ComplexElementHandler that the class attribute "type" contains the name of all table columns and some other objects. But there are ***TWO*** instances with a name "name", when the table has such a column. The second occurrence is related to the desired column, but the first occurrence is something else. Maybe every type has automatically this object with name "name", even when there is no column named "name". The two occurrences of "name" should be treated differently. I have fixed this bug by searching "type" backwards, from the end to the beginning, in org.geotools.xml.handlers.xsi.ComplexTypeHandler.DefaultSequence.findChildElement. But I don´t think it is an elegant solution - I even don´t know it is a solution for all similar cases :-( |
| Fix Version/s | 2.0.RC0 [ 10855 ] |
| Fix Version/s | 2.7-M0 [ 15891 ] |
| Fix Version/s | 2.7-M1 [ 16521 ] | |
| Fix Version/s | 2.7-M0 [ 15891 ] |
| Fix Version/s | 2.7-RC1 [ 16571 ] | |
| Fix Version/s | 2.7-M1 [ 16521 ] |
| Fix Version/s | 2.7-M3 [ 16572 ] | |
| Fix Version/s | 2.7-M2 [ 16571 ] |
| Fix Version/s | 2.7-M4 [ 16726 ] | |
| Fix Version/s | 2.7-M3 [ 16572 ] |
| Fix Version/s | 2.7-beta1 [ 16974 ] | |
| Fix Version/s | 2.7-M4 [ 16726 ] |
| Fix Version/s | 2.7-RC1 [ 17076 ] | |
| Fix Version/s | 2.7-beta1 [ 16974 ] |
| Fix Version/s | 2.7.0 [ 17109 ] | |
| Fix Version/s | 2.7-RC1 [ 17076 ] |
| Fix Version/s | 2.7.1 [ 17255 ] | |
| Fix Version/s | 2.7.0 [ 17109 ] |
| Fix Version/s | 2.7.2 [ 17359 ] | |
| Fix Version/s | 2.7.1 [ 17255 ] |
| Fix Version/s | 2.7.3 [ 17442 ] | |
| Fix Version/s | 2.7.2 [ 17359 ] |
| Fix Version/s | 2.7.4 [ 17863 ] | |
| Fix Version/s | 2.7.3 [ 17442 ] |
| Fix Version/s | 2.7.5 [ 18236 ] | |
| Fix Version/s | 2.7.4 [ 17863 ] |
| Fix Version/s | 2.7.6 [ 18554 ] | |
| Fix Version/s | 2.7.5 [ 18236 ] |