QA@IT

Linux上のSeasa2+Mayaa 環境で「Page not found」エラーが発生する

3893 PV

開発環境
Windows XP
Java JRE1.7
Exlipse Version: Juno Service Release 2 Build id: 20130225-0426
Tomcat 7.0
s2-framework 2.4.45
s2-extension 2.4.45
s2-tiger 2.4.45
sa-struts 1.0.4-sp9
mayaa 1.1.18
上記環境で作成したアプリケーションを

実行環境
CentOS 6.4
Java 1.7.0_25
Tomcat 7.0
s2-framework 2.4.45
s2-extension 2.4.45
s2-tiger 2.4.45
sa-struts 1.0.4-sp9
mayaa 1.1.18

で実行すると、アプリケーションのページ「appname/action1/」にアクセスした際に
「Page not found,/action1/index.html」が発生します。
開発環境では、アクションクラスの Action1Action.index() が実行し、
リザルトとして返す値「hoge.html」の表示処理が行われるのですが、
実行環境では、この部分がうまく動かず、デフォルトのページ「index.html」を表示しようとして、
エラーになっています。

開発環境と実行環境の出力ログを比較するなどのチェックを行っていますが、
エラーメッセージ等の記載もなく、何が原因かわからない状態です。

以下は、スタックトレースの抜粋です(一部加工しています)

