On 19 Mai, 22:45, Rick Herrick <
rherr...@gmail.com> wrote:
> _manager = PluginManagerFactory.createPluginManager();
> _manager.addPluginsFrom(ClassURI.CLASSPATH, new OptionReportAfter());
> _manager.addPluginsFrom(ClassURI.PLUGIN(PluginAImpl.class), new OptionReportAfter());
Strange. By definition the second call to addPlugins() should be
superfluous, as PluginAImpl is obviously on the classpath. If it
weren't, the code wouldn't even compile or start to run. Could you
please pass the following props object:
final JSPFProperties props = new JSPFProperties();
props.setProperty(Diagnosis.class, "recording.enabled",
"true");
props.setProperty(Diagnosis.class, "recording.file",
this.masterFilePath + "diagnosis.record");
props.setProperty(Diagnosis.class, "recording.format", "java/
serialization");
props.setProperty(Diagnosis.class,
"analysis.stacktraces.enabled", "true");
props.setProperty(Diagnosis.class,
"analysis.stacktraces.depth", "10000");
to you PluginManagerFactory when creating a PluginManager and then
send me the diagnosis.record file?
> This clarifies why the ClassURI.CLASSPATH URI failed, because apparently my
> class isn't on the classpath somehow. The jar containing the code is located
No, it must be, see above.
> in the WEB-INF/lib folder and can be referenced and used however you like
> (e.g. to specify the plugin class explicitly), but somehow that doesn't
> qualify as being on the classpath. So once I specify it by class, it gets
One thing could be the JSPF's classpath blacklist, but by default it
should be set to something else. You can test that by setting
props.setProperty(PluginManager.class,
"classpath.filter.default.enabled", "false");
or by setting
props.setProperty(PluginManager.class,
"classpath.filter.default.pattern", "pathA;pathB");
(change pathA and B to something else).
> Now, we're actually probably going to be generating a list of explicit URIs
> to jar files in a defined location (similar to how Jenkins loads plugins
> from $HUDSON_HOME/plugins), so this won't really affect how we do the plugin
> loading, but I'd like to understand what's going on with JSPF's handling of
> the classpath to keep from getting bitten by it in the future (e.g. if we
Right now I also don't see any obvious reason for that. If I had to
guess, it might be that
System.getProperty("java.class.path") (JSPF -> ClassPathLocator.java)
somehow does not return all the locations ... mmhm, now that I come to
think about it. Could it be that your web server / application runtime
adds the code where the PluginManager is being created (i.e.,
PluginService) dynamically as well?
In that case, JSPF wouldn't 'see' anything about where it is right
now, and also wouldn't be able to find the other plugins. Then even
the 2nd call to addPlugins() would make sense...
Filed this as Issue #29, investigating.
> plugins.zip
I've downloaded it and it looks okay, but I don't have the
infrastructure to run it right now, sorry.