You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Musachy Barroso (JIRA)" <ji...@apache.org> on 2008/12/15 15:50:37 UTC
[jira] Resolved: (WW-2745) struts.xml includes not loading in
order, or not loading parent
[ https://issues.apache.org/struts/browse/WW-2745?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Musachy Barroso resolved WW-2745.
---------------------------------
Resolution: Cannot Reproduce
Fix Version/s: 2.1.3
I am unable to reproduce this. My guess is that there is a problem with the class name of the interceptor, as that is what the error is complaining about. this is what I did in showcase, to try to reproduce it:
Edit struts.xml:
<package name="loadTest" extends="struts-default">
<interceptors>
<interceptor-stack name="someStack">
<interceptor-ref name="params" />
</interceptor-stack>
</interceptors>
</package>
<package name="loadTest2" extends="struts-default">
</package>
....
<include file="struts-tags.xml"/>
Then in struts-tags-ui.xml:
<package name="ui-tags" extends="loadTest,loadTest2" namespace="/tags/ui">
<action name="example" class="org.apache.struts2.showcase.UITagExample">
<interceptor-ref name="someStack" />
<result>example.jsp</result>
<result name="input">example.jsp</result>
</action>
....
and it works. If you have an small testcase the reproduces the problem, feel free to re-open the ticket with it.
> struts.xml includes not loading in order, or not loading parent
> ---------------------------------------------------------------
>
> Key: WW-2745
> URL: https://issues.apache.org/struts/browse/WW-2745
> 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: http://struts.apache.org/2.x/docs/can-we-break-up-a-large-strutsxml-file-into-smaller-pieces.html
> 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 2.0//EN"
> "http://struts.apache.org/dtds/struts-2.0.dtd">
> <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:
> <!DOCTYPE struts PUBLIC
> "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
> "http://struts.apache.org/dtds/struts-2.0.dtd">
> <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(ConfigurationManager.java:58)
> at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:371)
> at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:424)
> at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:213)
> at weblogic.servlet.internal.FilterManager$FilterInitAction.run(FilterManager.java:320)
> 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(InterceptorBuilder.java:46)
> at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.lookupInterceptorReference(XmlConfigurationProvider.java:1081)
> at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.buildInterceptorList(XmlConfigurationProvider.java:536)
> at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction(XmlConfigurationProvider.java:374)
> at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:465)
> ...
> Note: Company-specific data was replaced with "xx"
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.