org.seasar.mayaa.impl.engine.PageImpl.getTemplate(168)
org.seasar.mayaa.impl.engine.RenderUtil.getTemplate(267)
org.seasar.mayaa.impl.engine.RenderUtil.renderPage(302)
org.seasar.mayaa.impl.engine.PageImpl.doPageRender(190)
org.seasar.mayaa.impl.engine.EngineImpl.doPageService(368)
org.seasar.mayaa.impl.engine.EngineImpl.doService(490)
org.seasar.mayaa.impl.MayaaServlet.doService(97)
org.seasar.mayaa.impl.MayaaServlet.doGet(80)
javax.servlet.http.HttpServlet.service(621)
javax.servlet.http.HttpServlet.service(728)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(305)
org.apache.catalina.core.ApplicationFilterChain.doFilter(210)
org.seasar.struts.filter.RoutingFilter.doFilter(159)
ccc.oooo.filter.RoutingExtFilter.doFilter(110)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(243)
org.apache.catalina.core.ApplicationFilterChain.doFilter(210)
org.seasar.framework.container.filter.S2ContainerFilter.doFilter(79)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(243)
org.apache.catalina.core.ApplicationFilterChain.doFilter(210)
org.seasar.framework.container.hotdeploy.HotdeployFilter.doHotdeployFilter(99)
org.seasar.framework.container.hotdeploy.HotdeployFilter.doFilter(67)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(243)
org.apache.catalina.core.ApplicationFilterChain.doFilter(210)
org.seasar.extension.filter.EncodingFilter.doFilter(69)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(243)
org.apache.catalina.core.ApplicationFilterChain.doFilter(210)
org.apache.catalina.core.StandardWrapperValve.invoke(222)
org.apache.catalina.core.StandardContextValve.invoke(123)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(472)
org.apache.catalina.core.StandardHostValve.invoke(171)
org.apache.catalina.valves.ErrorReportValve.invoke(99)
org.apache.catalina.valves.AccessLogValve.invoke(953)
org.apache.catalina.core.StandardEngineValve.invoke(118)
org.apache.catalina.connector.CoyoteAdapter.service(408)
org.apache.coyote.ajp.AjpProcessor.process(200)
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(589)
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(310)
java.util.concurrent.ThreadPoolExecutor.runWorker(1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run(615)
java.lang.Thread.run(724)


systemDto = ccc.oooo.dto.SystemDto@5005ce1b
org.apache.struts.action.SERVLET_MAPPING = *.do
org.apache.tomcat.util.scan.MergedWebXml = <?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="2.4"
metadata-complete="true">

<context-param>
  <param-name>sastruts.VIEW_PREFIX</param-name>
  <param-value>/view</param-value>
</context-param>

<filter>
  <filter-name>encodingfilter</filter-name>
  <filter-class>org.seasar.extension.filter.EncodingFilter</filter-class>
  <async-supported>false</async-supported>
  <init-param>
    <param-name>encoding</param-name>
    <param-value>UTF-8</param-value>
  </init-param>
</filter>
<filter>
  <filter-name>hotdeployfilter</filter-name>
  <filter-class>org.seasar.framework.container.hotdeploy.HotdeployFilter</filter-class>
  <async-supported>false</async-supported>
</filter>
<filter>
  <filter-name>s2filter</filter-name>
  <filter-class>org.seasar.framework.container.filter.S2ContainerFilter</filter-class>
  <async-supported>false</async-supported>
</filter>
<filter>
  <filter-name>routingfilter</filter-name>
  <filter-class>ccc.oooo.filter.RoutingExtFilter</filter-class>
  <async-supported>false</async-supported>
  <init-param>
    <param-name>jspDirectAccess</param-name>
    <param-value>false</param-value>
  </init-param>
</filter>
<filter>
  <filter-name>requestDumpFilter</filter-name>
  <filter-class>org.seasar.extension.filter.RequestDumpFilter</filter-class>
  <async-supported>false</async-supported>
</filter>

<filter-mapping>
  <filter-name>encodingfilter</filter-name>
  <url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
  <filter-name>hotdeployfilter</filter-name>
  <url-pattern>/*</url-pattern>
  <dispatcher>FORWARD</dispatcher>
  <dispatcher>INCLUDE</dispatcher>
  <dispatcher>REQUEST</dispatcher>
  <dispatcher>ERROR</dispatcher>
</filter-mapping>
<filter-mapping>
  <filter-name>s2filter</filter-name>
  <url-pattern>/*</url-pattern>
  <dispatcher>FORWARD</dispatcher>
  <dispatcher>INCLUDE</dispatcher>
  <dispatcher>REQUEST</dispatcher>
  <dispatcher>ERROR</dispatcher>
</filter-mapping>
<filter-mapping>
  <filter-name>routingfilter</filter-name>
  <url-pattern>/*</url-pattern>
  <dispatcher>REQUEST</dispatcher>
</filter-mapping>
<filter-mapping>
  <filter-name>requestDumpFilter</filter-name>
  <url-pattern>*.do</url-pattern>
  <dispatcher>FORWARD</dispatcher>
  <dispatcher>INCLUDE</dispatcher>
  <dispatcher>REQUEST</dispatcher>
  <dispatcher>ERROR</dispatcher>
</filter-mapping>


<servlet>
  <servlet-name>s2container</servlet-name>
  <servlet-class>org.seasar.framework.container.servlet.S2ContainerServlet</servlet-class>
  <init-param>
    <param-name>debug</param-name>
    <param-value>true</param-value>
  </init-param>
  <load-on-startup>2</load-on-startup>
</servlet>
<servlet>
  <servlet-name>jsp</servlet-name>
  <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
  <init-param>
    <param-name>fork</param-name>
    <param-value>false</param-value>
  </init-param>
  <init-param>
    <param-name>xpoweredBy</param-name>
    <param-value>false</param-value>
  </init-param>
  <load-on-startup>3</load-on-startup>
</servlet>
<servlet>
  <servlet-name>default</servlet-name>
  <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
  <init-param>
    <param-name>debug</param-name>
    <param-value>0</param-value>
  </init-param>
  <init-param>
    <param-name>listings</param-name>
    <param-value>false</param-value>
  </init-param>
  <load-on-startup>1</load-on-startup>
</servlet>
<servlet>
  <servlet-name>MayaaServlet</servlet-name>
  <servlet-class>org.seasar.mayaa.impl.MayaaServlet</servlet-class>
  <load-on-startup>3</load-on-startup>
</servlet>
<servlet>
  <servlet-name>action</servlet-name>
  <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
  <init-param>
    <param-name>detail</param-name>
    <param-value>2</param-value>
  </init-param>
  <init-param>
    <param-name>config</param-name>
    <param-value>/WEB-INF/struts-config.xml</param-value>
  </init-param>
  <init-param>
    <param-name>configFactory</param-name>
    <param-value>org.seasar.struts.config.S2ModuleConfigFactory</param-value>
  </init-param>
  <init-param>
    <param-name>debug</param-name>
    <param-value>2</param-value>
  </init-param>
  <load-on-startup>1</load-on-startup>
</servlet>
<servlet>
  <servlet-name>s2servlet</servlet-name>
  <servlet-class>org.seasar.framework.container.servlet.S2ContainerServlet</servlet-class>
  <init-param>
    <param-name>configPath</param-name>
    <param-value>app.dicon</param-value>
  </init-param>
  <init-param>
    <param-name>debug</param-name>
    <param-value>false</param-value>
  </init-param>
  <load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
  <servlet-name>jsp</servlet-name>
  <url-pattern>*.jsp</url-pattern>
</servlet-mapping>
<servlet-mapping>
  <servlet-name>s2container</servlet-name>
  <url-pattern>/s2container/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
  <servlet-name>MayaaServlet</servlet-name>
  <url-pattern>*.html</url-pattern>
</servlet-mapping>
<servlet-mapping>
  <servlet-name>s2servlet</servlet-name>
  <url-pattern>/s2servlet</url-pattern>
</servlet-mapping>
<servlet-mapping>
  <servlet-name>jsp</servlet-name>
  <url-pattern>*.jspx</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>default</servlet-name>
  <url-pattern>/</url-pattern>
</servlet-mapping>
<servlet-mapping>
  <servlet-name>action</servlet-name>
  <url-pattern>*.do</url-pattern>
</servlet-mapping>

<session-config>
  <session-timeout>30</session-timeout>
  <cookie-config>
  </cookie-config>
</session-config>

<mime-mapping>
  <extension>fh7</extension>
  <mime-type>image/x-freehand</mime-type>
</mime-mapping>
||略
<mime-mapping>
  <extension>pptm</extension>
  <mime-type>application/vnd.ms-powerpoint.presentation.macroenabled.12</mime-type>
</mime-mapping>

<welcome-file-list>
  <welcome-file>index.html</welcome-file>
  <welcome-file>index.htm</welcome-file>
  <welcome-file>index.jsp</welcome-file>
</welcome-file-list>


<jsp-config>
  <jsp-property-group>
    <url-pattern>*.jsp</url-pattern>
    <el-ignored>false</el-ignored>
    <page-encoding>UTF-8</page-encoding>
    <scripting-invalid>false</scripting-invalid>
    <include-prelude>/common/common.jsp</include-prelude>
  </jsp-property-group>
</jsp-config>

</web-app>

fieldMap = ccc.oooo.util.taglib.FieldMap@2d1e77a8
org.apache.struts.action.PLUG_INS = [Lorg.apache.struts.action.PlugIn;@2b41cdbc
javax.servlet.context.tempdir = /var/tomcat/work/Catalina/localhost/oooo
org.apache.struts.action.ACTION_SERVLET = org.apache.struts.action.ActionServlet@6d2a07d3
org.apache.catalina.resources = org.apache.naming.resources.ProxyDirContext@6267e5a2
org.apache.jasper.compiler.TldLocationsCache = org.apache.jasper.compiler.TldLocationsCache@13152127
org.apache.struts.validator.STOP_ON_ERROR. = true
org.apache.struts.action.MESSAGE = org.seasar.struts.util.S2PropertyMessageResources@5033913a
org.apache.tomcat.InstanceManager = org.apache.catalina.core.DefaultInstanceManager@69839ff8
org.apache.catalina.jsp_classpath = /var/tomcat/webapps/oooo/WEB-INF/classes/:/var/tomcat/webapps/oooo/WEB-INF/lib/antlr-2.7.7.jar:/var/tomcat/webapps/oooo/WEB-INF/lib/aopalliance-1.0.jar:/var/tomcat/webapps/oooo/WEB-INF/lib/commons-beanutils-1.7.0.jar:/var/tomcat/webapps/oooo/WEB-INF/lib/commons-beanutils-core-1.7.0.jar:/var/tomcat/webapps/oooo/WEB-INF/lib/commons-collections-3.1.jar:/var/tomcat/webapps/oooo/WEB-INF/lib/commons-digester-1.6.jar:/var/tomcat/webapps/oooo/WEB-INF/lib/commons-el-1.0.jar:/var/tomcat/webapps/oooo/WEB-INF/lib/commons-fileupload-1.2.jar:/var/tomcat/webapps/oooo/WEB-INF/lib/commons-io-1.3.2.jar:/var/tomcat/webapps/oooo/WEB-INF/lib/commons-lang-2.0.jar:/var/tomcat/webapps/oooo/WEB-INF/lib/commons-logging-1.1.jar:/var/tomcat/webapps/oooo/WEB-INF/lib/commons-validator-1.4.0.jar:/var/tomcat/webapps/oooo/WEB-INF/lib/ezmorph-1.0.6.jar:/var/tomcat/webapps/oooo/WEB-INF/lib/fisshplate-0.1.4.jar:/var/tomcat/webapps/oooo/WEB-INF/lib/geronimo-annotation_1.0_spec-1.0.jar:/var/tomcat/webapps/oooo/WEB-INF/lib/geronimo-ejb_3.0_spec-1.0.jar:/var/tomcat/webapps/oooo/WEB-INF/lib/geronimo-interceptor_3.0_spec-1.0.jar:/var/tomcat/webapps/oooo/WEB-INF/lib/geronimo-jpa_3.0_spec-1.0.jar:/var/tomcat/webapps/oooo/WEB-INF/lib/geronimo-jta_1.1_spec-1.0.jar:/var/tomcat/webapps/oooo/WEB-INF/lib/h2-1.0.69.jar:/var/tomcat/webapps/oooo/WEB-INF/lib/jakarta-oro-2.0.8.jar:/var/tomcat/webapps/oooo/WEB-INF/lib/jakarta-taglibs-standard-1.1.2.jar:/var/tomcat/webapps/oooo/WEB-INF/lib/javassist-3.4.ga.jar:/var/tomcat/webapps/oooo/WEB-INF/lib/jaxen-1.1.1.jar:/var/tomcat/webapps/oooo/WEB-INF/lib/js-1.6R5.jar:/var/tomcat/webapps/oooo/WEB-INF/lib/json-lib-2.4-jdk15.jar:/var/tomcat/webapps/oooo/WEB-INF/lib/jstl-1.1.2.jar:/var/tomcat/webapps/oooo/WEB-INF/lib/log4j-1.2.13.jar:/var/tomcat/webapps/oooo/WEB-INF/lib/mayaa-1.1.18.jar:/var/tomcat/webapps/oooo/WEB-INF/lib/nekohtml-0.9.5.jar:/var/tomcat/webapps/oooo/WEB-INF/lib/ognl-2.6.9-patch-20090427.jar:/var/tomcat/webapps/oooo/WEB-INF/lib/poi-3.2-FINAL.jar:/var/tomcat/webapps/oooo/WEB-INF/lib/postgresql-8.4-701.jdbc4.jar:/var/tomcat/webapps/oooo/WEB-INF/lib/s2-dao-1.0.51.jar:/var/tomcat/webapps/oooo/WEB-INF/lib/s2-dao-tiger-1.0.51.jar:/var/tomcat/webapps/oooo/WEB-INF/lib/s2-extension-2.4.45.jar:/var/tomcat/webapps/oooo/WEB-INF/lib/s2-framework-2.4.45.jar:/var/tomcat/webapps/oooo/WEB-INF/lib/s2-tiger-2.4.45.jar:/var/tomcat/webapps/oooo/WEB-INF/lib/s2fisshplate-0.1.4.jar:/var/tomcat/webapps/oooo/WEB-INF/lib/sa-struts-1.0.4-sp9.jar:/var/tomcat/webapps/oooo/WEB-INF/lib/ccc03_oooo_def_2013-07-12.jar:/var/tomcat/webapps/oooo/WEB-INF/lib/ccc03_oooo_sub_2013-07-12.jar:/var/tomcat/webapps/oooo/WEB-INF/lib/struts-1.2.9.jar:/var/tomcat/webapps/oooo/WEB-INF/lib/xercesImpl-2.7.1.jar:/var/tomcat/webapps/oooo/WEB-INF/lib/xml-apis-1.3.03.jar:/var/tomcat/lib/:/var/tomcat/lib/tomcat-i18n-es.jar:/var/tomcat/lib/annotations-api.jar:/var/tomcat/lib/tomcat-util.jar:/var/tomcat/lib/jasper.jar:/var/tomcat/lib/tomcat-dbcp.jar:/var/tomcat/lib/catalina-tribes.jar:/var/tomcat/lib/tomcat-api.jar:/var/tomcat/lib/servlet-api.jar:/var/tomcat/lib/tomcat-i18n-ja.jar:/var/tomcat/lib/jsp-api.jar:/var/tomcat/lib/jasper-el.jar:/var/tomcat/lib/el-api.jar:/var/tomcat/lib/catalina.jar:/var/tomcat/lib/tomcat-coyote.jar:/var/tomcat/lib/catalina-ha.jar:/var/tomcat/lib/ecj-4.2.2.jar:/var/tomcat/lib/tomcat-jdbc.jar:/var/tomcat/lib/catalina-ant.jar:/var/tomcat/lib/tomcat-i18n-fr.jar:/var/tomcat/bin/bootstrap.jar:/var/tomcat/bin/tomcat-juli.jar:/usr/java/jdk1.7.0_25/jre/lib/ext/sunec.jar:/usr/java/jdk1.7.0_25/jre/lib/ext/dnsns.jar:/usr/java/jdk1.7.0_25/jre/lib/ext/localedata.jar:/usr/java/jdk1.7.0_25/jre/lib/ext/sunjce_provider.jar:/usr/java/jdk1.7.0_25/jre/lib/ext/sunpkcs11.jar:/usr/java/jdk1.7.0_25/jre/lib/ext/zipfs.jar
org.apache.struts.globals.MODULE_PREFIXES = [Ljava.lang.String;@407b88e6
org.apache.commons.validator.VALIDATOR_RESOURCES = org.seasar.struts.validator.S2ValidatorResources@6e58d51c
ooooCalendar = ccc.oooo.sub.common.ooooCalendar@a0f59dd
org.apache.tomcat.JarScanner = org.apache.tomcat.util.scan.StandardJarScanner@75d4c153
org.apache.struts.action.MODULE = org.seasar.struts.config.S2ModuleConfig@62e06c94

原因、解決法等ご教示ください。
よろしくお願いいたします。

回答

自己解決しました。

原因は、web.xml のwelcome-file-listでした。
index.html 等のファイルに自動で遷移するのを防ぐために、コメントアウトした結果、
より上位にある TOMCAT本体の web.xml の設定がアプリケーションにも適用されてしまい、
結局、index.html に遷移していました。

TOMCAT本体の定義が適用され、意図しない動作となる:

<!--
   <welcome-file-list>
       <welcome-file>index.html</welcome-file>
       <welcome-file>index.htm</welcome-file>
       <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>
-->

本来の目的とするための設定:

   <welcome-file-list>
<!--
       <welcome-file>index.html</welcome-file>
       <welcome-file>index.htm</welcome-file>
       <welcome-file>index.jsp</welcome-file>
-->
       <welcome-file>index.txt</welcome-file>
    </welcome-file-list>

welcome-fileを持たない空のwelcome-file-listでは、TOMCAT起動時にエラーとなるので、適当なファイルを指定する。)

上記の設定を行うことで、目的通りの動作をするようになりました。
以上、お騒がせいたしました。

編集 履歴 (0)
ウォッチ

この質問への回答やコメントをメールでお知らせします。