Hi, I just made a test with two types of data store (shapefile and postgis), and both fail with the exception (and an unfortunate 404 exception code, it should be 500 IMHO) if the connection parameters are not correct:
Could not load datastore: <datastore_name> Note that this will only fail if the *list=all* query parameter is provided, otherwise only the configured layers for the data store will be listed and indeed in that case no exception will be returned (which is the correct behavior). Please double check that you are targeting a data store with invalid connection parameters and using the *list=all* query parameter and that no cache is happening. If you still don't see any exception message I will suggest you to open a JIRA ticket describing the issue and how to reproduce it. If you want to take a look at code you should look here: https://github.com/nmco/geoserver/blob/a2cb6f17455231decd4b0b4de28e9825bb8ba2cc/src/restconfig/src/main/java/org/geoserver/rest/catalog/FeatureTypeController.java#L83-L149 Hoper it helps, Nuno Oliveira On 09/27/2017 12:19 PM, Anton Bakker wrote:
Hi all, I am trying to determine through the REST API whether the connection details for a given datastore is valid. In the web interface a user receives an error message (https://i.imgur.com/Aa61yFX.png) when trying to configure a datastore with invalid connection details, but in the REST API I cannot find a way to determine whether a datastore is valid. When using the REST API GeoServer lets me create a new datastore with invalid connection details. When I check for the number of available featuretypes in the invalid datastore through the REST API, the request completes successfully: REQUEST: GET http://daneel:8080/geoserver/rest/workspaces/world/datastores/da00bb64-f124-4d9c-be2a-89fd94bb09df/featuretypes.xml?list=all HTTP/1.1 RESPONSE BODY: <featureTypes/> However, I would expect GeoServer to return an error since GS cannot determine the number of featuretypes in the datastore, since it cannot connect to the datastore. Can this be seen as a bug? Or is there another way to validate datastore configurations through the REST API? Cheers, Anton ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Geoserver-users mailing list Please make sure you read the following two resources before posting to this list: - Earning your support instead of buying it, but Ian Turton: http://www.ianturton.com/talks/foss4g.html#/ - The GeoServer user list posting guidelines: http://geoserver.org/comm/userlist-guidelines.html [email protected] https://lists.sourceforge.net/lists/listinfo/geoserver-users
-- Regards, Nuno Oliveira == GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information. == Nuno Miguel Carvalho Oliveira @nmcoliveira Software Engineer GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa (LU) Italy phone: +39 0584 962313 fax: +39 0584 1660272 http://www.geo-solutions.it http://twitter.com/geosolutions_it ------------------------------------------------------- AVVERTENZE AI SENSI DEL D.Lgs. 196/2003 Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora riceviate questo messaggio senza esserne il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse, costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003.The information in this message and/or attachments, is intended solely for the attention and use of the named addressee(s) and may be confidential or proprietary in nature or covered by the provisions of privacy act (Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection Code).Any use not in accord with its purpose, any disclosure, reproduction, copying, distribution, or either dissemination, either whole or partial, is strictly forbidden except previous formal approval of the named addressee(s). If you are not the intended recipient, please contact immediately the sender by telephone, fax or e-mail and delete the information in this message that has been received in error. The sender does not give any warranty or accept liability as the content, accuracy or completeness of sent messages and accepts no responsibility for changes made after they were sent or for other risks which arise as a result of e-mail transmission, viruses, etc.
------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________ Geoserver-users mailing list Please make sure you read the following two resources before posting to this list: - Earning your support instead of buying it, but Ian Turton: http://www.ianturton.com/talks/foss4g.html#/ - The GeoServer user list posting guidelines: http://geoserver.org/comm/userlist-guidelines.html [email protected] https://lists.sourceforge.net/lists/listinfo/geoserver-users
