jackcorless / jspf

Automatically exported from code.google.com/p/jspf
0 stars 0 forks source link

@PluginImplementation seems not to work on inner classes on Android #36

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Same issue as with #27, but now on Android. Android interface level 14, jspf 
1.0.2

Following the suggestion in the Wiki for Android, I do this (logging statements 
omitted):
   Action.getPluginManager().addPluginsFrom(new ClassURI(DownloadActionImplActionFactory.class).toURI());
   Action.getPluginManager().addPluginsFrom(new ClassURI(nl.wmc.fedNet.client.actions.ExecuteActionImpl.ActionFactory.class).toURI());

The first statement works fine. The second does not.

From the android log:

11-30 16:29:21.270: I/System.out(31508): 16:29:21.272 [main] INFO  
aa.bbb.ccc.GuiActivity - 
classpath://aa.bbb.ccc.client.actions.DownloadActionImplActionFactory

...the first one above worked fine...

11-30 16:29:23.029: I/System.out(31508): 16:29:23.033 [main] INFO  
aa.bbb.ccc.GuiActivity - 
classpath://aa.bbb.ccc.client.actions.ExecuteActionImpl.ActionFactory
11-30 16:29:23.039: D/dalvikvm(31508): GC_CONCURRENT freed 593K, 8% free 
10471K/11271K, paused 5ms+5ms
11-30 16:29:23.039: W/System.err(31508): java.lang.ClassNotFoundException: 
aa.bbb.ccc.client.actions.ExecuteActionImpl.ActionFactory
11-30 16:29:23.059: W/System.err(31508):    at 
dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
11-30 16:29:23.059: W/System.err(31508):    at 
java.lang.ClassLoader.loadClass(ClassLoader.java:501)
11-30 16:29:23.059: W/System.err(31508):    at 
java.lang.ClassLoader.loadClass(ClassLoader.java:461)
11-30 16:29:23.059: W/System.err(31508):    at 
net.xeoh.plugins.base.impl.classpath.ClassPathManager.loadClass(ClassPathManager
.java:165)
11-30 16:29:23.059: W/System.err(31508):    at 
net.xeoh.plugins.base.impl.classpath.loader.AbstractLoader.tryToLoadClassAsPlugi
n(AbstractLoader.java:116)
11-30 16:29:23.059: W/System.err(31508):    at 
net.xeoh.plugins.base.impl.classpath.loader.InternalClasspathLoader.loadClassFro
mClasspathByName(InternalClasspathLoader.java:156)
11-30 16:29:23.059: W/System.err(31508):    at 
net.xeoh.plugins.base.impl.classpath.loader.InternalClasspathLoader.loadFrom(Int
ernalClasspathLoader.java:101)
11-30 16:29:23.059: W/System.err(31508):    at 
net.xeoh.plugins.base.impl.classpath.ClassPathManager.addFromLocation(ClassPathM
anager.java:140)
11-30 16:29:23.069: W/System.err(31508):    at 
net.xeoh.plugins.base.impl.PluginManagerImpl.addPluginsFrom(PluginManagerImpl.ja
va:127)
11-30 16:29:23.069: W/System.err(31508):    at 
aa.bbb.ccc.GuiActivity.onCreate(FednetGuiActivity.java:77)
....(snip)....
11-30 16:29:23.099: W/InternalClasspathLoader(31508): ClassNotFoundException. 
Unable to inspect class 
aa.bbb.ccc.client.actions.ExecuteActionImpl.ActionFactory although it appears 
to be one.

One additional question: do I have to register *all* plugins explicitly like 
this? Is there no way to include form starred classpath, or everything in the 
package I give a reference class from?

Original issue reported on code.google.com by hartmut....@gmail.com on 30 Nov 2011 at 3:41

GoogleCodeExporter commented 8 years ago

Unfortunately I don't have access to an Android device at the moment, and also 
little time, so I won't really be able to look the first issue, sorry.

Regarding the second issue JSPF does not have any means at the moment to truly 
"inspect" the classpath, either on JRE or on Dalvik. Instead we manually 
implemented a JAR / classpath lookup on JRE to scan what's available for 
loading, and this functionality is not implemented on Android. Therefore the 
only way to load a plugin atm is specifying it explicitly. In order to fix this 
issue either a classpath inspection API must be provided, or a manual scan 
needs to be implemented for that platform as well.

Maybe the upcoming JSPF Nexus will help to address these issues, but it might 
take some months until I find time to continue working on it.

Original comment by r.biedert on 30 Nov 2011 at 11:28

GoogleCodeExporter commented 8 years ago

Original comment by r.biedert on 30 Nov 2011 at 11:29

GoogleCodeExporter commented 8 years ago
I don't have access to an Android device at the moment, either. I am purely 
running on the emulator.

Original comment by hartmut....@gmail.com on 1 Dec 2011 at 8:18