Modify

Opened 9 years ago

Closed 9 years ago

Last modified 9 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 9 years ago.
HttpURL.2.patch (3.7 KB ) - added by akks 9 years ago.
HttpURL.3.patch (3.7 KB ) - added by akks 9 years ago.

Download all attachments as: .zip

Change History (11)

by akks, 9 years ago

Attachment: HttpURL.patch added

by akks, 9 years ago

Attachment: HttpURL.2.patch added

comment:1 by akks, 9 years ago

(sorry, the first patch was unfinished)

by akks, 9 years ago

Attachment: HttpURL.3.patch added

comment:2 by Don-vip, 9 years ago

Keywords: regression added
Milestone: 15.05

comment:3 by wiktorn, 9 years ago

In 8485/josm:

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

comment:4 by wiktorn, 9 years ago

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 by wiktorn, 9 years ago

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

comment:6 by Don-vip, 9 years ago

Milestone: 15.0615.07

skip milestone 15.06

comment:7 by wiktorn, 9 years ago

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 by Don-vip, 9 years ago

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. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.