Re: [Geoserver-users] Problem with RESTful creation of layers based on Postgis tables

2011-08-19 Thread Garey Mills
Andrea -

 Thank you. Turns out that shp2pgsql lowercases all tablenames. 
Changing the case of the features in the REST cmds did the trick.

Garey

On 8/19/2011 12:59 PM, Andrea Aime wrote:
> On Fri, Aug 19, 2011 at 9:44 PM, Garey Mills
>   wrote:
>> Hi -
>>
>>  I am using Geoserver 2.1.1. have a several hundreds layers in
>> around 10 stores. I created them all by creating PostGis tables from
>> shape files and then running a cURL command line like this:
>>
>> curl -u admin:  -XPOST -H 'Content-type: text/xml' -d
>> 'airport'
>> http://localhost:8080/geoserver/rest/workspaces/UCB/datastores/sanmateocounty/featuretypes
>>
>>
>>  Today I had to add a few more layers. I created a batch file, ran
>> it and it failed. I saw immediately that I had changed the admin
>> password but had the old one in my batch lines. I changed it and ran the
>> batch file again. But now I get
>>
>>  'Trying to create new feature type inside the store, but no
>> attributes were specified'
>>
>> I have restarted the server, but no dice. Below is the log.
>>
>> Is there any way to get the RESTful interface working again?
> When POSTing to a feature type resource the are two possible actions:
> - configuration of a existing table
> - if the table does not exists, it's possible to create it, but in this case
>the list of attributes has to be provided
>
> The stack trace shows you're falling in the second case, that is, the
> table that you're trying to configure is not known to GeoServer.
> There could be various motivations, for example:
> - the table is in a schema other than the one configured in the store
> - the table is not readable by the user that you use to connect
> - the name of the table is using the wrong case (GeoServer uses
>quotes around the name to have all table and attribute names
>case be mantained, as all OGC services are case sensitive)
>
> Cheers
> Andrea
>

--
Get a FREE DOWNLOAD! and learn more about uberSVN rich system, 
user administration capabilities and model configuration. Take 
the hassle out of deploying and managing Subversion and the 
tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2
___
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users


Re: [Geoserver-users] Problem with RESTful creation of layers based on Postgis tables

2011-08-19 Thread Andrea Aime
On Fri, Aug 19, 2011 at 9:44 PM, Garey Mills
 wrote:
> Hi -
>
>     I am using Geoserver 2.1.1. have a several hundreds layers in
> around 10 stores. I created them all by creating PostGis tables from
> shape files and then running a cURL command line like this:
>
> curl -u admin: -XPOST -H 'Content-type: text/xml' -d
> 'airport'
> http://localhost:8080/geoserver/rest/workspaces/UCB/datastores/sanmateocounty/featuretypes
>
>
>     Today I had to add a few more layers. I created a batch file, ran
> it and it failed. I saw immediately that I had changed the admin
> password but had the old one in my batch lines. I changed it and ran the
> batch file again. But now I get
>
>         'Trying to create new feature type inside the store, but no
> attributes were specified'
>
> I have restarted the server, but no dice. Below is the log.
>
> Is there any way to get the RESTful interface working again?

When POSTing to a feature type resource the are two possible actions:
- configuration of a existing table
- if the table does not exists, it's possible to create it, but in this case
  the list of attributes has to be provided

The stack trace shows you're falling in the second case, that is, the
table that you're trying to configure is not known to GeoServer.
There could be various motivations, for example:
- the table is in a schema other than the one configured in the store
- the table is not readable by the user that you use to connect
- the name of the table is using the wrong case (GeoServer uses
  quotes around the name to have all table and attribute names
  case be mantained, as all OGC services are case sensitive)

Cheers
Andrea

-- 
---
Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead

Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy

phone: +39 0584 962313
fax:      +39 0584 962313

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf

---

--
Get a FREE DOWNLOAD! and learn more about uberSVN rich system, 
user administration capabilities and model configuration. Take 
the hassle out of deploying and managing Subversion and the 
tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2
___
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users


[Geoserver-users] Problem with RESTful creation of layers based on Postgis tables

2011-08-19 Thread Garey Mills
Hi -

 I am using Geoserver 2.1.1. have a several hundreds layers in 
around 10 stores. I created them all by creating PostGis tables from 
shape files and then running a cURL command line like this:

curl -u admin: -XPOST -H 'Content-type: text/xml' -d 
'airport' 
http://localhost:8080/geoserver/rest/workspaces/UCB/datastores/sanmateocounty/featuretypes


 Today I had to add a few more layers. I created a batch file, ran 
it and it failed. I saw immediately that I had changed the admin 
password but had the old one in my batch lines. I changed it and ran the 
batch file again. But now I get

 'Trying to create new feature type inside the store, but no 
attributes were specified'

I have restarted the server, but no dice. Below is the log.

Is there any way to get the RESTful interface working again?

Garey Mills

19 Aug 12:35:00 ERROR [geoserver.rest] - Trying to create new feature 
type inside the store, but no attributes were s
pecified
19 Aug 12:35:00 ERROR [geoserver.rest] -
org.geoserver.rest.RestletException
 at 
org.geoserver.catalog.rest.FeatureTypeResource.buildFeatureType(FeatureTypeResource.java:174)
 at 
org.geoserver.catalog.rest.FeatureTypeResource.handleObjectPost(FeatureTypeResource.java:124)
 at 
org.geoserver.rest.ReflectiveResource.handlePost(ReflectiveResource.java:122)
 at org.restlet.Finder.handle(Finder.java:296)
 at 
org.geoserver.rest.BeanDelegatingRestlet.handle(BeanDelegatingRestlet.java:37)
 at org.restlet.Filter.doHandle(Filter.java:105)
 at org.restlet.Filter.handle(Filter.java:134)
 at org.restlet.Router.handle(Router.java:444)
 at 
org.geoserver.rest.RESTDispatcher$1.handle(RESTDispatcher.java:204)
 at 
com.noelios.restlet.ext.servlet.ServletConverter.service(ServletConverter.java:129)
 at 
org.geoserver.rest.RESTDispatcher.handleRequestInternal(RESTDispatcher.java:86)
 at 
org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
 at 
org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.j
ava:48)
 at 
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
 at 
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:809)
 at 
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
 at 
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
 at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:306)
 at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
 at 
org.geoserver.filters.ThreadLocalsCleanupFilter.doFilter(ThreadLocalsCleanupFilter.java:23)
 at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:244)
 at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
 at 
org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:74)
 at 
org.geoserver.filters.SpringDelegatingFilter.doFilter(SpringDelegatingFilter.java:45)
 at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:244)
 at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
 at 
org.geoserver.platform.AdvancedDispatchFilter.doFilter(AdvancedDispatchFilter.java:49)
 at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:244)
 at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
 at 
org.vfny.geoserver.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:109)
 at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:244)
 at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
 at 
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:394)
 at 
org.springframework.security.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
 at 
org.springframework.security.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
 at 
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:406)
 at 
org.springframework.security.ui.ExceptionTranslationFilter.doFilterHttp(ExceptionTranslationFilter.java:101)
 at 
org.springframework.security.ui.SpringSecurityFilter.doFil