migration struts 2.1.8.1 -> 2.3.24

2.6k Views Asked by At

We are facing the below mentioned problem during Struts 2 upgrade.

"HTTP Status 404" error message.

We have done the below steps to upgrade the struts from Struts 2.1.8.1 to Struts 2.3.24.

  1. Replaced the JARS:

    • struts2-core-2.3.24.jar
    • struts2-dojo-plugin-2.3.24.jar
    • struts2-json-plugin-2.3.24.jar
    • xwork-core-2.3.24.jar
    • ognl-3.0.11.jar
    • log4j-1.2-api-2.4.jar
    • log4j-api-2.4.jar
    • freemarker-2.3.22.jar
    • commons-fileupload-1.3.1.jar
    • commons-digester-2.1.jar
    • commons-io-2.4.jar
  2. Added JARS:

    • asm-3.3.1.jar -asm-tree-3.3.jar
    • asm-commons-3.3.jar
    • commons-lang3-3.4.jar
    • commons-collection-3.2.1.jar
    • hamcrest-core-1.3.jar
    • javassist-3.11.0.GA.jar
    • junit-4.12.jarjunit-4.12.jar
    • struts2-convention-plugin-2.3.24.jar
  3. Using StrutsPrepareAndExecuteFilter as filter in web.xml.

  4. Changed the DTD from struts 2.1 and 2.0 to struts 2.3.

  5. Changed the imports class which were wrong due to separation of commons-lang3 from xwork-core .

  6. write the

    <constant name="struts.additional.excludedPatterns" value="^(action|method):.*"/>
    
    <constant name="struts.enable.DynamicMethodInvocation" value="true" />
    

    in struts.xml.

  7. Build the Classes with ant build. and replace the build in our local Development. environment.

  8. Started the Apache Tomcat server(V7.0.54) .

Server started successfully, but we are not able to open the application; Application context is not up, 404 error is produced on the web.

Could you please guide us if we are doing some wrong steps and help us to diagnose the problem ?

we have changed the log4j.properties file to log4j2.xml as below

    <Configuration>
      <Appenders>
        <RollingFile name="syslog" fileName="/var/log/stor/gui/gui.log">
          <PatternLayout>
            <pattern>%d %p %m%n</pattern>
        </PatternLayout>
        <Policies>
          <TimeBasedTriggeringPolicy />
          <SizeBasedTriggeringPolicy size="16 MB"/>
        </Policies>
        <DefaultRolloverStrategy max="1"/>
      </RollingFile>
    </Appenders>
    <Appenders>
      <RollingFile name="requestUrilog"    fileName="/var/log/stor/gui/requestUrilog.log">
        <PatternLayout>
          <pattern>%d %p %m%n</pattern>
        </PatternLayout>
        <Policies>
          <TimeBasedTriggeringPolicy />
          <SizeBasedTriggeringPolicy size="8 MB"/>
        </Policies>
        <DefaultRolloverStrategy max="4"/>
      </RollingFile>
    </Appenders>
    <Appenders>
      <RollingFile name="userlog" fileName="/var/log/stor/gui/userlog.log">
        <PatternLayout>
          <pattern>%d %p %m%n</pattern>
        </PatternLayout>
        <Policies>
          <TimeBasedTriggeringPolicy />
          <SizeBasedTriggeringPolicy size="8 MB"/>
        </Policies>
        <DefaultRolloverStrategy max="4"/>
      </RollingFile>
    </Appenders>
    <Loggers>
      <Logger name="com.sys" additivity="false" level="info">
        <AppenderRef ref="syslog"/>
      </Logger>
      <Logger name="com.requestUri" additivity="false" level="info">
        <AppenderRef ref="requestUrilog"/>
      </Logger>
      <Logger name="com.user" additivity="false" level="info">
        <AppenderRef ref="userlog"/>
      </Logger>
      <Root level="info">
        <AppenderRef ref="syslog"/>
      </Root>
    </Loggers>
  </Configuration>

But we are still not able to get the log printed

Our action is now being called but now the command line command are not running.

we are not getting, What is the dependency of running the command line command with struts

please guide us to know what we are doing wrong

0

There are 0 best solutions below