[Geoserver-users] Dates and MySQL

Hi,

do you know if there is any problems updating features with WFS and the
Geoserver MySQL data store?

I think I've read about similar errors working with java.util.Date and
PostGis or Oracle.

We have the same locale in client and server but after invoking a wfs
addFeatures commit, we have this error in the server log ( ... i think
is throwed on the FeatureType validating):

java.lang.RuntimeException: Parsing failed for FH_FECHA:
java.lang.IllegalArgumentException: Failed to parse date Tue Feb 03
01:00:00 CET 2009 at:Tue Feb 03 01:00:00 CET 2009
        at org.geotools.xml.impl.ParseExecutor.visit(ParseExecutor.java:158)
        ....

Any advice? Thanks in advance.
Best regardas, Antonio

I do not know of any open issues of this exact case, but it would not surprise me. MySQL is unfortunately not one of our best maintained datstores, and working with dates is always tricky.

Dates in postgis however (and Oracle NG) should work ok, they are tested pretty thoroughly as part of the WFS 1.1 specification tests (CITE).

As for your direct problem, can you supply the following:

1) the full stack trace
2) the schema of your data, in particular the exact type of the date column
3) the request that is being made (if available), or what client you are using.

Thanks,

-Justin

Antonio Redondo Lora wrote:

Hi,

do you know if there is any problems updating features with WFS and the
Geoserver MySQL data store?

I think I've read about similar errors working with java.util.Date and
PostGis or Oracle.

We have the same locale in client and server but after invoking a wfs
addFeatures commit, we have this error in the server log ( ... i think
is throwed on the FeatureType validating):

java.lang.RuntimeException: Parsing failed for FH_FECHA:
java.lang.IllegalArgumentException: Failed to parse date Tue Feb 03
01:00:00 CET 2009 at:Tue Feb 03 01:00:00 CET 2009
        at org.geotools.xml.impl.ParseExecutor.visit(ParseExecutor.java:158)
        ....

Any advice? Thanks in advance.
Best regardas, Antonio

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing server and web deployment.
http://p.sf.net/sfu/businessobjects

------------------------------------------------------------------------

_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

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

Hi again.

We're working with DATE type in MySQL

    CREATE TABLE XXX
    (
        ID NUMERIC(11) NOT NULL,
        GEOM GEOMETRY NOT NULL,
        FH_FECHA DATE,
        PRIMARY KEY (ID),
        SPATIAL INDEX(GEOM)
    );

An insert testing example (all our WFS requests are made through Geotools):

       GeometryFactory factory = new GeometryFactory();
       Geometry geom = factory.createPoint( new Coordinate(px,py));
       geom.setUserData("EPSG:4326");
       
       ........

       WFSDataStore wfsDataStore = (new
WFSDataStoreFactory()).createDataStore(map);
       FeatureSource<SimpleFeatureType, SimpleFeature> featSource =
wfsDataStore.getFeatureSource(nameSpace + layer );
       FeatureStore<SimpleFeatureType, SimpleFeature> featStore =
(FeatureStore<SimpleFeatureType, SimpleFeature>) featSource;
       Transaction insert = new DefaultTransaction("insert");
       featStore.setTransaction(insert);

       SimpleFeatureBuilder featBuilder = new
SimpleFeatureBuilder(featSource.getSchema());
       SimpleFeature feat = featBuilder.buildFeature(null);
       featBuilder.set("ID", new Long(1));
       featBuilder.set("FH_FECHA", new Date());
       featBuilder.set("GEOM", geom);
       FeatureCollection<SimpleFeatureType, SimpleFeature> collection =
FeatureCollections.newCollection();
       collection.add(feat);
      
       featStore.addFeatures( collection );
       insert.commit();

