On Tue, May 7, 2013 at 2:21 PM, Andrea Aime <andrea.a...@geo-solutions.it>wrote:

> On Tue, May 7, 2013 at 8:20 PM, Michael Moore <
> michael.mo...@flatrockgeo.com> wrote:
>
>> Geoserver 2.2.4 using Jetty on Windows Server 2008.
>>
>> We're pulling several layers from SQL Server and I'm trying to get a list
>> of field names for each layer using WFS's DescribeFeatureType request.
>>
>> All layers are published in GeoServer with the same settings (Same
>> polygon style, same SRS, etc.) but some layers don't list their field names
>> in DescribeFeatureType and others do. Can anyone shed some light on why
>> this might be?
>>
>> Eg. when I request
>>
>> http://myserver/geoserver/wfs?request=DescribeFeatureType&typeName=MNS:geofence_static
>> I get:
>>
>> <xsd:schema elementFormDefault="qualified" targetNamespace="
>> http://www.mydomain.net/tracking/MNS";>
>> <xsd:import namespace="http://www.opengis.net/gml/3.2"; schemaLocation="
>> http://myserver/geoserver/schemas/gml/3.2.1/gml.xsd"/>
>> <xsd:complexType name="geofence_staticType">
>>    <xsd:complexContent>
>>          <xsd:extension base="gml:AbstractFeatureType">
>>                   <xsd:sequence>
>>                     <xsd:element maxOccurs="1" minOccurs="1"
>> name="ogr_fid" nillable="false" type="xsd:int"/>
>>                     <xsd:element maxOccurs="1" minOccurs="0"
>> name="ogr_geometry" nillable="true" type="gml:GeometryPropertyType"/>
>>                     <xsd:element maxOccurs="1" minOccurs="0"
>> name="aeroway" nillable="true" type="xsd:string"/>
>>                   </xsd:sequence>
>>          </xsd:extension>
>>    </xsd:complexContent>
>> </xsd:complexType>
>> <xsd:element name="geofence_static"
>> substitutionGroup="gml:AbstractFeature" type="MNS:geofence_staticType"/>
>> </xsd:schema>
>>
>> If I request
>>
>> http://myserver/geoserver/wfs?request=DescribeFeatureType&typeName=MNS:GeoFence
>> I simply get:
>>
>> <xsd:schema elementFormDefault="qualified" targetNamespace="
>> http://www.mydomain.net/tracking/MNS";>
>>  <xsd:import namespace="http://www.opengis.net/gml/3.2"; schemaLocation="
>> http://myserver/geoserver/schemas/gml/3.2.1/gml.xsd"/>
>> </xsd:schema>
>>
>>
>> I can't see any reason that one is returning the field names, but not the
>> other.
>>
>
> Impossible to say just by looking at the outputs.
> A few questions:
> * if you restart GeoServer and ask first about the GeoFence layer, do you
> get a non empty response?
> * what is the data types for the tables that won't show up (e.g., do you
> have a CREATE TABLE for those?
> * do they have any sort of special permission attached? (e.g., grants)
>

Same response after restarting and there's no special permissions yet.

The CREATE function is as follows:

USE [GIS_Test]
GO

/****** Object:  Table [dbo].[GeoFence]    Script Date: 05/07/2013 15:21:05
******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[GeoFence](
    [ID] [uniqueidentifier] NOT NULL,
    [AssetID] [nvarchar](max) NOT NULL,
    [Name] [nvarchar](255) NOT NULL,
    [Created] [datetime] NOT NULL,
    [Notes] [nvarchar](1024) NULL,
    [the_geom] [geometry] NOT NULL,
 CONSTRAINT [PK_Unit] PRIMARY KEY CLUSTERED
(
    [ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY =
OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [dbo].[GeoFence] ADD  DEFAULT (newsequentialid()) FOR [ID]
GO




It looks like the ID field (type: uniqueidentifier) is probably the
culprit:

2013-05-07 15:25:30,644 WARN [geoserver.wfs] - Could not build xml schema
for type: GeoFence
java.lang.NullPointerException: Could not find a type for property: ID of
type: java.util.UUID
    at
org.geoserver.wfs.xml.FeatureTypeSchemaBuilder.buildComplexSchemaContent(FeatureTypeSchemaBuilder.java:743)
    at
org.geoserver.wfs.xml.FeatureTypeSchemaBuilder.buildSchemaContent(FeatureTypeSchemaBuilder.java:664)
    at
org.geoserver.wfs.xml.FeatureTypeSchemaBuilder.buildSchemaInternal(FeatureTypeSchemaBuilder.java:234)
    at
org.geoserver.wfs.xml.FeatureTypeSchemaBuilder.build(FeatureTypeSchemaBuilder.java:147)
    at
org.geoserver.wfs.xml.FeatureTypeSchemaBuilder.build(FeatureTypeSchemaBuilder.java:141)
    at
org.geoserver.wfs.xml.FeatureTypeSchemaBuilder.build(FeatureTypeSchemaBuilder.java:130)
    at
org.geoserver.wfs.xml.v1_1_0.XmlSchemaEncoder.doWrite(XmlSchemaEncoder.java:106)
    at
org.geoserver.wfs.xml.v1_1_0.XmlSchemaEncoder.write(XmlSchemaEncoder.java:95)
...

Thank you,
Michael Moore
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and 
their applications. This 200-page book is written by three acclaimed 
leaders in the field. The early access version is available now. 
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to