2014-01-30 5 views
-2

Got javax.servlet.ServletException: java.lang.ClassCastException:com.dna.nsm.sim.action.LogoutActionjavax.servlet.ServletException в применении распорок

в стойках 1 приложения.

сообщение об ошибке:

javax.servlet.ServletException: java.lang.ClassCastException: com.dna.nsm.sim.action.LogoutAction 
    org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:286) 
    org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913) 
    org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449) 
    javax.servlet.http.HttpServlet.service(HttpServlet.java:690) 
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803) 
    org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:125) 


root cause 

java.lang.ClassCastException: com.dna.nsm.sim.action.LogoutAction 
    org.apache.struts.chain.commands.servlet.CreateAction.createAction(CreateAction.java:98) 
    org.apache.struts.chain.commands.servlet.CreateAction.getAction(CreateAction.java:68) 
    org.apache.struts.chain.commands.AbstractCreateAction.execute(AbstractCreateAction.java:91) 
    org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51) 
    org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191) 
    org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:305) 
    org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191) 
    org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283) 
    org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913) 
    org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449) 
    javax.servlet.http.HttpServlet.service(HttpServlet.java:690) 
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803) 
    org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:125) 

LogoutAction Код:

public class LogoutAction extends Action{ 
    public ActionForward execute(ActionMapping mapping, ActionForm form, 
      HttpServletRequest request, HttpServletResponse response) { 
     // To redirect to the Login page 
     return mapping.findForward("success"); 
    } 
} 

Struts-config.xml часть

<action path="/logout" type="com.dna.nsm.sim.action.LogoutAction" > 
      <forward name="success" path="/tiles/login/body.jsp" /> 
</action> 

Предложения пожалуйста.

ответ

0

Проверьте свой импорт и убедитесь, что вы расширяете правый класс Action.

 Смежные вопросы

  • Нет связанных вопросов^_^