jeudi 26 mars 2015

why am i getting There is no Action mapped for namespace / and action name loginAction?

I got an Struts 2 + Hibernate + Spring Eclipse web application.


It was originally build to run with Tomcat 7.0, but when I try to migrate it to WeblLogic 12c I get the exception:"There is no Action mapped for namespace / and action name loginAction."


The weird thing is that if I launch the application from eclipse to run on Weblogic it works fine, but if I export the war and deploy it manually I get the previous error mentioned. In my struts.xml I have a couple of configuration, but most of the struts configurations are annotations.


Here is my struts.xml:



<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apa http://ift.tt/1M7TD8s">
<struts>
<constant name="struts.action.excludePattern" value="/rest/.*?" />
<constant name="struts.devMode" value="false" />
<constant name="struts.multipart.maxSize" value="104857600" />
<package name="mi-paquete" extends="struts-default">
<result-types>
<result-type name="tiles"
class="org.apache.struts2.views.tiles.TilesResult" />
</result-types>
<interceptors>
<interceptor name="LoginInterceptor"
class="com.proximate.http://ift.tt/1HRx3dw" />
<interceptor-stack name="loginStack">
<interceptor-ref name="LoginInterceptor" />
<interceptor-ref name="defaultStack" />
</interceptor-stack>
</interceptors>
<default-interceptor-ref name="loginStack" />
<global-results>
<result name="loginAction">/jsp/template/loginLayout.jsp</result>
<result name="errorAction">/jsp/error/error.jsp</result>
</global-results>
<action name="olvidoContrasenia"
class="com.proximate.http://ift.tt/1M7TDoI">
<result name="formResult">/jsp/template/olvidoContrasenaLayout.jsp</result>
</action>
</package>
</struts>


Here is an excerpt of my login action:



@ParentPackage("mi-paquete")
@Action(value="loginAction")
@InterceptorRefs({
@InterceptorRef(value="defaultStack", params = {"excludeMethods","validaUsuario"})
})
@Results({
@Result(name="success", location="/jsp/template/loginLayout.jsp"),
@Result(name=ActionsConstants.ERROR, type="tiles", location=ActionsConstants.URL_ERROR),
@Result(name = "welcome", type = "redirectAction", location = "welcomeAction.action"),
@Result(name = "registroUsuario", location = "/jsp/template/concluyeRegistroLayout.jsp"),
})
public class LoginAction extends ActionSupport implements SessionAware, ServletRequestAware {

/**
*
*/
private static final long serialVersionUID = 1218879876500264583L;
private static final Logger logger = Logger.getLogger(LoginAction.class.getName());
private Login loginObj;
private static String URLAplication = null;
private static String URLReportes = null;

@Autowired
private IUsuarioService usuarioService;

@Autowired
private IMenuDAO menuUsuarioDAO;

@Autowired
private ILogDAO logDAO;

Map<String, Object> session;
HttpServletRequest request;

@Override
public String execute() throws Exception {
// TODO Auto-generated method stub
return validaUsuario();
}
}


Does anyone knows why are the struts2 annotations failing???? Thanks in advance.


Aucun commentaire:

Enregistrer un commentaire