the full stack trace:

    10-jun-2009 8:55:10 org.geotools.data.wfs.v1_0_0.WFSTransactionState
    commit
    ADVERTENCIA: org.geotools.ows.ServiceException:
    java.lang.RuntimeException: Parsing failed for FH_FECHA:
    java.lang.IllegalArgumentException: Failed to parse date at:
    Parsing failed for FH_FECHA: java.lang.IllegalArgumentException:
    Failed to parse date at:
    Failed to parse date at:
    09/06/10 08:55:10 java.io.IOException: An error occured while
    committing.
    09/06/10 08:55:10 at
    org.geotools.data.wfs.v1_0_0.WFSTransactionState.commit(WFSTransactionState.java:174)
    09/06/10 08:55:10 at
    org.geotools.data.DefaultTransaction.commit(DefaultTransaction.java:182)
    09/06/10 08:55:10 at
    es.dap.sig.web.request.MapRequestManager.addFeatures(MapRequestManager.java:442)
    09/06/10 08:55:10 at
    es.dap.sig.web.commands.pg.RecursosCommand.insertTransaction(RecursosCommand.java:83)
    09/06/10 08:55:10 at
    es.dap.sig.web.commands.pg.AbstractEditorCommand.execute(AbstractEditorCommand.java:44)
    09/06/10 08:55:10 at
    es.dap.sig.web.ControllerServlet.doPost(ControllerServlet.java:38)
    09/06/10 08:55:10 at
    javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
    09/06/10 08:55:10 at
    javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    09/06/10 08:55:10 at
    com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:713)
    09/06/10 08:55:10 at
    com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
    09/06/10 08:55:10 at
    com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
    09/06/10 08:55:10 at
    com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
    09/06/10 08:55:10 at
    com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221)
    09/06/10 08:55:10 at
    com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)
    09/06/10 08:55:10 at
    com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)
    09/06/10 08:55:10 at
    oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
    09/06/10 08:55:10 at
    oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)
    09/06/10 08:55:10 at
    oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)
    09/06/10 08:55:10 at
    oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)
    09/06/10 08:55:10 at
    com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
    09/06/10 08:55:10 at java.lang.Thread.run(Thread.java:595)

MySQL DataStore isn´t implemented for the WFS 1.1, is it?

Thanks!

Justin Deoliveira escribió:

I do not know of any open issues of this exact case, but it would not
surprise me. MySQL is unfortunately not one of our best maintained
datstores, and working with dates is always tricky.

Dates in postgis however (and Oracle NG) should work ok, they are
tested pretty thoroughly as part of the WFS 1.1 specification tests
(CITE).

As for your direct problem, can you supply the following:

1) the full stack trace
2) the schema of your data, in particular the exact type of the date
column
3) the request that is being made (if available), or what client you
are using.

Thanks,

-Justin

Antonio Redondo Lora wrote:

Hi,

do you know if there is any problems updating features with WFS and the
Geoserver MySQL data store?

I think I've read about similar errors working with java.util.Date and
PostGis or Oracle.

We have the same locale in client and server but after invoking a wfs
addFeatures commit, we have this error in the server log ( ... i think
is throwed on the FeatureType validating):

java.lang.RuntimeException: Parsing failed for FH_FECHA:
java.lang.IllegalArgumentException: Failed to parse date Tue Feb 03
01:00:00 CET 2009 at:Tue Feb 03 01:00:00 CET 2009
        at
org.geotools.xml.impl.ParseExecutor.visit(ParseExecutor.java:158)
        ....

Any advice? Thanks in advance.
Best regardas, Antonio

------------------------------------------------------------------------------

Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects

------------------------------------------------------------------------

_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
--------------------------------
Antonio Redondo Lora
Subdirección de Sistemas Informáticos
E.P. Desarrollo Agrario y Pesquero
c/Bergantín, 39 - 41012 Sevilla (España)
Email: arlora@anonymised.com
Tlfno: 955059762
Corporativo: 359762
--------------------------------

Sorry, the whole stack trace is ...

10-jun-2009 8:55:10 org.geotools.xml.XMLSAXHandler processException
GRAVE: java.lang.RuntimeException: Parsing failed for FH_FECHA:
java.lang.IllegalArgumentException: Failed to parse date at:
Parsing failed for FH_FECHA: java.lang.IllegalArgumentException: Failed
to parse date at:
Failed to parse date at:
org.geotools.xml.filter.FilterComplexTypes$ServiceExceptionType.getValue(FilterComplexTypes.java:1669)
   
