• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

interceptor problem in struts2

Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
while using interceptors in struts 2 I got the following error. I used myeclipse8.5 IDE. Please advice

Aug 19, 2010 5:29:54 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger error
SEVERE: Dispatcher initialization failed
Caused by: Unable to find interceptor class referenced by ref-name model-driven - interceptor-ref - file:/D:/saaj/.metadata/.me_tcat/webapps/Struts2Application/WEB-INF/classes/struts.xml:49:43
at com.opensymphony.xwork2.config.providers.InterceptorBuilder.constructInterceptorReference(InterceptorBuilder.java:52)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.lookupInterceptorReference(XmlConfigurationProvider.java:987)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.buildInterceptorList(XmlConfigurationProvider.java:539)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction(XmlConfigurationProvider.java:370)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:468)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:264)
at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:111)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:193)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:55)
... 18 more
SEVERE: Exception starting filter struts2
Unable to load configuration. - interceptor-ref - file:/D:/saaj/.metadata/.me_tcat/webapps/Struts2Application/WEB-INF/classes/struts.xml:49:43
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:431)

My struts.xml is as follows

<?xml version="1.0" encoding="UTF-8" ?>
"-//Apache Software Foundation//DTD Struts Configuration 2.1//EN"
<include file="struts-default.xml"></include>
<package name="default" extends="struts-default">
<exception-mapping exception="java.lang.Exception"
result="exception" />

<action name="modelAction" class="com.kogent.action.ModelAction">
<interceptor-ref name="exception" />
<interceptor-ref name="prepare" />
<interceptor-ref name="debugging" />
<interceptor-ref name="model-driven" />
<interceptor-ref name="params" />
<interceptor-ref name="conversionError" />
<interceptor-ref name="workflow" />
<result name="success">/student_info.jsp</result>
<result name="error">/model.jsp</result>
<result name="exception">/exception.jsp</result>
<result name="input">/model.jsp</result>

My web.xml is as follows:

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"


My ModelAction.java is as follows

package com.kogent.action;

import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;
import com.opensymphony.xwork2.Preparable;

public class ModelAction extends ActionSupport implements ModelDriven, Preparable {

private Student student;

public void prepare(){
student=new Student();
public Object getModel(){
return student;
public String execute() throws Exception {

return SUCCESS;
return ERROR;
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The name of the interceptor is "modelDriven"; the error message is telling you precisely what's wrong.
sanjoy sa
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks David. Where exactly I will get the interceptors in the library
David Newton
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not sure what you're asking. The interceptors are defined in the struts-default.xml config file. Their names are also documented on the Struts 2 documentation site.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic