Modify

Opened 6 years ago

Closed 6 years ago

#8900 closed defect (fixed)

reverter plugin crashing when starting JOSM (r6081)

Reported by: rickmastfan67 Owned by: Upliner
Priority: critical Milestone:
Component: Plugin reverter Version: latest
Keywords: Cc:

Description (last modified by rickmastfan67)

I just downloaded the new update to the reverter plugin ([o29769]), and then restarted JOSM. The plugin crashed. Looks like the update needed to have the minversion bumped up so that you couldn't download it without [6082] or higher..

loading plugin 'reverter' (version 29769)
An error occurred in plugin reverter java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at org.openstreetmap.josm.plugins.PluginInformation.load(PluginInformation.java:295)
        at org.openstreetmap.josm.plugins.PluginHandler.loadPlugin(PluginHandler.java:523)
        at org.openstreetmap.josm.plugins.PluginHandler.loadPlugins(PluginHandler.java:592)
        at org.openstreetmap.josm.plugins.PluginHandler.loadLatePlugins(PluginHandler.java:631)
        at org.openstreetmap.josm.gui.MainApplication.main(MainApplication.java:351)
Caused by: java.lang.IllegalArgumentException: illegal component position
        at java.awt.Container.addImpl(Unknown Source)
        at java.awt.Container.add(Unknown Source)
        at org.openstreetmap.josm.gui.MainMenu.addMenu(MainMenu.java:423)
        at org.openstreetmap.josm.gui.MainMenu.addMenu(MainMenu.java:417)
        at reverter.ReverterPlugin.<init>(ReverterPlugin.java:22)
        ... 9 more
Repository Root: http://josm.openstreetmap.de/svn
Build-Date: 2013-07-24 01:34:52
Last Changed Author: Don-vip
Revision: 6081
Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
URL: http://josm.openstreetmap.de/svn/trunk
Last Changed Date: 2013-07-24 00:12:04 +0200 (Wed, 24 Jul 2013)
Last Changed Rev: 6081

Identification: JOSM/1.5 (6081 en) Windows 7 64-Bit
Memory Usage: 218 MB / 2730 MB (116 MB allocated, but free)
Java version: 1.7.0_25, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM
VM arguments: [-Xmx3072M]

Plugin: ImageryCache (29690)
Plugin: OpeningHoursEditor (29435)
Plugin: buildings_tools (29596)
Plugin: mapdust (29525)
Plugin: measurement (29750)
Plugin: mirrored_download (29643)
Plugin: openstreetbugs (29435)
Plugin: osmarender (29639)
Plugin: reverter
Plugin: turnrestrictions (29435)
Plugin: undelete (29555)
Plugin: utilsplugin2 (29769)

Attachments (0)

Change History (18)

comment:1 Changed 6 years ago by rickmastfan67

Description: modified (diff)

comment:2 Changed 6 years ago by akks

should be fixed now in [o29771]

Last edited 6 years ago by akks (previous) (diff)

comment:3 Changed 6 years ago by akks

oops, will the old josm get the previous non-working jar? Can someone delete it from svn or replace with the untouched one?
( I forgot to do 2-step updating.)

comment:4 in reply to:  3 Changed 6 years ago by rickmastfan67

Replying to akks:

oops, will the old josm get the previous non-working jar?

Yes. JOSM is still suggesting the bad version to be downloaded in [6081].

comment:5 Changed 6 years ago by akks

I noticed the link was fixed ("external source") and no error appear for older JOSM.
Unfortunately, reverter's History menu does not appear too... We need revision [o29664] of reverter jar for old JOSM and [o29772] for newer one.

comment:6 Changed 6 years ago by Don-vip

Resolution: fixed
Status: newclosed

No problem today with r6082.

comment:7 Changed 6 years ago by akks

Resolution: fixed
Status: closedreopened

I am afraid on older JOSM (I testd on 6062) we have rather big problem:
reverter, LiveGPS and CommandLine jars are broken, they do not start because of exceptions...

I do not know the way to fix older plugin jar but Stoecker said this is possible. This is really needed.

comment:8 Changed 6 years ago by stoecker

JOSM server manages a list of each SVN/plugin to JOSM main version. If I should remove any old release from the table, please tell me which releases are defective.

comment:9 in reply to:  7 Changed 6 years ago by rickmastfan67

Replying to akks:

I am afraid on older JOSM (I testd on 6062) we have rather big problem:
reverter, LiveGPS and CommandLine jars are broken, they do not start because of exceptions...

Yes, this can be a big problem with the "tested" build people. If they are upgraded to the "bad" versions, then the bug tracker here will get flooded with reports.

comment:10 Changed 6 years ago by stoecker

I removed "29769 => 29770" for reverter and livegps. For commandline there is no newer josm.main version entry than 5960.

comment:11 Changed 6 years ago by akks

Thank you!

The nontrivial problem was that newly created menu tries to use the position constant it has at compilation time (=11), so if there are <11 items in main menu, it crashes. I tested with all plugins installed and did not notice it.
So [o29769] / [o29770] were crashing.

Reverter and LiveGPS are fixed, Utilsplugin2 was not broken, but CommandLine still tries to use position "11" and crash when there are few plugins installed.

Later (this evening) I will compile CommandLine with older JOSM, commit it and then recompile under JOSM 6082 and recommit with minimal JOSM version 6082 to close this bug.

Last edited 6 years ago by akks (previous) (diff)

comment:12 Changed 6 years ago by akks

We have one potential problem too: is someone will recompile any other plugin with menu (3D, Scripting, ....) and commit the changes, it will be broken for all older JOSM versions due to the constant "11". Should we put

 public final int defaultMenuPos = 7;

again to avoid such problem? (then only one recommitting of CommandLine will close the bug, but the menu entries will start "jumping" after base version change)

Last edited 6 years ago by akks (previous) (diff)

comment:13 Changed 6 years ago by AlfonZ

How about something like

  • src/org/openstreetmap/josm/gui/MainMenu.java

     
    250250    public JMenu audioMenu = null;
    251251    public final JMenu helpMenu = addMenu(marktr("Help"), KeyEvent.VK_H, 11, ht("/Menu/Help"));
    252252
    253     public final int defaultMenuPos = 11;
     253    private final int defaultMenuPos = 11;
     254   
     255    public int getDefaultMenuPos() {
     256        return defaultMenuPos;
     257    }
    254258
    255259    public final JosmAction moveUpAction = new MoveAction(MoveAction.Direction.UP);
    256260    public final JosmAction moveDownAction = new MoveAction(MoveAction.Direction.DOWN);

It should avoid any such future problems.
If they have old JOSM version, it compiles and runs on old JOSM OK.
If they have new JOSM version, it fails to compile, forcing them to bump minimum JOSM version.

comment:14 Changed 6 years ago by stoecker

Sounds good. If we spot such issues we should prevent them in future releases.

comment:15 Changed 6 years ago by akks

In 6088/josm:

see #8900 [patch by AlfonZ] - prevent menu-related exceptions for plugins
(force menu-adding plugins to use JOSM 6088 to compile)

comment:16 Changed 6 years ago by akks

I tried to fix CommandLine and VideoMapping on older JOSM and then forced them and 8 more plugins to use [6088] with the new function.
Now it should be impossible to get an exception.

(Scripting and 3D plugin menus are still inserted on position 7)

Last edited 6 years ago by akks (previous) (diff)

comment:17 Changed 6 years ago by Don-vip

Can we close this ticket ? :)

comment:18 Changed 6 years ago by Don-vip

Resolution: fixed
Status: reopenedclosed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Upliner.
as The resolution will be set.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.