org.geotools.xml.handlers.ComplexElementHandler.endElement(ComplexElementHandler.java:157)
    org.geotools.xml.XMLSAXHandler.endElement(XMLSAXHandler.java:266)
   
oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1318)
   
oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:336)
   
oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:303)
    oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:206)
    oracle.xml.jaxp.JXSAXParser.parse(JXSAXParser.java:292)
    oracle.xml.jaxp.JXSAXParser.parse(JXSAXParser.java:230)
    org.geotools.xml.DocumentFactory.getInstance(DocumentFactory.java:140)
   
org.geotools.data.wfs.v1_0_0.WFSTransactionState.commitPost(WFSTransactionState.java:286)
   
org.geotools.data.wfs.v1_0_0.WFSTransactionState.commit(WFSTransactionState.java:149)
    org.geotools.data.DefaultTransaction.commit(DefaultTransaction.java:182)
   
es.dap.sig.web.request.MapRequestManager.addFeatures(MapRequestManager.java:442)
   
es.dap.sig.web.commands.pg.RecursosCommand.insertTransaction(RecursosCommand.java:83)
   
es.dap.sig.web.commands.pg.AbstractEditorCommand.execute(AbstractEditorCommand.java:44)
    es.dap.sig.web.ControllerServlet.doPost(ControllerServlet.java:38)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
   
com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:713)
   
com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
   
com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
   
com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
   
com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221)
   
com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)
   
com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)
   
oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
   
oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)
   
oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)
   
oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)
   
com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
    java.lang.Thread.run(Thread.java:595)

10-jun-2009 8:55:10 org.geotools.xml.XMLSAXHandler endElement
ADVERTENCIA: java.lang.RuntimeException: Parsing failed for FH_FECHA:
java.lang.IllegalArgumentException: Failed to parse date at:
Parsing failed for FH_FECHA: java.lang.IllegalArgumentException: Failed
to parse date at:
Failed to parse date at:
10-jun-2009 8:55:10 org.geotools.xml.XMLSAXHandler endElement
ADVERTENCIA: Line 11 Col 20
10-jun-2009 8:55:10 org.geotools.data.wfs.v1_0_0.WFSTransactionState commit
ADVERTENCIA: org.geotools.ows.ServiceException:
java.lang.RuntimeException: Parsing failed for FH_FECHA:
java.lang.IllegalArgumentException: Failed to parse date at:
Parsing failed for FH_FECHA: java.lang.IllegalArgumentException: Failed
to parse date at:
Failed to parse date at:
09/06/10 08:55:10 java.io.IOException: An error occured while committing.
09/06/10 08:55:10 at
org.geotools.data.wfs.v1_0_0.WFSTransactionState.commit(WFSTransactionState.java:174)
09/06/10 08:55:10 at
org.geotools.data.DefaultTransaction.commit(DefaultTransaction.java:182)
09/06/10 08:55:10 at
es.dap.sig.web.request.MapRequestManager.addFeatures(MapRequestManager.java:442)
09/06/10 08:55:10 at
es.dap.sig.web.commands.pg.RecursosCommand.insertTransaction(RecursosCommand.java:83)
09/06/10 08:55:10 at
es.dap.sig.web.commands.pg.AbstractEditorCommand.execute(AbstractEditorCommand.java:44)
09/06/10 08:55:10 at
es.dap.sig.web.ControllerServlet.doPost(ControllerServlet.java:38)
09/06/10 08:55:10 at
javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
09/06/10 08:55:10 at
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
09/06/10 08:55:10 at
com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:713)
09/06/10 08:55:10 at
com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
09/06/10 08:55:10 at
com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
09/06/10 08:55:10 at
com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
09/06/10 08:55:10 at
com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221)
09/06/10 08:55:10 at
com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)
09/06/10 08:55:10 at
com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)
09/06/10 08:55:10 at
oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
09/06/10 08:55:10 at
oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)
09/06/10 08:55:10 at
oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)
09/06/10 08:55:10 at
oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)
09/06/10 08:55:10 at
com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
09/06/10 08:55:10 at java.lang.Thread.run(Thread.java:595)

