4 Replies Latest reply on Dec 31, 2012 4:21 AM by Nicklas Karlsson

    Struts2 Annotation Problem in Jboss 7.1

    Kabilan S Newbie

      I am migrating my application server from Jboss 4.2 to 7.1..My application worked perfectly in Jboss 4.2..But in 7.1 I am getting the following error in the struts configuration.Action defined inside the struts.xml is getting called and the actions present in the Action packages are not getting called..I am also posting my Action , Struts.xml and Stacktrace.

       

      13:56:06,503 ERROR [org.apache.struts2.dispatcher.Dispatcher] (http-localhost-127.0.0.1-8080-2) Could not find action or result: There is no Action mapped for namespace / and action name loginValidate. - [unknown location]
          at com
      .opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:178) [xwork-core-2.1.6.jar:]
          at org
      .apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:61) [struts2-core-2.1.8.1.jar:]
          at org
      .apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39) [struts2-core-2.1.8.1.jar:]
          at com
      .opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:47) [xwork-core-2.1.6.jar:]
          at org
      .apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:478) [struts2-core-2.1.8.1.jar:]
          at org
      .apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77) [struts2-core-2.1.8.1.jar:]
          at org
      .apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91) [struts2-core-2.1.8.1.jar:]
          at org
      .apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]
          at org
      .apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
          at org
      .springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:147) [spring-orm-3.1.2.RELEASE.jar:3.1.2.RELEASE]
          at org
      .springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) [spring-web-3.1.2.RELEASE.jar:3.1.2.RELEASE]
          at org
      .apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]
          at org
      .apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
          at org
      .apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.13.Final.jar:]
          at org
      .apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.13.Final.jar:]
          at org
      .jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) [jboss-as-jpa-7.1.1.Final.jar:7.1.1.Final]
          at org
      .jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
          at org
      .apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.13.Final.jar:]
          at org
      .apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.13.Final.jar:]
          at org
      .apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.13.Final.jar:]
          at org
      .apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.13.Final.jar:]
          at org
      .apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.13.Final.jar:]
          at org
      .apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.13.Final.jar:]
          at org
      .apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.13.Final.jar:]
          at java
      .lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_20]

       

       

       

      My Struts.xml 

      <constant name="struts.convention.action.packages" value="com.infotech.project.web.action" />
      <constant name="struts.convention.package.locators" value="actions,action" /> 
      <constant name="struts.convention.result.path" value="/WEB-INF/jsp" />

      <constant name="struts.convention.default.parent.package" value="project" /> 

      <package name="default" namespace="/" extends="struts-default,json-default" />
      <constant name="struts.devMode" value="true" />

      <package name="project" extends="struts-default,json-default,jfreechart-default, jasperreports-default" namespace="/">
      <!-- more action names goes here -->
      </package>

       

      My LoginAction.java

      package com.infotech.project.web.action; 
      import com.opensymphony.xwork2.ActionContext;
      import com.opensymphony.xwork2.ActionSupport; 

      @SuppressWarnings("serial") @Result(type="json")
      public class LoginAction extends ActionSupport implements SessionAware {

      @SuppressWarnings("unchecked")
      @SkipValidation
      @Action(value = "/loginValidate", results = { @Result(name = "success", params = {"ignoreHierarchy","false"}) })
      public String validateUserLogin() {
                  // validation code goes here
      }
      }