Hi all,
the error comes out when I use "Measure area" tool /First icon from the left) in the drag mode (not in drawing mode)
[ERROR] 20:16:07.262 'boolean org.locationtech.jts.geom.CoordinateList.add(org.locationtech.jts.geom.Coordinate)'
java.lang.NoSuchMethodError: 'boolean org.locationtech.jts.geom.CoordinateList.add(org.locationtech.jts.geom.Coordinate)'
at org.openjump.core.ui.plugin.measuretoolbox.cursortools.MeasureRectangleTool.getRectangleCoordinates(MeasureRectangleTool.java:134)
at org.openjump.core.ui.plugin.measuretoolbox.cursortools.MeasureRectangleTool.toFeature(MeasureRectangleTool.java:146)
at org.openjump.core.ui.plugin.measuretoolbox.cursortools.MeasureRectangleTool.gestureFinished(MeasureRectangleTool.java:94)
at com.vividsolutions.jump.workbench.ui.cursortool.AbstractCursorTool.fireGestureFinished(AbstractCursorTool.java:616)
at com.vividsolutions.jump.workbench.ui.cursortool.DragTool.mouseReleased(DragTool.java:172)
at com.vividsolutions.jump.workbench.ui.cursortool.OrCompositeTool.mouseReleased(OrCompositeTool.java:121)
at com.vividsolutions.jump.workbench.ui.cursortool.LeftClickFilter.mouseReleased(LeftClickFilter.java:94)
at com.vividsolutions.jump.workbench.ui.cursortool.DelegatingTool.mouseReleased(DelegatingTool.java:105)
at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:298)
at java.desktop/java.awt.Component.processMouseEvent(Component.java:6635)
at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3342)
at java.desktop/java.awt.Component.processEvent(Component.java:6400)
at java.desktop/java.awt.Container.processEvent(Container.java:2263)
at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5011)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4843)
at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918)
at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547)
at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)
at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2772)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4843)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
I download the code and opened into Eclipse but I didn't find any error
Peppe
Hi,
Quite strange error. I think fix would be easy by using an alternative method like CoordinateList.add(Coordinate,boolean), but I would rather understand what happens.
In the past few years, CoordinateList.add(Coordinate) has been added to CoordinateList class with a signature incompatible with the signature of its parent class ArrayList (void add(Coordinate) instead of boolean add(Coordinate)), then the return type has been fixed in 2019, and finally the method has been removed in 1.18.2 as it did nothing else than calling the parent method.
My hypothesis is a mix of jts 1.18.1 and jts 1.18.2 usage between core and extension (this upgrade is quite recent and I can see that 1.18.1 is referenced on https://ojrepo.soldin.de/org/openjump/OpenJUMP/2.0-SNAPSHOT/OpenJUMP-2.0-20210515.224708-6.pom
Ede, any hint ? Can we try to synchronize github pom and ojrepo before trying to fix the problem in the code ?
Michaël
Related
Bugs:
#521as the extensions currently compile against the snapshots, they inherit OJ2 snaphots dependency incl, jts version. measure-tools extension was build on 25.Aug. Mike changed jts from 1.18.1 to 1.18.2 on 5.Sep. so maybe recompiling might help.
Mike, wanna try to upgrade the extension from git as an exercise?
and finally
i cannot seem to replicate. can one of you pls write down a quick step-by-step in gui so the code get's executed?
..ede
Hi Ede,
I tried to follow your procedure, but I can't build OpenJUMP against the new measure-toolbox-extension-2.1.1-alpha release because of the sha1 checksum.
I updated OpenJUMP pom with the checksum taken from measure-toolbox-extension-2.1.1-alpha.zip.sha1 (github.com) computed at the same time as the .zip itself
Here after the message I get while building the project with maven
Any idea ?
Michaël
[INFO] Downloading: https://github.com/openjump-gis/measure-toolbox-extension/releases/download/2.1.1-alpha/measure-toolbox-extension-2.1.0-alpha.zip
[INFO] 9/?
[INFO] downloaded 9
[WARNING] Could not get content
org.apache.maven.plugin.MojoFailureException: Not same digest as expected: expected <9e98d3419ae3a857c9ffcf85d0a073d22322782b> was <d205cbd6783332a212c5ae92d73c77178c2d2f28>
at com.googlecode.download.maven.plugin.internal.ChecksumUtils.verifyChecksum (ChecksumUtils.java:35)
Related
Bugs:
#521hey Mike,
looks like a user error. the correct checksum is indeed
but you seem to have entered
d205cbd6783332a212c5ae92d73c77178c2d2f28. at least that's what the error suggests. ..edeHi,
My fault, checksum was ok, but I did a mistake in the file name.
I could compile and package locally now, but it still throws an exception.
The only thing I can think about is that measure-toolbox still compile against https://ojrepo.soldin.de/ which reference 1.18.1
Michaël
Sorry, https://ojrepo.soldin.de "2.0-SNAPSHOT" is referencing jts1.18.1 but "2.0-main-SNAPSHOT" is referencing jts 1.18.2 and measure-toolbox is pointing to the second. So I have no idea about what happens.
By the way, is there a reason to keep 2 snapshots in the repo ?
Michaël
On 21.11.2021 17:02, michael michaud wrote:
yeah and extension are compiled against 2.0-main-SNAPSHOT currently, hence jts 1.18.2 .
let me see if can get the issue replicated. it's probably something simple, as usual.
nope, just a leftover. deleted it just now. ..ede
tried
OpenJUMP-20211017-r4998(f9296be)-PLUSnote r4998, r4996 does not existwith
and both measurement cursol tools seem to work fine. see attached
Last edit: ede 2021-11-22
Hi Ede,
Are you sure you tested the extension from the plugins menu and using the drag mode as stated by Peppe and not the measure tool of the toolbar which works fine for me also ?
Michaël
Related
Bugs:
#521that's why i asked for a step-by-step before to reproduce it ;) . indeed using the 'measure rectangle' from Plugins->Measure Toolbox to draw a rectangle eventually throws the exception.
some more investigation shows the removal of the CoordinateList:add(Element) method without any explanation
https://github.com/locationtech/jts/commit/539ef272f20507cfd666f5c219f9af150b593604#diff-6557bc7f05fd4b213b0647f7457ac9c76c8dbff501ba38a1c040dc8e4f1bbb4dL67
but surely the public ArrayList:add(Element e) should be available as CoordinateList extends that class.
hey Mike,
ok, now did exactly what we figured
first ran OJ2 from IDE including the measure-extension project classes. worked fine.
then i ran
mvn packageand used the resulting extension jar. worked fine too.just to make sure - downloaded
OpenJUMP-20211017-r4998(f9296be)-PLUSagain. reproduced the error. renamed old tomeasure-toolbox-extension-2.1.0.jar.sav, added rebuiltmeasure-toolbox-extension-2.1.0.jar. started OJ2. all good.fix is pushed now. i removed your release for cleanliness. the resulting snapshot needs to be tested still. will have a look tomorrow then.
On 23.11.2021 00:51, ede wrote:
tested and looks good.. ede