Modify

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#19297 closed defect (worksforme)

IndexOutOfBoundsException when Starting JOSM

Reported by: GhostFoxSledgehammer Owned by: team
Priority: normal Milestone:
Component: Core Version: latest
Keywords: template_report Cc: taylor.smock

Description (last modified by GhostFoxSledgehammer)

What steps will reproduce the problem?

  1. Change value of "shortcut.entry.mapillary:jump_to_previous" in Advanced Preferences to 'e'.
  2. Start JOSM

What is the expected result?

Normal Start

What happens instead?

Encountered a bug after which JOSM didn't open.

Please provide any additional information below. Attach a screenshot if possible.

URL:https://josm.openstreetmap.de/svn/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2020-05-24 22:20:58 +0200 (Sun, 24 May 2020)
Build-Date:2020-05-25 01:30:47
Revision:16498
Relative:URL: ^/trunk

Identification: JOSM/1.5 (16498 en) Windows 10 64-Bit
OS Build number: Windows 10 Home Single Language 1909 (18363)
Memory Usage: 646 MB / 1788 MB (497 MB allocated, but free)
Java version: 1.8.0_242-b08, AdoptOpenJDK, OpenJDK 64-Bit Server VM
Screen: \Display0 1920x1080
Maximum Screen Size: 1920x1080

Plugins:
+ Mapillary
+ apache-commons
+ apache-http
+ javafx-windows (35375)
+ jna

Last errors/warnings:
- W: java.nio.file.FileSystemException: %UserProfile%\AppData\Local\Temp\josm_exec_powershell_3647121534526975398.txt: The process cannot access the file because it is being used by another process.
- W: Unable to request certificate of https://grca.nat.gov.tw
- W: java.nio.file.FileSystemException: %UserProfile%\AppData\Local\Temp\josm_exec_powershell_1493966417870299100.txt: The process cannot access the file because it is being used by another process.
- W: Unable to request certificate of https://grca.nat.gov.tw
- E: JavaFX is not available
- W: Disable plugin - JavaFX is not available. Please update to Java 11+.
- E: Handled by bug report queue: java.lang.IndexOutOfBoundsException: Index: 1, Size: 1


=== REPORTED CRASH DATA ===
BugReportExceptionHandler#handleException:
No data collected.

Warning issued by: BugReportExceptionHandler#handleException

=== STACK TRACE ===
Thread: main (1)
java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
	at java.util.ArrayList.rangeCheck(ArrayList.java:657)
	at java.util.ArrayList.get(ArrayList.java:433)
	at org.openstreetmap.josm.tools.Shortcut.<init>(Shortcut.java:178)
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
	at java.util.LinkedList$LLSpliterator.forEachRemaining(LinkedList.java:1235)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
	at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
	at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.util.stream.ReferencePipeline.forEachOrdered(ReferencePipeline.java:490)
	at org.openstreetmap.josm.tools.Shortcut.doInit(Shortcut.java:418)
	at org.openstreetmap.josm.tools.Shortcut.registerShortcut(Shortcut.java:524)
	at org.openstreetmap.josm.tools.Shortcut.registerShortcut(Shortcut.java:519)
	at org.openstreetmap.josm.actions.NewAction.<init>(NewAction.java:25)
	at org.openstreetmap.josm.gui.MainMenu.<init>(MainMenu.java:161)
	at org.openstreetmap.josm.gui.MainFrame.initialize(MainFrame.java:81)
	at org.openstreetmap.josm.gui.MainApplication.initializeMainWindow(MainApplication.java:388)
	at org.openstreetmap.josm.spi.lifecycle.InitializationTask.call(InitializationTask.java:33)
	at org.openstreetmap.josm.spi.lifecycle.Lifecycle.runInitializationTasks(Lifecycle.java:99)
	at org.openstreetmap.josm.spi.lifecycle.Lifecycle.initialize(Lifecycle.java:71)
	at org.openstreetmap.josm.gui.MainApplication.mainJOSM(MainApplication.java:914)
	at org.openstreetmap.josm.gui.MainApplication$3.processArguments(MainApplication.java:276)
	at org.openstreetmap.josm.gui.MainApplication.main(MainApplication.java:712)

=== RUNNING THREADS ===
Thread: TimerQueue (21) of system
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
java.util.concurrent.DelayQueue.take(DelayQueue.java:223)
javax.swing.TimerQueue.run(TimerQueue.java:174)
java.lang.Thread.run(Thread.java:748)

Thread: Java2D Disposer (13) of system
java.lang.Object.wait(Native Method)
java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:144)
java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:165)
sun.java2d.Disposer.run(Disposer.java:148)
java.lang.Thread.run(Thread.java:748)

Thread: Attach Listener (5) of system

Thread: Signal Dispatcher (4) of system

Thread: Thread-6 (24) of main
sun.nio.fs.WindowsNativeDispatcher.GetQueuedCompletionStatus0(Native Method)
sun.nio.fs.WindowsNativeDispatcher.GetQueuedCompletionStatus(WindowsNativeDispatcher.java:1007)
sun.nio.fs.WindowsWatchService$Poller.run(WindowsWatchService.java:586)
java.lang.Thread.run(Thread.java:748)

