Modify

Opened 5 years ago

Closed 5 years ago

Last modified 4 years ago

#11548 closed defect (fixed)

TMS regression: can not load tiles from file://

Reported by: akks Owned by: wiktorn
Priority: normal Milestone: 15.08
Component: Core imagery Version: latest
Keywords: TMS tiles regression Cc:

Description

On the forum some people complained that they have to use r8159 because newer version does not support file:// in TMS urls (they have some custom downloaded tiles, I hope from allowed sources).

The error look like

ПРЕДУПРЕЖДЕНИЕ: java.lang.ClassCastException: sun.net.www.protocol.file.FileURLC
onnection cannot be cast to java.net.HttpURLConnection
ПРЕДУПРЕЖДЕНИЕ: JCS - Silent failure during download: file:/k:/SASPlanet/cache_g
mt/pskov/z14/4962/9558.png
ПРЕДУПРЕЖДЕНИЕ: JCS - Silent failure during download: file:/k:/SASPlanet/cache_g
mt/pskov/z14/4963/9558.png
ПРЕДУПРЕЖДЕНИЕ: JCS - Silent failure during download: file:/k:/SASPlanet/cache_g
mt/pskov/z14/4962/9559.png
ПРЕДУПРЕЖДЕНИЕ: JCS - Silent failure during download: file:/k:/SASPlanet/cache_g
mt/pskov/z14/4963/9559.png
java.lang.ClassCastException: sun.net.www.protocol.file.FileURLConnection cannot
be cast to java.net.HttpURLConnection
        at org.openstreetmap.josm.data.cache.JCSCachedTileLoaderJob.getURLConnec
tion(JCSCachedTileLoaderJob.java:426)
        at org.openstreetmap.josm.data.cache.JCSCachedTileLoaderJob.loadObject(J
CSCachedTileLoaderJob.java:331)
        at org.openstreetmap.josm.data.cache.JCSCachedTileLoaderJob.run(JCSCache
dTileLoaderJob.java:251)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
java.lang.ClassCastException: sun.net.www.protocol.file.FileURLConnection cannot
be cast to java.net.HttpURLConnection
        at org.openstreetmap.josm.data.cache.JCSCachedTileLoaderJob.getURLConnec
tion(JCSCachedTileLoaderJob.java:426)
        at org.openstreetmap.josm.data.cache.JCSCachedTileLoaderJob.loadObject(J
CSCachedTileLoaderJob.java:331)
        at org.openstreetmap.josm.data.cache.JCSCachedTileLoaderJob.run(JCSCache
dTileLoaderJob.java:251)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

Using ImageryCache plugin with old-style http loader solved the problem.

I have created some patch but it is better to be checked by specialist.
HTTP caching ticked may be related: https://josm.openstreetmap.de/ticket/10139

Compiled .jar with the patch: https://dl.dropboxusercontent.com/u/63393258/josm-custom-nonhttp-cache.jar

Attachments (3)

HttpURL.patch (2.5 KB) - added by akks 5 years ago.
HttpURL.2.patch (3.7 KB) - added by akks 5 years ago.
HttpURL.3.patch (3.7 KB) - added by akks 5 years ago.

Download all attachments as: .zip

Change History (11)

Changed 5 years ago by akks

Attachment: HttpURL.patch added

Changed 5 years ago by akks

Attachment: HttpURL.2.patch added

comment:1 Changed 5 years ago by akks

(sorry, the first patch was unfinished)

Changed 5 years ago by akks

Attachment: HttpURL.3.patch added

comment:2 Changed 5 years ago by Don-vip

Keywords: regression added
Milestone: 15.05

comment:3 Changed 5 years ago by wiktorn

In 8485/josm:

Addresses: #11548 - do not assume, that we work with HTTP based connection for fetching from remote resources

comment:4 Changed 5 years ago by wiktorn

Milestone: 15.0515.06

Thanks for the patch - I applied just slightly modifying it. But I leave this ticket open, as for next release, I'd like to approach this problem a bit differently and revert this changes. I can't do this right now, as it depends on changes, that are not yet in main tree.

comment:5 Changed 5 years ago by wiktorn

Cc: wiktorn removed
Owner: changed from team to wiktorn
Status: newassigned

comment:6 Changed 5 years ago by Don-vip

Milestone: 15.0615.07

skip milestone 15.06

comment:7 Changed 5 years ago by wiktorn

Resolution: fixed
Status: assignedclosed

In 8602/josm:

Properly handle file based tile sources.

  • move getThreadFactory(String name) to Utils class, so it's easily usable across JOSM
  • rollback changes in [8485]
  • detect that we are working with filesystem TileSource in AbstractTileSourceLayer and if so, do not use JCS as caching mechanism, as tiles are already local
  • change return value of getTileSourceInfo in AbstractTileSourceLayer to AbstractTMSTileSource, as this is anyway - lowest we can work with
  • add test data for testing file base tile sources

closes: #11548

comment:8 Changed 4 years ago by Don-vip

Milestone: 15.0715.08

Milestone renamed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain wiktorn.
as The resolution will be set.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.