Hi Josm Devs!

TLDR: I can't access any classes from other plugins, I receive a
ClassNotFoundException.
This did work before (working on 12321, broken on 12327)

I wanted to update the areaselector plugin (
https://github.com/JOSM/areaselector) and include new functionality which
is based on utilsplugin2. I am able to compile my code, but on runtime it
failed to load the ReplaceGeometryUtils class with a
ClassNotFoundException. The strange thing is, that the utilsplugin2 had
already been loaded and included in the requirements of areaselector. With
a reference to ReplaceGeometryUtils my plugin failed to load with a
ClassNotFoundException even if the class was not accessed.(
https://github.com/JOSM/areaselector/blob/master/src/org/openstreetmap/josm/plugins/areaselector/AreaSelectorPlugin.java#L39)
As this did not work I implemented the logic myself.

I'm using a second optional plugin called austriaaddresshelper (
https://github.com/JOSM/austriaaddresshelper). This did work before and I
was getting a ClassNotFoundException, if the plugin wasn't loaded. This
exception is thrown at AreaSelectorAction line 263 (
https://github.com/JOSM/areaselector/blob/master/src/org/openstreetmap/josm/plugins/areaselector/AreaSelectorAction.java#L263
).

Starting from some version after 12327 of JOSM a ClassNotFoundException is
thrown, even if the plugin is loaded and can be used. I even played around
with the Scripting plugin and
Class.forName("org.openstreetmap.josm.plugins.austriaaddresshelper.AustriaAddressHelperAction")
or even
Class.forName("org.openstreetmap.josm.plugins.areaselector.AreaSelectorAction")
always fails.

So finally my question:
Have there been any changes to the ClassLoader which prevent accessing
classes from another plugin and how can I fix this?

This issue can be reproduced with the Scripting plugin an Groovy with this
simple line of Code (you need areaselector plugin installed):
println
Class.forName("org.openstreetmap.josm.plugins.areaselector.AreaSelectorAction").toString()

Script execution has failed.
javax.script.ScriptException: javax.script.ScriptException:
java.lang.ClassNotFoundException:
org.openstreetmap.josm.plugins.areaselector.AreaSelectorAction
at
org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:155)



-- 


Mit freundlichen Grüßen
Paul Wölfel

Email p...@woelfel.at
Tel. +43 664 88 533 801
Pappelweg 9/2/6
7100 Neusiedl am See
Austria

Reply via email to