[Geoserver-users] Bug rest post featureTypes with indexingEnabled and cachingEnabled

Hi

i donno if i'm in the right place to post but i need to... all the day for
this idiot thing...

So when i'm trying to post the xml to rest, i have an exception :

2009-06-11 20:06:52,815 ERROR [org.vfny.geoserver.global] - Could not load
feature type topp:GEOSPEED5
java.lang.ClassCastException: java.lang.String cannot be cast to
java.lang.Boolean
        at
org.vfny.geoserver.global.FeatureTypeInfo.isIndexingEnabled(FeatureTypeInfo.java:1687)
        at
org.vfny.geoserver.global.FeatureTypeInfo.toDTO(FeatureTypeInfo.java:529)
       
the part wich causes trouble in my xml looks like this :
        " <metadata>" +"\n"+
        " <indexingEnabled>true</indexingEnabled>" +"\n"+
        " <cachingEnabled>false</cachingEnabled>" +"\n"+
        " <kml.regionateStrategy>best_guess</kml.regionateStrategy>"
+"\n"+
        " <dirName>GeoWeb_GEOSPEED5</dirName>" +"\n"+
        " <kml.regionateFeatureLimit>15</kml.regionateFeatureLimit>"
+"\n"+
        " </metadata>" +"\n"+

I suppressed all this metadata part, and it works now, but without cache nor
index...

If someone have an idea i take everything :smiley:

ps: i did it with javascript, my servlet give me everytime a 401 HTTP code i
don't understand, coz i have dont have this problem with get requests :

     URL url = new URL(adresse);
     
      HttpURLConnection conn = (HttpURLConnection) url.openConnection();
     
      conn.setRequestProperty("Authorization","admin:geoserver");
      conn.setRequestProperty("Content-Type", "text/xml");
     conn.setAllowUserInteraction(false);
     conn.setUseCaches(false);
      conn.setDoOutput(true);
      conn.setDoInput(true);
      conn.setRequestMethod("POST");
       writer = new java.io.PrintWriter(conn.getOutputStream());
      writer.write(req);
      writer.flush();

      reader = new BufferedReader(new
InputStreamReader(conn.getInputStream()));
--
View this message in context: http://www.nabble.com/Bug-rest-post-featureTypes-with-indexingEnabled-and-cachingEnabled-tp23987618p23987618.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Hi Stevan,

Looks like you found a bug. I will open a jira for this:

http://jira.codehaus.org/browse/GEOS-3148

I am a little unsure of how to solve.. i am going to post a message to the developers list about a possible solution. Sign up as a watcher on the jira issue to watch its progress.

-Justin

Stevan_FR wrote:

Hi

i donno if i'm in the right place to post but i need to... all the day for
this idiot thing...

So when i'm trying to post the xml to rest, i have an exception :

2009-06-11 20:06:52,815 ERROR [org.vfny.geoserver.global] - Could not load
feature type topp:GEOSPEED5
java.lang.ClassCastException: java.lang.String cannot be cast to
java.lang.Boolean
        at
org.vfny.geoserver.global.FeatureTypeInfo.isIndexingEnabled(FeatureTypeInfo.java:1687)
        at
org.vfny.geoserver.global.FeatureTypeInfo.toDTO(FeatureTypeInfo.java:529)
       
the part wich causes trouble in my xml looks like this : " <metadata>" +"\n"+
        " <indexingEnabled>true</indexingEnabled>" +"\n"+
        " <cachingEnabled>false</cachingEnabled>" +"\n"+
        " <kml.regionateStrategy>best_guess</kml.regionateStrategy>"
+"\n"+
        " <dirName>GeoWeb_GEOSPEED5</dirName>" +"\n"+
        " <kml.regionateFeatureLimit>15</kml.regionateFeatureLimit>"
+"\n"+
        " </metadata>" +"\n"+

I suppressed all this metadata part, and it works now, but without cache nor
index...

If someone have an idea i take everything :smiley:

ps: i did it with javascript, my servlet give me everytime a 401 HTTP code i
don't understand, coz i have dont have this problem with get requests :

     URL url = new URL(adresse);
           HttpURLConnection conn = (HttpURLConnection) url.openConnection();
           conn.setRequestProperty("Authorization","admin:geoserver");
      conn.setRequestProperty("Content-Type", "text/xml");
     conn.setAllowUserInteraction(false);
     conn.setUseCaches(false);
      conn.setDoOutput(true);
      conn.setDoInput(true);
      conn.setRequestMethod("POST");
       writer = new java.io.PrintWriter(conn.getOutputStream());
      writer.write(req);
      writer.flush();

      reader = new BufferedReader(new
InputStreamReader(conn.getInputStream()));

--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.