struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chetan Ahirrao (Commented) (JIRA)" <>
Subject [jira] [Commented] (WW-2745) struts.xml includes not loading in order, or not loading parent
Date Fri, 07 Oct 2011 12:39:29 GMT


Chetan Ahirrao commented on WW-2745:

Sorry I know that its too late to reply but some other person might just need it.
i got same error("Unable to find interceptor class referenced by ref-name") when i put the
parnt package in struts.xml 
But when i put this package in some other common-package.xml under some package say mypackage.util
I now included this file in struts.xml and now the other modules can refer this package and
this error (Unable to find interceptor class referenced by ref-name)  is gone. 

> struts.xml includes not loading in order, or not loading parent
> ---------------------------------------------------------------
>                 Key: WW-2745
>                 URL:
>             Project: Struts 2
>          Issue Type: Bug
>          Components: XML Configuration
>    Affects Versions: 2.1.2
>         Environment: Struts 2.1.2, Weblogic 10
>            Reporter: Becky O'Sullivan
>            Priority: Critical
>             Fix For: 2.1.3
> In Struts 2.1.2 I attempted to break struts.xml into multiple files becuase it was getting
too big. 
> Starting here:
> Specifically from that page:
> "You can use <include> elements in your struts.xml interchangeably with <package>
elements. The configuration objects will be loaded in the order of appearance. The framework
reads the configuration from top to bottom and adds objects as they are referenced."
> Following the note above I added an included file *after* my base package (where some
interceptor stacks are defined).
> For example (new copy of struts.xml):
> <!DOCTYPE struts PUBLIC   "-//Apache Software Foundation//DTD Struts Configuration
>       "">
> <struts>
>     <package name="baseEAP" extends="struts-default" abstract="true">
>         <interceptors>
>             <interceptor name="DataPrep" class="xx" />
>             <interceptor-stack name="dataPrepStack">
>                 <interceptor-ref name="defaultStack"/>
>                 <interceptor-ref name="DataPrep"/>
>             </interceptor-stack>
>         </interceptors>
>     </package>
>     <include file="struts-ajax.xml" />
>     ....(lots of packages that extend baseEAP)...
> </struts>
> All other packages extend baseEAP, and some actions reference the interceptor stack dataPrepStack
-- it works great.  
> I pulled one of those working packages out of struts.xml and placed it in its own file.
 The code above shows where <include file...> was inserted below the baseEAP package
declaration.  No other changes were made.
> In the separate file (struts-ajax.xml) the package signature is exactly the same as it
was in struts.xml:
>   "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
>   "">
> <struts>
>     <package name="ajax" extends="baseEAP,gwt-default">
>         <action name="ajaxManageMenus" class="xx">
>             <interceptor-ref name="dataPrepStack" />
>             <interceptor-ref name="gwt"/>
>         </action>
>     </package>
> </struts>
> Unfortunately the xml files would not load upon deployment:
> <Jul 31, 2008 9:55:49 AM PDT> <Error> <HTTP> <BEA-101165> <Could
not load user defined filter in web.xml:
> org.apache.struts2.dispatcher.FilterDispatcher.
> Unable to load configuration. - interceptor-ref -file:/C:/workspace_bea10/xx/exploded/xx.ear/xx.war/WEB-INF/classes/struts-ajax.xml:10:53
>         at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(
>         at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(
>         at org.apache.struts2.dispatcher.Dispatcher.init(
>         at org.apache.struts2.dispatcher.FilterDispatcher.init(
>         at weblogic.servlet.internal.FilterManager$
>         Truncated. see log file for complete stacktrace
> Unable to find interceptor class referenced by ref-name dataPrepStack - interceptor-ref
> file:/C:/workspace_bea10/xx/exploded/xx.ear/xx.war/WEB-INF/classes/struts-ajax.xml:10:53
>         at com.opensymphony.xwork2.config.providers.InterceptorBuilder.constructInterceptorReference(
>         at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.lookupInterceptorReference(
>         at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.buildInterceptorList(
>         at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction(
>         at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(
> ...
> Note: Company-specific data was replaced with "xx"

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message