Thanks!

Antonio Redondo Lora escribió:

Hi again.

We're working with DATE type in MySQL

    CREATE TABLE XXX
    (
        ID NUMERIC(11) NOT NULL,
        GEOM GEOMETRY NOT NULL,
        FH_FECHA DATE,
        PRIMARY KEY (ID),
        SPATIAL INDEX(GEOM)
    );

An insert testing example (all our WFS requests are made through Geotools):

       GeometryFactory factory = new GeometryFactory();
       Geometry geom = factory.createPoint( new Coordinate(px,py));
       geom.setUserData("EPSG:4326");
       
       ........

       WFSDataStore wfsDataStore = (new
WFSDataStoreFactory()).createDataStore(map);
       FeatureSource<SimpleFeatureType, SimpleFeature> featSource =
wfsDataStore.getFeatureSource(nameSpace + layer );
       FeatureStore<SimpleFeatureType, SimpleFeature> featStore =
(FeatureStore<SimpleFeatureType, SimpleFeature>) featSource;
       Transaction insert = new DefaultTransaction("insert");
       featStore.setTransaction(insert);

       SimpleFeatureBuilder featBuilder = new
SimpleFeatureBuilder(featSource.getSchema());
       SimpleFeature feat = featBuilder.buildFeature(null);
       featBuilder.set("ID", new Long(1));
       featBuilder.set("FH_FECHA", new Date());
       featBuilder.set("GEOM", geom);
       FeatureCollection<SimpleFeatureType, SimpleFeature> collection =
FeatureCollections.newCollection();
       collection.add(feat);
      
       featStore.addFeatures( collection );
       insert.commit();

the full stack trace:

    10-jun-2009 8:55:10 org.geotools.data.wfs.v1_0_0.WFSTransactionState
    commit
    ADVERTENCIA: org.geotools.ows.ServiceException:
    java.lang.RuntimeException: Parsing failed for FH_FECHA:
    java.lang.IllegalArgumentException: Failed to parse date at:
    Parsing failed for FH_FECHA: java.lang.IllegalArgumentException:
    Failed to parse date at:
    Failed to parse date at:
    09/06/10 08:55:10 java.io.IOException: An error occured while
    committing.
    09/06/10 08:55:10 at
    org.geotools.data.wfs.v1_0_0.WFSTransactionState.commit(WFSTransactionState.java:174)
    09/06/10 08:55:10 at
    org.geotools.data.DefaultTransaction.commit(DefaultTransaction.java:182)
    09/06/10 08:55:10 at
    es.dap.sig.web.request.MapRequestManager.addFeatures(MapRequestManager.java:442)
    09/06/10 08:55:10 at
    es.dap.sig.web.commands.pg.RecursosCommand.insertTransaction(RecursosCommand.java:83)
    09/06/10 08:55:10 at
    es.dap.sig.web.commands.pg.AbstractEditorCommand.execute(AbstractEditorCommand.java:44)
    09/06/10 08:55:10 at
    es.dap.sig.web.ControllerServlet.doPost(ControllerServlet.java:38)
    09/06/10 08:55:10 at
    javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
    09/06/10 08:55:10 at
    javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    09/06/10 08:55:10 at
    com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:713)
    09/06/10 08:55:10 at
    com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
    09/06/10 08:55:10 at
    com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
    09/06/10 08:55:10 at
    com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
    09/06/10 08:55:10 at
    com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221)
    09/06/10 08:55:10 at
    com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)
    09/06/10 08:55:10 at
    com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)
    09/06/10 08:55:10 at
    oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
    09/06/10 08:55:10 at
    oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)
    09/06/10 08:55:10 at
    oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)
    09/06/10 08:55:10 at
    oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)
    09/06/10 08:55:10 at
    com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
    09/06/10 08:55:10 at java.lang.Thread.run(Thread.java:595)

