It's not a secret anymore!
The moose likes Struts and the fly likes Plugin init method is not called Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Plugin init method is not called" Watch "Plugin init method is not called" New topic

Plugin init method is not called

as chhipa

Joined: Sep 04, 2006
Posts: 26
Hi everybody,
I create struts plugin from Profession Jakarta Struts 1.1. I also have replaced ApplicationConfig with ModuleConfig as ApplicationConfig has been deprecated. After the changes my program is as follwing

package ch03;
import java.util.Properties;

import javax.servlet.ServletException;
import javax.servlet.ServletContext;

import org.apache.struts.action.PlugIn;
//import org.apache.struts.config.ApplicationConfig;
import org.apache.struts.config.ModuleConfig;
import org.apache.struts.action.ActionServlet;

public class WroxPlugin implements PlugIn
public WroxPlugin(){}
public void init(ActionServlet servlet, ModuleConfig applicationConfig) throws javax.servlet.ServletException
System.out.println("--------The Plugin is starting");
Properties properties =new Properties();
File file=new File("");
FileInputStream fis=new FileInputStream(file);
ServletContext context=servlet.getServletContext();

catch(FileNotFoundException fnfe)
throw new ServletException(fnfe.getMessage());
catch(IOException ioe)
throw new ServletException(ioe.getMessage());
public void destroy()
System.out.println("----- THe Plugin is stopping------");

plug in entry in struts-config file is as follwing

<plg-in className="ch03.WroxPlugin" />

But when I restart the tomcat and start the application I dont find the --------The Plugin is starting message on Tomcat console.

The tomcat version is 4.1.31
THe java version is j2sdk1.4.2

Can any body suggest any alternative to call the plaugin init method
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864

<plg-in className="ch03.WroxPlugin" />


<plug-in className="ch03.WroxPlugin" />

Consultant, Sima Solutions
I agree. Here's the link:
subject: Plugin init method is not called
It's not a secret anymore!