[Seasar-user:19913] [SAStruts]Actionクラスのpublicメソッドに関して

IZUNO Tadashi [E-MAIL ADDRESS DELETED]
2010年 6月 24日 (木) 22:08:44 JST


いづのです。

sa-struts-blankで以下の様なactionを作成した場合、エラーが発生してしまします。
この理由を調べていたのですが、よく分からないので教えていただけますか。

■action
public class IndexAction {

    @Execute(validator = false)
    public String index() {
        return "start.jsp";
    }

    public String getHoge() {
        throw new RuntimeException();
    }
}

上記actionにアクセスすると、jspなどから一切参照していない状況ですが、getHoge()が実行されてしまい、RuntimeExceptionが発生してしまいます。
AOPが関係している程度は読めたのですが、何故実行までしているのかが分からず悩んでいます。アドバイスなどあればよろしくお願いします。

環境は以下の通りです。
Seasar2.4.42
SAStruts 1.0.4-sp8

長くなって申し訳ないですが、以下にログを添付します。
org.seasar.framework.beans.IllegalPropertyRuntimeException:
[ESSR0059]クラス(com.example.action.IndexAction)のプロパティ(hoge)の設定に失敗しました。理由はjava.lang.RuntimeException
    at
org.seasar.framework.beans.impl.PropertyDescImpl.getValue(PropertyDescImpl.java:236)
    at
org.seasar.struts.action.S2DynaProperty.getValue(S2DynaProperty.java:74)
    at
org.seasar.struts.action.ActionFormWrapper.get(ActionFormWrapper.java:100)
    at
org.seasar.struts.action.S2RequestProcessor.exportPropertiesToRequest(S2RequestProcessor.java:331)
    at
org.seasar.struts.action.S2RequestProcessor.doForward(S2RequestProcessor.java:303)
    at
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:398)
    at
org.seasar.struts.action.S2RequestProcessor.process(S2RequestProcessor.java:134)
    at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
    at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at
org.seasar.framework.container.hotdeploy.HotdeployFilter.doHotdeployFilter(HotdeployFilter.java:86)
    at
org.seasar.framework.container.hotdeploy.HotdeployFilter.doFilter(HotdeployFilter.java:67)
    at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at
org.seasar.framework.container.filter.S2ContainerFilter.doFilter(S2ContainerFilter.java:79)
    at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
    at
org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
    at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
    at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
    at
org.seasar.struts.filter.RoutingFilter.forward(RoutingFilter.java:219)
    at
org.seasar.struts.filter.RoutingFilter.doFilter(RoutingFilter.java:152)
    at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at
org.seasar.framework.container.hotdeploy.HotdeployFilter.doHotdeployFilter(HotdeployFilter.java:99)
    at
org.seasar.framework.container.hotdeploy.HotdeployFilter.doFilter(HotdeployFilter.java:67)
    at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at
org.seasar.framework.container.filter.S2ContainerFilter.doFilter(S2ContainerFilter.java:79)
    at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at
org.seasar.extension.filter.EncodingFilter.doFilter(EncodingFilter.java:69)
    at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
    at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
    at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
    at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.RuntimeException
    at com.example.action.IndexAction.getHoge(IndexAction.java:65)
    at
com.example.action.IndexAction$$EnhancedByS2AOP$$10a5c21.$$getHoge$$invokeSuperMethod$$(IndexAction$$EnhancedByS2AOP$$10a5c21.java)
    at
com.example.action.IndexAction$$EnhancedByS2AOP$$10a5c21$$MethodInvocation$$getHoge0.proceed(MethodInvocationClassGenerator.java)
    at
org.seasar.extension.tx.DefaultTransactionCallback.execute(DefaultTransactionCallback.java:58)
    at
org.seasar.extension.tx.adapter.JTATransactionManagerAdapter.required(JTATransactionManagerAdapter.java:65)
    at
org.seasar.extension.tx.RequiredInterceptor.invoke(RequiredInterceptor.java:50)
    at
com.example.action.IndexAction$$EnhancedByS2AOP$$10a5c21$$MethodInvocation$$getHoge0.proceed(MethodInvocationClassGenerator.java)
    at
org.seasar.framework.aop.interceptors.ThrowsInterceptor.invoke(ThrowsInterceptor.java:79)
    at
com.example.action.IndexAction$$EnhancedByS2AOP$$10a5c21$$MethodInvocation$$getHoge0.proceed(MethodInvocationClassGenerator.java)
    at
org.seasar.framework.aop.interceptors.TraceInterceptor.invoke(TraceInterceptor.java:73)
    at
com.example.action.IndexAction$$EnhancedByS2AOP$$10a5c21$$MethodInvocation$$getHoge0.proceed(MethodInvocationClassGenerator.java)
    at
com.example.action.IndexAction$$EnhancedByS2AOP$$10a5c21.getHoge(IndexAction$$EnhancedByS2AOP$$10a5c21.java)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.seasar.framework.util.MethodUtil.invoke(MethodUtil.java:96)
    at
org.seasar.framework.beans.impl.PropertyDescImpl.getValue(PropertyDescImpl.java:231)
    ... 47 more
-------------- next part --------------
HTMLの添付ファイルを保管しました...
URL: <http://ml.seasar.org/archives/seasar-user/attachments/20100624/f78cf376/attachment.html>


Seasar-user メーリングリストの案内