MySQL DataStore isn´t implemented for the WFS 1.1, is it?

Thanks!

Justin Deoliveira escribió:
  

I do not know of any open issues of this exact case, but it would not
surprise me. MySQL is unfortunately not one of our best maintained
datstores, and working with dates is always tricky.

Dates in postgis however (and Oracle NG) should work ok, they are
tested pretty thoroughly as part of the WFS 1.1 specification tests
(CITE).

As for your direct problem, can you supply the following:

1) the full stack trace
2) the schema of your data, in particular the exact type of the date
column
3) the request that is being made (if available), or what client you
are using.

Thanks,

-Justin

Antonio Redondo Lora wrote:
    

Hi,

do you know if there is any problems updating features with WFS and the
Geoserver MySQL data store?

I think I've read about similar errors working with java.util.Date and
PostGis or Oracle.

We have the same locale in client and server but after invoking a wfs
addFeatures commit, we have this error in the server log ( ... i think
is throwed on the FeatureType validating):

java.lang.RuntimeException: Parsing failed for FH_FECHA:
java.lang.IllegalArgumentException: Failed to parse date Tue Feb 03
01:00:00 CET 2009 at:Tue Feb 03 01:00:00 CET 2009
        at
org.geotools.xml.impl.ParseExecutor.visit(ParseExecutor.java:158)
        ....

Any advice? Thanks in advance.
Best regardas, Antonio

------------------------------------------------------------------------------

Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects

------------------------------------------------------------------------

_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users
      
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
------------------------------------------------------------------------

_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users
  

Dear All,
I have a map with the same layer showed twice, in WFS and WMS because I need to modify the feature and at the same time to show to the user how the old feature was.

When I stop the editing and save Firefox shows the wms layer correctly while IE shows the old wms until I don't clean the browser cache.

How can I solve this issue?

Thanks for all,

Marianna

Hi Antonio,

So I looked into this, and the problem is the WFS data store. IT is not properly encoding the date when sending it to geoserver. It is simply sending the java string representation of the date, rather than the ISO ... encoding of it.

Can you open an issue in the geotools issue tracker? Thanks.

-Justin

Antonio Redondo Lora wrote:

Sorry, the whole stack trace is ...

10-jun-2009 8:55:10 org.geotools.xml.XMLSAXHandler processException
GRAVE: java.lang.RuntimeException: Parsing failed for FH_FECHA:
java.lang.IllegalArgumentException: Failed to parse date at:
Parsing failed for FH_FECHA: java.lang.IllegalArgumentException: Failed
to parse date at:
Failed to parse date at: org.geotools.xml.filter.FilterComplexTypes$ServiceExceptionType.getValue(FilterComplexTypes.java:1669)
   org.geotools.xml.handlers.ComplexElementHandler.endElement(ComplexElementHandler.java:157)
    org.geotools.xml.XMLSAXHandler.endElement(XMLSAXHandler.java:266)
   oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1318)
   oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:336)
   oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:303)
    oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:206)
    oracle.xml.jaxp.JXSAXParser.parse(JXSAXParser.java:292)
    oracle.xml.jaxp.JXSAXParser.parse(JXSAXParser.java:230)
    org.geotools.xml.DocumentFactory.getInstance(DocumentFactory.java:140)
   org.geotools.data.wfs.v1_0_0.WFSTransactionState.commitPost(WFSTransactionState.java:286)
   org.geotools.data.wfs.v1_0_0.WFSTransactionState.commit(WFSTransactionState.java:149)
    org.geotools.data.DefaultTransaction.commit(DefaultTransaction.java:182)
   es.dap.sig.web.request.MapRequestManager.addFeatures(MapRequestManager.java:442)
   es.dap.sig.web.commands.pg.RecursosCommand.insertTransaction(RecursosCommand.java:83)
   es.dap.sig.web.commands.pg.AbstractEditorCommand.execute(AbstractEditorCommand.java:44)
    es.dap.sig.web.ControllerServlet.doPost(ControllerServlet.java:38)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
   com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:713)
   com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
   com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
   com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
   com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221)
   com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)
   com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)
   oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
   oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)
   oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)
   oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)
   com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
    java.lang.Thread.run(Thread.java:595)

