Index: /applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSPlugin.java
===================================================================
--- /applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSPlugin.java	(revision 22685)
+++ /applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSPlugin.java	(revision 22686)
@@ -15,4 +15,6 @@
 import java.io.InputStreamReader;
 import java.io.UnsupportedEncodingException;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
 import java.util.ArrayList;
 import java.util.Collections;
@@ -39,5 +41,4 @@
 import org.openstreetmap.josm.plugins.PluginInformation;
 import org.openstreetmap.josm.plugins.PluginProxy;
-import org.openstreetmap.josm.plugins.remotecontrol.RemoteControlPlugin;
 
 import wmsplugin.io.WMSLayerExporter;
@@ -61,4 +62,5 @@
 
 	static boolean remoteControlAvailable = false;
+	static String remoteControlVersion = null;
 
 	protected void initExporterAndImporter() {
@@ -86,5 +88,5 @@
 	private void initRemoteControl() {
 		final String remotecontrolName = "remotecontrol";
-		final String remotecontrolVersion = "22675";
+		final String remotecontrolMinVersion = "22675";
 		for(PluginProxy pp: PluginHandler.pluginList)
 		{
@@ -92,12 +94,13 @@
 			if(remotecontrolName.equals(info.name))
 			{
-				if(remotecontrolVersion.compareTo(info.version) <= 0)
+				if(remotecontrolMinVersion.compareTo(info.version) <= 0)
 				{
 					remoteControlAvailable = true;
+					remoteControlVersion = info.version;
 				}
 				else
 				{
 					System.out.println("wmsplugin: remote control plugin version is " +
-							info.version + ", need " + remotecontrolVersion + " or newer");
+							info.version + ", need " + remotecontrolMinVersion + " or newer");
 				}
 				break;
@@ -107,10 +110,25 @@
 		if(remoteControlAvailable)
 		{
+			remoteControlAvailable = false;
 			System.out.println("wmsplugin: initializing remote control");
-			RemoteControlPlugin plugin =
-				(RemoteControlPlugin) PluginHandler.getPlugin(remotecontrolName);
-			plugin.addRequestHandler(WMSRemoteHandler.command, WMSRemoteHandler.class);
-		}
-		else
+			Plugin plugin =
+				(Plugin) PluginHandler.getPlugin(remotecontrolName);
+			try {
+				Method method = plugin.getClass().getMethod("addRequestHandler", String.class, Class.class);
+				method.invoke(plugin, WMSRemoteHandler.command, WMSRemoteHandler.class);
+				remoteControlAvailable = true;
+			} catch (SecurityException e) {
+				e.printStackTrace();
+			} catch (NoSuchMethodException e) {
+				e.printStackTrace();
+			} catch (IllegalArgumentException e) {
+				e.printStackTrace();
+			} catch (IllegalAccessException e) {
+				e.printStackTrace();
+			} catch (InvocationTargetException e) {
+				e.printStackTrace();
+			}
+		}
+		if(!remoteControlAvailable)
 		{
 			System.out.println("wmsplugin: cannot use remote control");
