#17520 closed defect (invalid)
NoSuchMethodError: "java.nio.ByteBuffer.flip()Ljava/nio/ByteBuffer;" on selecting image
Reported by: | taylor.smock | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Core | Version: | |
Keywords: | template_report jcs cache | Cc: | wiktorn |
Description
What steps will reproduce the problem?
- Open JOSM
- Using a tasking manager, start a task
- Download mapillary images
- Click on image icon to load an image
- Crash
What is the expected result?
No crash, images downloaded.
What happens instead?
Crash.
Please provide any additional information below. Attach a screenshot if possible.
Build-Date:2019-03-25 08:19:50 Revision:14930 Is-Local-Build:true Identification: JOSM/1.5 (14930 SVN en) Mac OS X 10.14.3 OS Build number: Mac OS X 10.14.3 (18D109) Memory Usage: 878 MB / 1820 MB (501 MB allocated, but free) Java version: 1.8.0_191-b12, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM Screen: Display 188945226 1920x1080, Display 69978068 2048x1152 Maximum Screen Size: 2048x1152 VM arguments: [-agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:50019, -javaagent:/Applications/Eclipse.app/Contents/Eclipse/configuration/org.eclipse.osgi/231/0/.cp/lib/javaagent-shaded.jar, -Dfile.encoding=UTF-8] Dataset consistency test: No problems found Plugins: + Mapillary (1.5.18) + apache-commons (34506) + apache-http (34632) + auto_tools (67) + buildings_tools (34904) + graphview (34867) + jna (34867) + openqa (1553114521) + osm-obj-info (51) + rex (49) + terracer (34867) + utilsplugin2 (34932) + waydownloader (34867) Map paint styles: + https://josm.openstreetmap.de/josmfile?page=Styles/HiDPISupport&zip=1 + ${HOME}/workspace/osm/JOSM Paint Styles and Presets/Kaart-Styles.mapcss + https://raw.githubusercontent.com/KaartGroup/Kaart-Styles/master/Overlapping%20Ways.mapcss + https://josm.openstreetmap.de/josmfile?page=Styles/Coloured_Streets&zip=1 + https://josm.openstreetmap.de/josmfile?page=Styles/DestinationSignRelation&zip=1 + https://raw.githubusercontent.com/species/josm-preset-traffic_sign_direction/master/direction.mapcss + https://josm.openstreetmap.de/josmfile?page=Styles/Lane_and_Road_Attributes&zip=1 + https://josm.openstreetmap.de/josmfile?page=Styles/Maxspeed&zip=1 + https://josm.openstreetmap.de/josmfile?page=Styles/MaxspeedIcons&zip=1 + https://raw.githubusercontent.com/OpenSidewalks/OpenSidewalks-Schema/master/open_sidewalks.mapcss Validator rules: + ${HOME}/workspace/osm/kaart.validator.mapcss Last errors/warnings: - W: Update plugins - org.openstreetmap.josm.plugins.PluginHandler$UpdatePluginsMessagePanel[,0,0,0x0,invalid,layout=java.awt.GridBagLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=9,maximumSize=,minimumSize=,preferredSize=] - W: No configuration settings found. Using hardcoded default values for all pools. - W: Cannot start IPv4 remotecontrol https server on port 8112: Keystore was tampered with, or password was incorrect - W: Cannot start IPv6 remotecontrol https server on port 8112: Keystore was tampered with, or password was incorrect - W: Expecting test '{0.key} is always in short tons (st)' (i.e., [*[maxweight][maxweight'REGEX'^[0-9.]+$][ParameterFunction~inside(class org.openstreetmap.josm.gui.mappaint.Environment,class java.lang.String <US>)], *[maxaxleload][maxaxleload'REGEX'^[0-9.]+$][ParameterFunction~inside(class org.openstreetmap.josm.gui.mappaint.Environment,class java.lang.String <US>)]]) to match way highway=residential maxweight=5.0 (i.e., TagMap[highway=residential,maxweight=5.0]) - W: Expecting test '{0.key} is always in short tons (st)' (i.e., [*[maxweight][maxweight'REGEX'^[0-9.]+$][ParameterFunction~inside(class org.openstreetmap.josm.gui.mappaint.Environment,class java.lang.String <US>)], *[maxaxleload][maxaxleload'REGEX'^[0-9.]+$][ParameterFunction~inside(class org.openstreetmap.josm.gui.mappaint.Environment,class java.lang.String <US>)]]) to match way highway=residential maxweight=5 (i.e., TagMap[highway=residential,maxweight=5]) - E: Thread main-worker-0 raised java.lang.NoSuchMethodError: java.nio.ByteBuffer.flip()Ljava/nio/ByteBuffer; - E: Handled by bug report queue: java.lang.NoSuchMethodError: java.nio.ByteBuffer.flip()Ljava/nio/ByteBuffer; - E: Handled by bug report queue: java.lang.NoSuchMethodError: java.nio.ByteBuffer.flip()Ljava/nio/ByteBuffer; - W: Warning - <html>JOSM could not find information about the following plugins:<ul><li>auto_tools</li><li>apache-commons</li><li>rex</li><li>Mapillary</li><li>graphview</li><li>osm-obj-info</li><li>utilsplugin2</li><li>openqa</li><li>buildings_tools</li><li>terracer</li><li>jna</li><li>waydownloader</li><li>apache-http</li></ul>The plugins are not going to be loaded.</html> === REPORTED CRASH DATA === BugReportExceptionHandler#handleException: No data collected. Warning issued by: BugReportExceptionHandler#handleException === STACK TRACE === Thread: AWT-EventQueue-0 (22) of main java.lang.NoSuchMethodError: java.nio.ByteBuffer.flip()Ljava/nio/ByteBuffer; at org.apache.commons.jcs.auxiliary.disk.block.BlockDisk.readBlock(BlockDisk.java:336) at org.apache.commons.jcs.auxiliary.disk.block.BlockDisk.read(BlockDisk.java:291) at org.apache.commons.jcs.auxiliary.disk.block.BlockDiskCache.verifyDisk(BlockDiskCache.java:213) at org.apache.commons.jcs.auxiliary.disk.block.BlockDiskCache.<init>(BlockDiskCache.java:144) at org.apache.commons.jcs.auxiliary.disk.block.BlockDiskCacheFactory.createCache(BlockDiskCacheFactory.java:60) at org.apache.commons.jcs.auxiliary.disk.block.BlockDiskCacheFactory.createCache(BlockDiskCacheFactory.java:33) at org.openstreetmap.josm.data.cache.JCSCacheManager.getCacheInner(JCSCacheManager.java:196) at org.openstreetmap.josm.data.cache.JCSCacheManager.getCache(JCSCacheManager.java:179) at org.openstreetmap.josm.plugins.mapillary.cache.Caches$ImageCache.<init>(Caches.java:54) at org.openstreetmap.josm.plugins.mapillary.cache.Caches$ImageCache.getInstance(Caches.java:63) at org.openstreetmap.josm.plugins.mapillary.cache.MapillaryCache.<init>(MapillaryCache.java:46) at org.openstreetmap.josm.plugins.mapillary.gui.MapillaryMainDialog.updateImage(MapillaryMainDialog.java:254) at org.openstreetmap.josm.plugins.mapillary.gui.MapillaryMainDialog.updateImage(MapillaryMainDialog.java:196) at org.openstreetmap.josm.plugins.mapillary.gui.MapillaryMainDialog.selectedImageChanged(MapillaryMainDialog.java:476) at org.openstreetmap.josm.plugins.mapillary.MapillaryData.lambda$fireSelectedImageChanged$3(MapillaryData.java:318) at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184) at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175) at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948) at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418) at org.openstreetmap.josm.plugins.mapillary.MapillaryData.fireSelectedImageChanged(MapillaryData.java:318) at org.openstreetmap.josm.plugins.mapillary.MapillaryData.setSelectedImage(MapillaryData.java:282) at org.openstreetmap.josm.plugins.mapillary.MapillaryData.setSelectedImage(MapillaryData.java:255) at org.openstreetmap.josm.plugins.mapillary.mode.SelectMode.mousePressed(SelectMode.java:83) at java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:280) at java.awt.Component.processMouseEvent(Component.java:6536) at javax.swing.JComponent.processMouseEvent(JComponent.java:3324) at java.awt.Component.processEvent(Component.java:6304) at java.awt.Container.processEvent(Container.java:2239) at java.awt.Component.dispatchEventImpl(Component.java:4889) at java.awt.Container.dispatchEventImpl(Container.java:2297) at java.awt.Component.dispatchEvent(Component.java:4711) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4904) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4532) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4476) at java.awt.Container.dispatchEventImpl(Container.java:2283) at java.awt.Window.dispatchEventImpl(Window.java:2746) at java.awt.Component.dispatchEvent(Component.java:4711) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:760) at java.awt.EventQueue.access$500(EventQueue.java:97) at java.awt.EventQueue$3.run(EventQueue.java:709) at java.awt.EventQueue$3.run(EventQueue.java:703) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:84) at java.awt.EventQueue$4.run(EventQueue.java:733) at java.awt.EventQueue$4.run(EventQueue.java:731) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74) at java.awt.EventQueue.dispatchEvent(EventQueue.java:730) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Attachments (0)
Change History (8)
comment:1 by , 6 years ago
Cc: | added |
---|---|
Keywords: | jcs cache added |
Summary: | Crash on selecting image → NoSuchMethodError: "java.nio.ByteBuffer.flip()Ljava/nio/ByteBuffer;" on selecting image |
comment:2 by , 6 years ago
comment:3 by , 6 years ago
That isn't the same message that you would get for building with JDK > 8.
Its more like an error where you are using methods from Java > 8 and running it with Java 8.
I've had both issues with plugins I've been developing, and I fixed the building issue with
<property name="ant.build.javac.source" value="1.8"/> <property name="ant.build.javac.target" value="1.8"/>
in the build.xml
file (I do have to change 1.8
to 1.9
for javadoc builds).
For the issue with using methods from a newer version of Java, I had to change the Java Build Path of the JRE System Library to explicitly use Java 8 (Java 1.8). This enabled my IDE (Eclipse) to show methods I was using that were not available in Java 8. This is necessary since javac
won't complain about a missing method if that method is present in javac
's java version, even when it is not available on the target version.
That also means that this particular type of issue will not be reproducible if the java
version is the greater than or equal to the javac
java version.
So, modified steps to reproduce:
1) Open JOSM using Java 8 (not Java 9+)
2) Using a tasking manager, start a task (probably not necessary)
3) Download mapillary images
4) Click on image icon to load an image
5) Crash
follow-up: 5 comment:4 by , 6 years ago
Component: | Plugin mapillary → Plugin apache-commons |
---|---|
Owner: | changed from | to
The Mapillary plugin is built using JDK8. The problem here is that Apache Commons JCS uses this flip()
method that is only available in JDK9 or newer: https://github.com/apache/commons-jcs/blob/ad897014842fc830483f32fdfb903f3bb8f70289/commons-jcs-core/src/main/java/org/apache/commons/jcs/auxiliary/disk/block/BlockDisk.java#L336
follow-up: 7 comment:5 by , 6 years ago
Component: | Plugin apache-commons → Core |
---|---|
Owner: | changed from | to
Resolution: | → invalid |
Status: | new → closed |
Replying to floscher:
The Mapillary plugin is built using JDK8. The problem here is that Apache Commons JCS uses this
flip()
method that is only available in JDK9 or newer
No, the method was already used in 2013, before Java 8 was released: https://github.com/apache/commons-jcs/blob/2b9ea32ab82b4b18d4a03e332bd01d4d15ee5d57/src/java/org/apache/commons/jcs/auxiliary/disk/block/BlockDisk.java#L326
I can find it in JDK5 Javadoc.
But you're right it's not caused by Mapillary plugin. It seems JOSM has been compiled with JDK9+, I didn't see this at first:
Identification: JOSM/1.5 (14930 SVN en) Mac OS X 10.14.3
follow-up: 8 comment:6 by , 6 years ago
That is my fault. I should have ensured that I was compiling my test builds with Java 8 instead of system default (Java 11).
So I don't make the same mistake in the future, how did you tell that JOSM was compiled with JDK9+ from Identification: JOSM/1.5 (14930 SVN en) Mac OS X 10.14.3
doesn't seem to have anything that would indicate it.
I'll probably add
<property name="ant.build.javac.source" value="1.8"/> <property name="ant.build.javac.target" value="1.8"/>
to my JOSM build.xml
, just so I don't make a similar mistake again in the future.
comment:7 by , 6 years ago
Replying to Don-vip:
I can find it in JDK5 Javadoc.
Ah, yes. I overlooked the flip()
method in the Javadoc of JDK8, because it was "only" inherited from java.nio.Buffer
in JDK8 and moved to java.nio.ByteBuffer
starting with JDK9.
So that's the explanation why flip()
was already in use before JDK9. But with JDK9 also the return type changed, which causes this problem when compiling with JDK9+, see also https://jira.mongodb.org/browse/JAVA-2559
comment:8 by , 6 years ago
Replying to taylor.smock:
how did you tell that JOSM was compiled with JDK9+ from
Identification: JOSM/1.5 (14930 SVN en) Mac OS X 10.14.3
doesn't seem to have anything that would indicate it.
"SVN" mentions tells me JOSM wasn't built by us, thus it is very likely the bug reporter made a mistake ;)
Florian, did you by chance build the plugin with a JDK > 8?