10-jun-2009 8:55:10 org.geotools.xml.XMLSAXHandler endElement
ADVERTENCIA: java.lang.RuntimeException: Parsing failed for FH_FECHA:
java.lang.IllegalArgumentException: Failed to parse date at:
Parsing failed for FH_FECHA: java.lang.IllegalArgumentException: Failed
to parse date at:
Failed to parse date at:
10-jun-2009 8:55:10 org.geotools.xml.XMLSAXHandler endElement
ADVERTENCIA: Line 11 Col 20
10-jun-2009 8:55:10 org.geotools.data.wfs.v1_0_0.WFSTransactionState commit
ADVERTENCIA: org.geotools.ows.ServiceException:
java.lang.RuntimeException: Parsing failed for FH_FECHA:
java.lang.IllegalArgumentException: Failed to parse date at:
Parsing failed for FH_FECHA: java.lang.IllegalArgumentException: Failed
to parse date at:
Failed to parse date at:
09/06/10 08:55:10 java.io.IOException: An error occured while committing.
09/06/10 08:55:10 at
org.geotools.data.wfs.v1_0_0.WFSTransactionState.commit(WFSTransactionState.java:174)
09/06/10 08:55:10 at
org.geotools.data.DefaultTransaction.commit(DefaultTransaction.java:182)
09/06/10 08:55:10 at
es.dap.sig.web.request.MapRequestManager.addFeatures(MapRequestManager.java:442)
09/06/10 08:55:10 at
es.dap.sig.web.commands.pg.RecursosCommand.insertTransaction(RecursosCommand.java:83)
09/06/10 08:55:10 at
es.dap.sig.web.commands.pg.AbstractEditorCommand.execute(AbstractEditorCommand.java:44)
09/06/10 08:55:10 at
es.dap.sig.web.ControllerServlet.doPost(ControllerServlet.java:38)
09/06/10 08:55:10 at
javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
09/06/10 08:55:10 at
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
09/06/10 08:55:10 at
com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:713)
09/06/10 08:55:10 at
com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
09/06/10 08:55:10 at
com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
09/06/10 08:55:10 at
com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
09/06/10 08:55:10 at
com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221)
09/06/10 08:55:10 at
com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)
09/06/10 08:55:10 at
com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)
09/06/10 08:55:10 at
oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
09/06/10 08:55:10 at
oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)
09/06/10 08:55:10 at
oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)
09/06/10 08:55:10 at
oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)
09/06/10 08:55:10 at
com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
09/06/10 08:55:10 at java.lang.Thread.run(Thread.java:595)

Thanks!

Antonio Redondo Lora escribió:

Hi again.

We're working with DATE type in MySQL

    CREATE TABLE XXX
    (
        ID NUMERIC(11) NOT NULL,
        GEOM GEOMETRY NOT NULL, FH_FECHA DATE, PRIMARY KEY (ID),
        SPATIAL INDEX(GEOM)
    );

An insert testing example (all our WFS requests are made through Geotools):

       GeometryFactory factory = new GeometryFactory();
       Geometry geom = factory.createPoint( new Coordinate(px,py));
       geom.setUserData("EPSG:4326");
              ........

       WFSDataStore wfsDataStore = (new
WFSDataStoreFactory()).createDataStore(map); FeatureSource<SimpleFeatureType, SimpleFeature> featSource =
wfsDataStore.getFeatureSource(nameSpace + layer );
       FeatureStore<SimpleFeatureType, SimpleFeature> featStore =
(FeatureStore<SimpleFeatureType, SimpleFeature>) featSource;
       Transaction insert = new DefaultTransaction("insert");
       featStore.setTransaction(insert);

       SimpleFeatureBuilder featBuilder = new
SimpleFeatureBuilder(featSource.getSchema());
       SimpleFeature feat = featBuilder.buildFeature(null);
       featBuilder.set("ID", new Long(1));
       featBuilder.set("FH_FECHA", new Date());
       featBuilder.set("GEOM", geom);
       FeatureCollection<SimpleFeatureType, SimpleFeature> collection =
