I followed these steps but I could not replicate the problem. Here is
what I did:
1. Added a new datastore for my postgis database
2. Created the table "layer" given the SQL you gave me
3. Created a second table "layer2", which was identical to the first
4. Added the layer feature type via a REST call:
5. Did a get feature request against layer:
6. I added the layer2 feature type via rest:
7. I then did a get feature against that:
I did not have to restart geoserver at all. So I am not sure what in
your environment is causing the problem. Are you 100% sure you are
running the correct version of geoserver and the plugin i sent you links for?
Maybe it is something in your environment...
Rectification :
When I start geoserver the first layer who is import with rest work but not the next layer.
Only the first layer work and after I have the error
java.lang.RuntimeException: Could not find element declaration: (http://www.openplans.org/topp
, layer )
Could not find element declaration: (http://www.openplans.org/topp, layer )
Thanks
Jim
2009/6/18 Jimmy Aumard <jimmy.aumard@anonymised.com <mailto:jimmy.aumard@anonymised.com>>
Thanks I have test the version behind but that doesn't work 
My table it's create with this:
CREATE TABLE layer
(
gid serial NOT NULL,
the_geom geometry,
CONSTRAINT layer_pkey PRIMARY KEY (gid),
CONSTRAINT enforce_dims_the_geom CHECK (ndims(the_geom) = 2),
CONSTRAINT enforce_srid_the_geom CHECK (srid(the_geom) = (27572))
)
WITH (OIDS=FALSE);
ALTER TABLE layer OWNER TO jim;
I make an insert :
INSERT INTO layer (the_geom) VALUES
('0106000020B46B00000100000001030000000100000004000000469CE4BD983A12C1CAA6B06A4ED540415E8F0E6D973A12C10C017BB94CD540415E8F0E6D973A12C10C017BB94CD54041469CE4BD983A12C1CAA6B06A4ED54041')
And after I import the table on geoserver with curl and php
$data = "<featureType><name>layer</name></featureType>";
$curl = curl_init();
$headers = array(
"Content-Type: text/xml",
"charset=\"UTF-8\""
);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_URL, $urlGeoserver);
curl_setopt($curl, CURLOPT_USERPWD, $userPassGeo);
curl_setopt($curl, CURLOPT_POST, TRUE);
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
curl_exec($curl);
but I have
java.lang.RuntimeException: Could not find element declaration:
(http://www.openplans.org/topp, layer )
Could not find element declaration: (http://www.openplans.org/topp,
layer )
If I restart geoserver I have:
<wfs:FeatureCollection numberOfFeatures="1"
timeStamp="2009-06-18T17:15:35.523+02:00"
xsi:schemaLocation="http://www.openplans.org/topp
http://localhost:8080/geoserver/wfs?service=WFS&version=1.1.0&request=DescribeFeatureType&typeName=topp:layer
<http://localhost:8080/geoserver/wfs?service=WFS&version=1.1.0&request=DescribeFeatureType&typeName=topp:layer>
http://www.opengis.net/wfs
http://localhost:8080/geoserver/schemas/wfs/1.1.0/wfs.xsd">
−
<gml:boundedBy>
−
<gml:Envelope srsName="urn:x-ogc:def:crs:EPSG:27572">
<gml:lowerCorner>-298662.18544239213 2206361.449066287</gml:lowerCorner>
<gml:upperCorner>-298661.8565008546 2206364.8335159766</gml:upperCorner>
</gml:Envelope>
</gml:boundedBy>
−
<gml:featureMembers>
−
<topp:layer gml:id="layer.1">
−
<gml:boundedBy>
−
<gml:Envelope srsName="urn:x-ogc:def:crs:EPSG:27572">
<gml:lowerCorner>-298662.18544239213 2206361.449066287</gml:lowerCorner>
<gml:upperCorner>-298661.8565008546 2206364.8335159766</gml:upperCorner>
</gml:Envelope>
</gml:boundedBy>
−
<topp:the_geom>
−
<gml:MultiSurface srsName="urn:x-ogc:def:crs:EPSG:27572">
−
<gml:surfaceMember>
−
<gml:Polygon>
−
<gml:exterior>
−
<gml:LinearRing>
−
<gml:posList>
-298662.18544239213 2206364.8335159766 -298661.8565008546
2206361.449066287 -298661.8565008546 2206361.449066287
-298662.18544239213 2206364.8335159766
</gml:posList>
</gml:LinearRing>
</gml:exterior>
</gml:Polygon>
</gml:surfaceMember>
</gml:MultiSurface>
</topp:the_geom>
</topp:layer>
</gml:featureMembers>
</wfs:FeatureCollection>
Where are my errors? 
2009/6/18 Justin Deoliveira <jdeolive@anonymised.com
<mailto:jdeolive@anonymised.com>>
Jimmy Aumard wrote:
For request I modify the name for the mail it's my mistake
sorry it's not layer it's destroyjim.
Ok, thought it might be.
I try to download the last version today and test.
Do you have the link please to download geoserver and rest
plugin?
You can grab the latest versions:
http://gridlock.openplans.org/geoserver/1.7.x/geoserver-1.7.x-061809-bin.zip
http://gridlock.openplans.org/geoserver/1.7.x/ext-061809/geoserver-1.7.5-SNAPSHOT-restconfig-plugin.zip
It's possible to use a new geoserver with the data_dir of my
old geoserver?
Yes, just move your data dir somewhere on your system, and then
set the GEOSERVER_DATA_DIR environment variable to point to it. See:
http://docs.geoserver.org/1.7.4/user/data-directory/data-dir-setting.html
Thanks
Jim
2009/6/17 Justin Deoliveira <jdeolive@anonymised.com
<mailto:jdeolive@anonymised.com> <mailto:jdeolive@anonymised.com
<mailto:jdeolive@anonymised.com>>>
Please keep your replies on the public list. Use
reply-all, not reply.
Jimmy Aumard wrote:
My version of geoserver is 1.7.5SNAPSHOT and for the
pluging
rest-1.7.5-SNAPSHOT.jar and restconfig-1.7.5-SNAPSHOT.jar
Do you know the date you downloaded the builds? There
have been a
few fixes related to this latey, so i am not sure if you
have them
or not.
The request WFS are:
http://localhost:8080/geoserver/wfs?request=GetFeature&typename=topp:layer
<http://localhost:8080/geoserver/wfs?request=GetFeature&typename=topp:layer>
<http://localhost:8080/geoserver/wfs?request=GetFeature&typename=topp:layer
<http://localhost:8080/geoserver/wfs?request=GetFeature&typename=topp:layer>>
<http://localhost:8080/geoserver/wfs?request=GetFeature&typename=topp:layer
<http://localhost:8080/geoserver/wfs?request=GetFeature&typename=topp:layer>
<http://localhost:8080/geoserver/wfs?request=GetFeature&typename=topp:layer
<http://localhost:8080/geoserver/wfs?request=GetFeature&typename=topp:layer>>>
Looking at the request it references the type name
"topp:layer". Is
this a mistake? Because according to the transaction it
should be
"topp:destroyjim".
and this one work (send by openlayers):
<wfs:Transaction xmlns:wfs="http://www.opengis.net/wfs"
service="WFS" version="1.1.0" xsi:schemaLocation
="http://www.opengis.net/wfs
http://schemas.opengis.net/wfs/1.1.0/wfs.xsd"
xmlns:xsi="http://www.w3.org
/2001/XMLSchema-instance"><wfs:Insert><feature:destroyjim
xmlns:feature="http://www.openplans.org/topp"
<feature:the_geom><gml:MultiSurface
xmlns:gml="http://www.opengis.net/gml"
srsName="EPSG:900913"><gml
:surfaceMember><gml:Polygon><gml:exterior><gml:LinearRing><gml:posList>362005.7659082
6188341.8091064
-68487.577333984 6168773.9298682 190786.82257324
5527925.8848145 1169180.7844873 6330208.933584 352221
.82628906 6452508.1788232 190786.82257324 6339992.8732031
362005.7659082 6188341.8091064</gml:posList
</gml:LinearRing></gml:exterior></gml:Polygon></gml:surfaceMember></gml:MultiSurface></feature:the_geom
</feature:destroyjim></wfs:Insert></wfs:Transaction>
Thanks for your help
Jim
2009/6/17 Justin Deoliveira <jdeolive@anonymised.com
<mailto:jdeolive@anonymised.com>
<mailto:jdeolive@anonymised.com
<mailto:jdeolive@anonymised.com>> <mailto:jdeolive@anonymised.com
<mailto:jdeolive@anonymised.com>
<mailto:jdeolive@anonymised.com
<mailto:jdeolive@anonymised.com>>>>
Hi Jim,
You will need to give me more information.
Paritcularily:
1. What exact version of GeoServer you using, if
it is a nightly
build please give me the date stamp on it.
2. What exact version of the REST plugin you are
using.
3. The exact WFS requests you are making
And I don't quite understand. You say that WFS-T
requests
work, but
a regular WFS request does not work?
With more info, hopefully i can help.
-Justin
Jimmy Aumard wrote:
Hello justin,
My wfs layer doesn't work but the wfs-t work
it's possible to
add a feature on my layer but not to see it
because I
have the
error:
java.lang.RuntimeException: Could not find element
declaration:
(http://www.openplans.org/topp, layer )
Could not find element declaration:
(http://www.openplans.org/topp, layer )
It's very important for my project to create
layer with
REST for
make wfs-t.
Thanks
Jim