Thread: File Watcher (25) of main
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
java.util.concurrent.LinkedBlockingDeque.takeFirst(LinkedBlockingDeque.java:492)
java.util.concurrent.LinkedBlockingDeque.take(LinkedBlockingDeque.java:680)
sun.nio.fs.AbstractWatchService.take(AbstractWatchService.java:118)
org.openstreetmap.josm.io.FileWatcher.processEvents(FileWatcher.java:120)
org.openstreetmap.josm.io.FileWatcher$$Lambda$145/1630678941.run(Unknown Source)
java.lang.Thread.run(Thread.java:748)

Thread: Finalizer (3) of system
java.lang.Object.wait(Native Method)
java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:144)
java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:165)
java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:216)

Thread: Reference Handler (2) of system
java.lang.Object.wait(Native Method)
java.lang.Object.wait(Object.java:502)
java.lang.ref.Reference.tryHandlePending(Reference.java:191)
java.lang.ref.Reference$ReferenceHandler.run(Reference.java:153)

Thread: main (1)
Stacktrace see above.

Thread: AWT-EventQueue-0 (19) of main
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
java.awt.EventQueue.getNextEvent(EventQueue.java:554)
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:187)
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

Thread: AWT-Windows (16) of system
sun.awt.windows.WToolkit.eventLoop(Native Method)
sun.awt.windows.WToolkit.run(WToolkit.java:316)
java.lang.Thread.run(Thread.java:748)

Thread: AWT-Shutdown (20) of system
java.lang.Object.wait(Native Method)
java.lang.Object.wait(Object.java:502)
sun.awt.AWTAutoShutdown.run(AWTAutoShutdown.java:295)
java.lang.Thread.run(Thread.java:748)

Attachments (0)

Change History (12)

comment:1 by skyper, 5 years ago

Cc: taylor.smock added

This seems to be related to Mapillary. Does it happen without the plugin?

comment:2 by taylor.smock, 5 years ago

Have you made any code modifications yet? (JOSM/Mapillary/JNA/javafx/apache-commons/apache-http)

Also, can you use OpenJDK 11+ or Oracle Java? (You can set the Java compatibility and compilation target in Eclipse. It is also set in the gradle build file). Unfortunately, OpenJDK 8 doesn't work well with OpenJFX (although Linux distributions have made it work).

If you are able to do this consistently, I would (in Eclipse) add a conditional breakpoint in Shortcut.java on line 176 with the following condition:

s.size() < 2

(@GhostFoxSledgeHammer: If you are running into issues, please add me to the cc in the bug report, especially if they only occur with the Mapillary plugin).

@skyper: As an FYI, GhostFoxSledgehammer is working on the Mapillary plugin for GSOC (hence the breakpoint information) and the other questions/comments.

comment:3 by GhostFoxSledgehammer, 5 years ago

@skyper It's not exactly related to Mapillary as I did try removing Mapillary.jar. I actually broke preferences.xml, I was setting a shortcut for "shortcut.entry.mapillary:jump_to_previous" and replaced the value with 'e'. I deleted preferences.xml and it was back to normal.

@taylor.smock I did modify Mapillary but same problem was with Mapillary v1.5.23 and JOSM-tested. I have both Java 8 and OpenJDK 8 and tried with both(running josm.exe uses OracleJava8 and directly opened jar files use OpenJDK 8).

I changed the shortcut once again and ran into the same problem so I guess it was due to ill formatting shortcut value.

comment:4 by GhostFoxSledgehammer, 5 years ago

Description: modified (diff)

comment:5 by taylor.smock, 5 years ago

Why aren't you using the built-in Keyboard Shortcuts preference panel to change shortcuts?

in reply to:  5 comment:6 by GhostFoxSledgehammer, 5 years ago

Replying to taylor.smock:

Why aren't you using the built-in Keyboard Shortcuts preference panel to change shortcuts?

I don't know what's it called but I'm not seeing any option for "jump_to_previous" or anything like that.

comment:7 by taylor.smock, 5 years ago

You might want to take a look at the javadoc for Shortcut.registerShortcut.

Here is a link to the specific line: https://josm.openstreetmap.de/browser/josm/trunk/src/org/openstreetmap/josm/tools/Shortcut.java#L511 .

If you aren't using Shortcut.registerShortcut, you should.

If you are looking at Shortcut.registerShortcut("mapillary:jump_to_previous", tr("Jump to previous image"), KeyEvent.VK_PAGE_UP, Shortcut.DIRECT), the text you want to search for is Jump to previous image (or the translated version).

in reply to:  7 ; comment:8 by GhostFoxSledgehammer, 5 years ago

Replying to taylor.smock:

If you aren't using Shortcut.registerShortcut, you should.

Sorry, I was searching for the shortcut before opening any layer, so there was no shortcut to show from Mapillary.

in reply to:  8 comment:9 by taylor.smock, 5 years ago

Replying to GhostFoxSledgehammer:

Replying to taylor.smock:

If you aren't using Shortcut.registerShortcut, you should.

Sorry, I was searching for the shortcut before opening any layer, so there was no shortcut to show from Mapillary.

OK. I usually put the shortcut registration in the initialization for the applicable code, which means that it needs to be initialized before the shortcut shows up in preferences.

comment:10 by GhostFoxSledgehammer, 5 years ago

Resolution: fixed
Status: newclosed

comment:11 by GhostFoxSledgehammer, 5 years ago

Summary: IndexOutOfBoundsException when restarting JOSMIndexOutOfBoundsException when Starting JOSM

comment:12 by simon04, 5 years ago

Resolution: fixedworksforme

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.