FeatureCollections.newCollection();
       collection.add(feat);
             featStore.addFeatures( collection ); insert.commit();

the full stack trace:

    10-jun-2009 8:55:10 org.geotools.data.wfs.v1_0_0.WFSTransactionState
    commit
    ADVERTENCIA: org.geotools.ows.ServiceException:
    java.lang.RuntimeException: Parsing failed for FH_FECHA:
    java.lang.IllegalArgumentException: Failed to parse date at:
    Parsing failed for FH_FECHA: java.lang.IllegalArgumentException:
    Failed to parse date at:
    09/06/10 08:55:10 java.io.IOException: An error occured while
    committing.
    09/06/10 08:55:10 at
    org.geotools.data.wfs.v1_0_0.WFSTransactionState.commit(WFSTransactionState.java:174)
    09/06/10 08:55:10 at
    org.geotools.data.DefaultTransaction.commit(DefaultTransaction.java:182)
    09/06/10 08:55:10 at
    es.dap.sig.web.request.MapRequestManager.addFeatures(MapRequestManager.java:442)
    09/06/10 08:55:10 at
    es.dap.sig.web.commands.pg.RecursosCommand.insertTransaction(RecursosCommand.java:83)
    09/06/10 08:55:10 at
    es.dap.sig.web.commands.pg.AbstractEditorCommand.execute(AbstractEditorCommand.java:44)
    09/06/10 08:55:10 at
    es.dap.sig.web.ControllerServlet.doPost(ControllerServlet.java:38)
    09/06/10 08:55:10 at
    javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
    09/06/10 08:55:10 at
    javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    09/06/10 08:55:10 at
    com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:713)
    09/06/10 08:55:10 at
    com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
    09/06/10 08:55:10 at
    com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
    09/06/10 08:55:10 at
    com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
    09/06/10 08:55:10 at
    com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221)
    09/06/10 08:55:10 at
    com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)
    09/06/10 08:55:10 at
    com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)
    09/06/10 08:55:10 at
    oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
    09/06/10 08:55:10 at
    oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)
    09/06/10 08:55:10 at
    oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)
    09/06/10 08:55:10 at
    oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)
    09/06/10 08:55:10 at
    com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
    09/06/10 08:55:10 at java.lang.Thread.run(Thread.java:595)

MySQL DataStore isn´t implemented for the WFS 1.1, is it?

Thanks!

Justin Deoliveira escribió:
  

I do not know of any open issues of this exact case, but it would not
surprise me. MySQL is unfortunately not one of our best maintained
datstores, and working with dates is always tricky.

Dates in postgis however (and Oracle NG) should work ok, they are
tested pretty thoroughly as part of the WFS 1.1 specification tests
(CITE).

As for your direct problem, can you supply the following:

1) the full stack trace
2) the schema of your data, in particular the exact type of the date
column
3) the request that is being made (if available), or what client you
are using.

Thanks,

-Justin

Antonio Redondo Lora wrote:
    

Hi,

do you know if there is any problems updating features with WFS and the
Geoserver MySQL data store?

I think I've read about similar errors working with java.util.Date and
PostGis or Oracle.

We have the same locale in client and server but after invoking a wfs
addFeatures commit, we have this error in the server log ( ... i think
is throwed on the FeatureType validating):

java.lang.RuntimeException: Parsing failed for FH_FECHA:
java.lang.IllegalArgumentException: Failed to parse date Tue Feb 03
01:00:00 CET 2009 at:Tue Feb 03 01:00:00 CET 2009
        at
org.geotools.xml.impl.ParseExecutor.visit(ParseExecutor.java:158)
        ....

Any advice? Thanks in advance.
Best regardas, Antonio

------------------------------------------------------------------------------

Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects

------------------------------------------------------------------------

_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users
      
  ------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing server and web deployment.
http://p.sf.net/sfu/businessobjects
------------------------------------------------------------------------

_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users
  
--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.