Note that there are some explanatory texts on larger screens.

plurals
  1. POStruts-Menu use in Struts 2.x - MenuContextListener not working
    text
    copied!<p>I have thoroughly googled this topic and have turned on debug level for log4j, but the MenuContextListener simply will not start. Here is the info I have:</p> <p>My web.xml file</p> <pre><code> &lt;listener&gt; &lt;listener-class&gt;net.sf.navigator.menu.MenuContextListener&lt;/listener-class&gt; &lt;/listener&gt; &lt;context-param&gt; &lt;param-name&gt;menuConfigLocation&lt;/param-name&gt; &lt;param-value&gt;/WEB-INF/classes/menu-config.xml&lt;/param-value&gt; &lt;/context-param&gt; </code></pre> <p>My menu-config.xml file</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8" ?&gt; &lt;MenuConfig&gt; &lt;Displayers&gt; &lt;Displayer name="TabbedMenu" type="net.sf.navigator.displayer.TabbedMenuDisplayer" /&gt; &lt;/Displayers&gt; &lt;Menus&gt; &lt;Menu name="selectAction" title="Select Action" location="SelectAction"&gt; &lt;Item name="report" title="Report" location="Report"/&gt; &lt;Item name="query" title="Query" location="Query"/&gt; &lt;Item name="listings" title="Listings" location="Listings"/&gt; &lt;/Menu&gt; &lt;/Menus&gt; &lt;/MenuConfig&gt; </code></pre> <p>My log4j info</p> <pre><code>May 21, 2011 1:02:33 PM org.apache.catalina.startup.HostConfig deployWAR INFO: Deploying web application archive myproject.war context path = /myproject log4j:ERROR Could not find value for key log4j.appender.R log4j:ERROR Could not instantiate appender named "R". log4j:ERROR Could not find value for key log4j.appender.TX log4j:ERROR Could not instantiate appender named "TX". log4j:ERROR Could not find value for key log4j.appender.R log4j:ERROR Could not instantiate appender named "R". log4j:ERROR Could not find value for key log4j.appender.R log4j:ERROR Could not instantiate appender named "R". log4j:ERROR Could not find value for key log4j.appender.R log4j:ERROR Could not instantiate appender named "R". log4j:ERROR Could not find value for key log4j.appender.R log4j:ERROR Could not instantiate appender named "R". log4j:ERROR Could not find value for key log4j.appender.R log4j:ERROR Could not instantiate appender named "R". log4j:ERROR Could not find value for key log4j.appender.R log4j:ERROR Could not instantiate appender named "R". log4j:ERROR Could not find value for key log4j.appender.R log4j:ERROR Could not instantiate appender named "R". log4j:ERROR Could not find value for key log4j.appender.R log4j:ERROR Could not instantiate appender named "R". 2011-05-21 13:02:52 MenuContextListener [DEBUG] Starting struts-menu initialization 2011-05-21 13:02:52 MenuContextListener [DEBUG] using menuConfigLocation: /WEBINF/classes/menu-config.xml May 21, 2011 1:02:52 PM org.apache.catalina.core.StandardContext start SEVERE: Error listenerStart May 21, 2011 1:02:52 PM org.apache.catalina.core.StandardContext start SEVERE: Context [/myproject] startup failed due to previous errors 2011-05-21 13:02:52 MenuContextListener [DEBUG] destroying struts-menu... May 21, 2011 1:02:52 PM org.apache.catalina.startup.HostConfig deployDirectory INFO: Deploying web application directory docs context path = /docs May 21, 2011 1:02:52 PM org.apache.catalina.startup.HostConfig deployDirectory INFO: Deploying web application directory examples context path = /examples May 21, 2011 1:02:53 PM org.apache.coyote.http11.Http11AprProtocol start INFO: Starting Coyote HTTP/1.1 on http-8080 May 21, 2011 1:02:53 PM org.apache.coyote.ajp.AjpAprProtocol start INFO: Starting Coyote AJP/1.3 on ajp-8009 May 21, 2011 1:02:53 PM org.apache.catalina.startup.Catalina start INFO: Server startup in 35104 ms </code></pre> <p>So you see the contextInitialize is called for this listener, but the method does not complete because there should be 1 more log statement within MenuContextListener telling us success or failure. Then we suddenly get contextDestroyed called and that is that.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload