[Geoserver-users] non-unique namespace URI cause error with KML time templates

I ran into a situation where the KML output requests with time templates
caused some errors. Although it was pretty easy to fix, I hope this
description can prevent others from having the same issue. This occured
with Geoserver 1.6-beta3.

Here is my setup...

The info.xml file for the truck_obs feature type refers to the osu_freight
datastore:

<featureType datastore = "osu_freight" >
  <name>truck_obs</name>
   ...
</featureType>

The catalog.xml file maps the osu_freight datastore to the mtri_postgis
namespace:

    <datastore namespace = "mtri_postgis" enabled = "true" id =
"osu_freight" >
      <connectionParams >
        <parameter value = "mtri_postgis" name = "namespace" />
         ...
      </connectionParams>
    </datastore>

When the time template for the feature type is utilized, geoserver throws an
error to the log file that refers to the namespace 'mtri' (note: this is not
the namespace that was configured in the catalog.xml file)

INFO | jvm 1 | 2007/10/19 09:31:47 | 171381089 [btpool0-1] WARN
org.geoserver.kml - Error occured processing 'time' template: Could not
locate FeatureTypeConfig 'mtri:truck_obs'
INFO | jvm 1 | 2007/10/19 09:31:47 | 171381089 [btpool0-1] WARN
org.geoserver.ows -
INFO | jvm 1 | 2007/10/19 09:31:47 | java.io.IOException
INFO | jvm 1 | 2007/10/19 09:31:47 | at
org.vfny.geoserver.wms.responses.map.kml.KMZMapProducer.writeTo(KMZMapProducer.java:134)
INFO | jvm 1 | 2007/10/19 09:31:47 | at
org.vfny.geoserver.wms.responses.GetMapResponse.writeTo(GetMapResponse.java:539)

Why did this happen? Because I mistakenly ended up with the same uri for
two namespaces in the catalog.xml file, and the time template seems to have
picked up the wrong one. (I know that this is a no-no, but I was using the
UI to add the namespace and I didn't check to see if it was unique)

  <namespaces >
    <namespace uri = "http://www.mtri.org" prefix = "mtri" />
    <namespace uri = "http://www.mtri.org" prefix = "mtri_postgis" />
  </namespaces>

Once I made the URI values unique, the error message went away.

Here are some thoughts on how to keep this from happening to other users:
- change the time templating so that it doesn't assume the URI values will
be unique
- have the GeoServer UI prevent users from adding a non-unique URI

Tyler
--
View this message in context: http://www.nabble.com/non-unique-namespace-URI-cause-error-with-KML-time-templates-tf4653372.html#a13295134
Sent from the GeoServer - User mailing list archive at Nabble.com.

Hmmm.. I am surprised that you are indeed allowed to do this. In my
opinion this is a bug as well and the ui should not allow it.

Do others agree?

-Justin

Tyler Erickson wrote:

I ran into a situation where the KML output requests with time templates
caused some errors. Although it was pretty easy to fix, I hope this
description can prevent others from having the same issue. This occured
with Geoserver 1.6-beta3.

Here is my setup...

The info.xml file for the truck_obs feature type refers to the osu_freight
datastore:

<featureType datastore = "osu_freight" >
  <name>truck_obs</name>
   ...
</featureType>

The catalog.xml file maps the osu_freight datastore to the mtri_postgis
namespace:

    <datastore namespace = "mtri_postgis" enabled = "true" id =
"osu_freight" >
      <connectionParams >
        <parameter value = "mtri_postgis" name = "namespace" />
         ...
      </connectionParams>
    </datastore>

When the time template for the feature type is utilized, geoserver throws an
error to the log file that refers to the namespace 'mtri' (note: this is not
the namespace that was configured in the catalog.xml file)

INFO | jvm 1 | 2007/10/19 09:31:47 | 171381089 [btpool0-1] WARN
org.geoserver.kml - Error occured processing 'time' template: Could not
locate FeatureTypeConfig 'mtri:truck_obs'
INFO | jvm 1 | 2007/10/19 09:31:47 | 171381089 [btpool0-1] WARN
org.geoserver.ows -
INFO | jvm 1 | 2007/10/19 09:31:47 | java.io.IOException
INFO | jvm 1 | 2007/10/19 09:31:47 | at
org.vfny.geoserver.wms.responses.map.kml.KMZMapProducer.writeTo(KMZMapProducer.java:134)
INFO | jvm 1 | 2007/10/19 09:31:47 | at
org.vfny.geoserver.wms.responses.GetMapResponse.writeTo(GetMapResponse.java:539)

Why did this happen? Because I mistakenly ended up with the same uri for
two namespaces in the catalog.xml file, and the time template seems to have
picked up the wrong one. (I know that this is a no-no, but I was using the
UI to add the namespace and I didn't check to see if it was unique)

  <namespaces >
    <namespace uri = "http://www.mtri.org" prefix = "mtri" />
    <namespace uri = "http://www.mtri.org" prefix = "mtri_postgis" />
  </namespaces>

Once I made the URI values unique, the error message went away.

Here are some thoughts on how to keep this from happening to other users:
- change the time templating so that it doesn't assume the URI values will
be unique
- have the GeoServer UI prevent users from adding a non-unique URI

Tyler

--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org

Justin Deoliveira ha scritto:

Hmmm.. I am surprised that you are indeed allowed to do this. In my
opinion this is a bug as well and the ui should not allow it.

Do others agree?

+1e100 :slight_smile:
Cheers
Andrea

Andrea Aime wrote:

Justin Deoliveira ha scritto:

Hmmm.. I am surprised that you are indeed allowed to do this. In my
opinion this is a bug as well and the ui should not allow it.

Do others agree?

+1e100 :slight_smile:

I had no idea you felt so strongly about this issue andrea ;).

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

Cheers
Andrea

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

!DSPAM:4007,4718e16538735409313003!

--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org

Justin Deoliveira ha scritto:

Andrea Aime wrote:

Justin Deoliveira ha scritto:

Hmmm.. I am surprised that you are indeed allowed to do this. In my
opinion this is a bug as well and the ui should not allow it.

Do others agree?

+1e100 :slight_smile:

I had no idea you felt so strongly about this issue andrea ;).

You know my motto: "A fix a day keeps issues away"? :-p
A bug is a bug, as such, it deserves to be destroyed.
Cheers
Andrea

strong words. hopefully there are no entomologists watching the mailing
list...
:slight_smile:

aaime wrote:

You know my motto: "A fix a day keeps issues away"? :-p
A bug is a bug, as such, it deserves to be destroyed.
Cheers
Andrea

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
View this message in context: http://www.nabble.com/non-unique-namespace-URI-cause-error-with-KML-time-templates-tf4653372.html#a13299080
Sent from the GeoServer - User mailing list archive at Nabble.com.

Tyler Erickson ha scritto:

strong words. hopefully there are no entomologists watching the mailing
list...
:slight_smile:

ha ha, I should have said "a software bug" :slight_smile:
Cheers
Andrea