| Title | InitializablePlugin not initialized |
| Date | 10-Aug-2005 12:01:30 EEST |
| Version | 2.2.28 |
| Submitter | ErikAlm |
| Bug criticality | MediumBug |
| Browser version | Firefox 1.0.6 |
| Bug status | ClosedBug |
| PageProvider used | VersioningFileProvider |
| Servlet Container | Tomcat 5.5.9 |
| Operating System | Linux 2.6.8.1-12mdk |
| URL | |
| Java version | 1.5.0_03 |
As stated before (by Janne) JSPWiki should now initialize plugins implementing the InitializablePlugin interface, however, I have not been able to verify this with a test plugin. (And yes, it is a plugin I access from a page.)
The following simple plugin returns "test = false" even after consecutive restarts of the app-server:
import com.ecyrd.jspwiki.WikiContext;
import com.ecyrd.jspwiki.plugin.InitializablePlugin;
import com.ecyrd.jspwiki.plugin.PluginException;
import com.ecyrd.jspwiki.plugin.WikiPlugin;
import java.util.Map;
public class TestInitPlugin implements WikiPlugin, InitializablePlugin {
private static boolean test = false;
public String execute(WikiContext wikiContext, Map map)
throws PluginException
{
return "test = " + test;
}
public void initialize(WikiContext wikiContext, Map map)
throws PluginException
{
test = true;
}
}
According to the source of PluginManager, this should work.
....
try
{
if( m_initStage )
{
if( plugin instanceof InitializablePlugin )
{
((InitializablePlugin)plugin).initialize( context, params );
}
return "";
}
return plugin.execute( context, params );
}
.....
Anyway, it is reported a long time ago, closing the bug, if the problem still persists with 2.4.100, feel free to re-open the bug.
--HarryMetske, 03-Mar-2007
Yes, it's still open, and I haven't forgotten this. But I did finally figure out a good solution. Reopening.
Fixed in 2.5.30.