Modify

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#10219 closed defect (fixed)

NPE in CachedFile.getInputStream during start

Reported by: Hedaja Owned by: team
Priority: blocker Milestone: 14.06
Component: Core Version: latest
Keywords: Cc: bastiK

Description (last modified by Don-vip)

I have had problems stating the latest JOSM version for a while now. Whe stating it says that there was a problem and ask if I want to report it. The loading splash screen gets stuck at "Hintergrundeinstellung laden ("loaing backgroundsettings").
Here is the crash report:


Repository Root: http://josm.openstreetmap.de/svn
Build-Date: 2014-07-02 01:34:24
Last Changed Author: Don-vip
Revision: 7281
Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
URL: http://josm.openstreetmap.de/svn/trunk
Last Changed Date: 2014-07-01 20:31:49 +0200 (Tue, 01 Jul 2014)
Last Changed Rev: 7281

Identification: JOSM/1.5 (7281 de) Linux Ubuntu 14.04 LTS
Memory Usage: 107 MB / 878 MB (52 MB allocated, but free)
Java version: 1.7.0_55, Oracle Corporation, OpenJDK 64-Bit Server VM
Java package: openjdk-7-jre:amd64-7u55-2.4.7-1ubuntu1

Plugin: FixAddresses
Plugin: HouseNumberTaggingTool
Plugin: OpeningHoursEditor
Plugin: RoadSigns
Plugin: buildings_tools
Plugin: contourmerge
Plugin: geochat
Plugin: gpsblam
Plugin: graphview
Plugin: imagery_offset_db
Plugin: kendzi3d
Plugin: kendzi3d-jogl
Plugin: log4j (30416)
Plugin: notes
Plugin: turnlanes
Plugin: turnrestrictions
Plugin: utilsplugin2

java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.NullPointerException
	at org.openstreetmap.josm.Main.<init>(Main.java:569)
	at org.openstreetmap.josm.gui.MainApplication.<init>(MainApplication.java:78)
	at org.openstreetmap.josm.gui.MainApplication.main(MainApplication.java:405)
Caused by: java.util.concurrent.ExecutionException: java.lang.NullPointerException
	at java.util.concurrent.FutureTask.report(FutureTask.java:122)
	at java.util.concurrent.FutureTask.get(FutureTask.java:188)
	at org.openstreetmap.josm.Main.<init>(Main.java:566)
	... 2 more
Caused by: java.lang.NullPointerException
	at java.io.FileInputStream.<init>(FileInputStream.java:138)
	at org.openstreetmap.josm.io.CachedFile.getInputStream(CachedFile.java:179)
	at org.openstreetmap.josm.gui.tagging.TaggingPresetReader.readAll(TaggingPresetReader.java:235)
	at org.openstreetmap.josm.gui.tagging.TaggingPresetReader.readAll(TaggingPresetReader.java:263)
	at org.openstreetmap.josm.gui.tagging.TaggingPresetReader.readFromPreferences(TaggingPresetReader.java:299)
	at org.openstreetmap.josm.gui.tagging.TaggingPresets.readFromPreferences(TaggingPresets.java:36)
	at org.openstreetmap.josm.gui.tagging.TaggingPresets.initialize(TaggingPresets.java:43)
	at org.openstreetmap.josm.Main$3.initialize(Main.java:543)
	at org.openstreetmap.josm.Main$InitializationTask.call(Main.java:607)
	at org.openstreetmap.josm.Main$InitializationTask.call(Main.java:591)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:744)

running: Ubuntu 14.04 64bit

Attachments (0)

Change History (7)

comment:1 by Klumbumbus, 11 years ago

I don't know if this is the reason, but your Java version seems not up to date (atleast for windows the latest version is 1.7.0_60).

comment:2 by Don-vip, 11 years ago

Description: modified (diff)

comment:3 by Don-vip, 11 years ago

Cc: bastiK added
Keywords: error start removed
Milestone: 14.06

Regression of r7248?
What should we do if file is null for an URL not starting by resource ? Definitively not throwing an NPE at least :)

    /**
     * Get InputStream to the requested resource.
     * @return the InputStream
     * @throws IOException when the resource with the given name could not be retrieved
     */
    public InputStream getInputStream() throws IOException {
        File file = getFile();
        if (file == null) {
            if (name.startsWith("resource://")) {
                InputStream is = getClass().getResourceAsStream(
                        name.substring("resource:/".length()));
                if (is == null)
                    throw new IOException(tr("Failed to open input stream for resource ''{0}''", name));
                return is;
            }
        }
        return new FileInputStream(file);
    }

comment:4 by Don-vip, 11 years ago

Summary: JOSM starting errorNPE in CachedFile.getInputStream during start

in reply to:  1 comment:5 by anonymous, 11 years ago

Replying to Klumbumbus:

I don't know if this is the reason, but your Java version seems not up to date (atleast for windows the latest version is 1.7.0_60).

My system is updated. Java 1.70_55 is the latest version that's offered by the ubuntu main repostitory.
Im running the same system on my netbook and don't have any problems there.

comment:6 by bastiK, 11 years ago

Resolution: fixed
Status: newclosed

In 7282/josm:

fixed #10219 - NPE in CachedFile.getInputStream during start

comment:7 by Hedaja, 11 years ago

Your patch works fine
Thanks for the quick response and keep up the good work

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
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.