In summary, I am unable to use PUT modify either of the following without 
getting a com.sun.proxy.$Proxy error using geoserver 2.13.2 on Windows.

/imports/<importId>/task/<taskId>
/imports/<importId>/tasks/<taskId>/layer

Any help is a blessing.  Thanks once again!

Ashley Mort
Sr. Software Engineer
972-638-6317 office
814-571-3039 cell

From: Ashley Mort
Sent: Friday, August 17, 2018 5:44 PM
To: geoserver-users@lists.sourceforge.net
Subject: [External] [Geoserver-users] another Importer REST question

I am trying to handle importing multiple layers with the same name in the REST 
interface.  If I use the web interface (Import Data link) and I import A.TOC 
from one folder and an A.TOC from another data folder then it will create me 
two data stores which work great (A and A0).  Is there a way to duplicate this 
behavior with the REST interface?  I will try to explain what I have tried.

I tried to edit the targetStore/dataStore name in my rest/imports POST but that 
fails and says the targetStore doesn't exist.  I have tried to use PUT to edit 
the coverageStore:name or layer:name in the rest/imports/0/tasks/0 but those 
error out saying store doesn't exist or layer doesn't exist.  It looks like I 
can't change anything with the "task" with PUT even if it's in the "READY" (not 
executed) state.

Is there any way to use the Importer REST interface to load 2 files with the 
same name and change either the store or layer name so they are both created?  
For example A and A0 for my layers just like the web interface creates?  I 
would be happy if I could change either the store name or layer name via REST 
without losing the feature that auto-detects and creates my store.


POST http://localhost:12121/geoserver/rest/imports
{"import":
    
{"targetWorkspace":{"workspace":{"name":"VegaWorkspace"}},"data":{"type":"file",
"file":"D:\\testdata\\RPF\\CDRG\\GNC\\RPF\\A.TOC"}}}

POST http://localhost:12121/geoserver/rest/imports/0
---- the above works great----


POST http://localhost:12121/geoserver/rest/imports
{"import":
    
{"targetWorkspace":{"workspace":{"name":"VegaWorkspace"}},"data":{"type":"file",
"file":"D:\\testdata\\RPF\\CDRG\\TPC\\RPF\\A.TOC"}}}

POST http://localhost:12121/geoserver/rest/imports/1
---this fails with the error below---
17 Aug 17:29:45 WARN [geoserver.importer] - Task failed during import: 
org.geoserver.importer.ImportTask@b05<mailto:org.geoserver.importer.ImportTask@b05>
java.lang.ClassCastException: com.sun.proxy.$Proxy25 cannot be cast to 
org.geoserver.catalog.impl.ResourceInfoImpl
        at org.geoserver.catalog.impl.CatalogImpl.resolve(CatalogImpl.java:1664)
        at org.geoserver.catalog.impl.CatalogImpl.add(CatalogImpl.java:393)
        at 
org.geoserver.security.SecureCatalogImpl.add(SecureCatalogImpl.java:1202)
        at 
org.geoserver.catalog.impl.AbstractFilteredCatalog.add(AbstractFilteredCatalog.java:586)
        at 
org.geoserver.catalog.impl.AbstractCatalogDecorator.add(AbstractCatalogDecorator.java:205)
        at org.geoserver.importer.Importer.addToCatalog(Importer.java:1524)
        at org.geoserver.importer.Importer.doDirectImport(Importer.java:1030)



---

Ashley Mort
Sr. Software Engineer
972-638-6317 office
814-571-3039 cell

------------------------------------------------------------------------------
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

If you want to request a feature or an improvement, also see this: 
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


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

Reply via email to