Announcement Announcement Module
Collapse
No announcement yet.
Struts ContextLoaderPlugin not being loaded Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Struts ContextLoaderPlugin not being loaded

    Hello,

    Struts: 1.3.8
    Tomcat: 5.5.23
    Spring: 2.5.5
    jre: 1.5.014
    Hibernate 3.2.4-sp1
    Eclipse -europa ( w/tomcat plugin )

    I'm receiving the following:

    java.lang.ClassNotFoundException: org.springframework.web.struts.ContextLoaderPlugin
    at org.apache.catalina.loader.WebappClassLoader.loadC lass(WebappClassLoader.java:1359)
    at org.apache.catalina.loader.WebappClassLoader.loadC lass(WebappClassLoader.java:1205)
    at org.apache.struts.util.RequestUtils.applicationCla ss(RequestUtils.java:119)
    at org.apache.struts.util.RequestUtils.applicationIns tance(RequestUtils.java:167)
    at org.apache.struts.util.RequestUtils.applicationIns tance(RequestUtils.java:142)
    at org.apache.struts.action.ActionServlet.initModuleP lugIns(ActionServlet.java:842)
    at org.apache.struts.action.ActionServlet.init(Action Servlet.java:359)
    at javax.servlet.GenericServlet.init(GenericServlet.j ava:212)

    Been looking a this for the last day -appears to be a class loading/jar file matter, though I do not see any duplication of jar files ( or classes )
    within the build path for this project. Is there a specific jar file ordering adherence required between spring and struts?

    I am overriding the Struts request processing mechanism with org.springframework.web.struts.DelegatingRequestPr ocessor.

    I am registering a spring ContextLoaderPlugIn to the Struts action servlet w/in the struts-config.xml file.

    Spring performs the beans configurations just fine -the ContextLoaderListener and contextConfigLocation context parameter are defined in the
    Web.xml. All beans ( and hibernate mappings ) are configured. I have the "spring-webmvc-struts.jar" file declared before the struts-core-1.3.8 (RequestUtils).

    Also, will spring manage the action beans as prototypes, thus providing a thread safe request? That is, can you safely inject member variables? I have a base [action] class which contains a HibernateDaoSupport object as well as the business object, and I was hoping to paramterize the definitions. Or must the action class be treated as a singleton?

    Any help is appreciated.

  • #2
    Commented out the ContextLoaderPlugin

    I disabled the plugin definition and the application works fine, as I just discovered it is not necessary when using the DeletegatingRequestProcessor. My reading lead me to believe the plugin declaration was required, though it appears that the DeletegatingRequestProcessor seems cover access to the beans. Still not sure why the classLoader couldn't find it.. As I inject beans into my base "action" class; everything seems to work correctly ( per request) with the beans defined as prototype.

    Comment

    Working...
    X