[Seasar-user:16860] Re: [Teeda]tldファイルの自動読み込みに関する挙動について

ohara [E-MAIL ADDRESS DELETED]
2009年 2月 10日 (火) 15:51:26 JST


宛)小林様


いつもお世話になっております
小原です


確認をしている際、問題に遭遇しました
HotDeploy且つRenderer内でS2Containerが管理しているオブジェクトを参照するとClassCastExceptionが発生します
(⇒■Stacktrace参照)
ちなみにjarファイルの中にtldを配置しても同様です

聞きたいこと
・そもそも、アクセス方法が間違っていれば教えてください(⇒■アクセス方法参照)
・RendererでS2Container経由のオブジェクトを扱えるよう修正することは可能でしょうか
・もし、難しいようであれば、よい回避策があれば教えてください。
 ⇒Objectで受けてリフレクションでアクセスする等(ただ、楽な方法がありがたいです)


■Stacktrace
2009-02-10 15:43:37,203 [http-8080-Processor23] DEBUG
org.seasar.teeda.extension.util.TeedaExtensionErrorPageManagerImpl -
XX.XX.XX.XX.XXXdto.CommonRequestDto
java.lang.ClassCastException: XX.XX.XX.XX.XXXdto.CommonRequestDto
	at XX.XX.XX.XX.XXXweb.ui.XXXXXXXXXXRenderer.encodeBegin(XXXXXXXXXXRenderer.java:66)
	at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:330)
	at javax.faces.render.Renderer.encodeChildren0(Renderer.java:55)
	at javax.faces.render.Renderer.encodeChildren(Renderer.java:48)
	at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:339)
	at javax.faces.render.Renderer.encodeChildren0(Renderer.java:57)
	at javax.faces.render.Renderer.encodeChildren0(Renderer.java:59)
	at javax.faces.render.Renderer.encodeChildren(Renderer.java:48)
	at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:339)
	at org.seasar.teeda.core.util.RendererUtil.renderChild(RendererUtil.java:326)
	at org.seasar.teeda.core.util.RendererUtil.renderChildren(RendererUtil.java:340)
	at org.seasar.teeda.core.util.RendererUtil.renderChild(RendererUtil.java:328)
	at org.seasar.teeda.core.util.RendererUtil.renderChildren(RendererUtil.java:340)
	at org.seasar.teeda.extension.render.TViewRootRenderer.encodeBegin(TViewRootRenderer.java:65)
	at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:330)
	at javax.faces.component.UIViewRoot.encodeBegin(UIViewRoot.java:100)
	at javax.faces.webapp.UIComponentTag.encodeBegin(UIComponentTag.java:247)
	at javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:184)
	at org.seasar.teeda.extension.taglib.TViewTag.doStartTag(TViewTag.java:98)
	at org.seasar.teeda.extension.html.processor.ElementProcessorImpl.processTag(ElementProcessorImpl.java:145)
	at org.seasar.teeda.extension.html.processor.ElementProcessorImpl.process(ElementProcessorImpl.java:138)
	at org.seasar.teeda.extension.html.processor.ElementProcessorImpl.process(ElementProcessorImpl.java:119)
	at org.seasar.teeda.extension.html.impl.HtmlViewHandler.renderView(HtmlViewHandler.java:157)
	at org.seasar.teeda.extension.html.impl.HtmlViewHandler.renderView(HtmlViewHandler.java:143)
	at org.seasar.teeda.core.lifecycle.impl.RenderResponsePhase.executePhase(RenderResponsePhase.java:39)
	at org.seasar.teeda.core.lifecycle.AbstractPhase.execute(AbstractPhase.java:57)
	at org.seasar.teeda.core.lifecycle.LifecycleImpl.render(LifecycleImpl.java:131)
	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:101)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at org.seasar.framework.container.hotdeploy.HotdeployFilter.doFilter(HotdeployFilter.java:63)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at org.seasar.framework.container.filter.S2ContainerFilter.doFilter(S2ContainerFilter.java:79)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at org.seasar.teeda.extension.filter.MultipartFormDataFilter.doFilter(MultipartFormDataFilter.java:83)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at org.seasar.extension.filter.EncodingFilter.doFilter(EncodingFilter.java:69)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
	at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
	at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
	at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
	at java.lang.Thread.run(Thread.java:595)



■アクセス方法
NG
        CommonRequestDto commonRequestDto =
SingletonS2Container.getComponent(CommonRequestDto.class);
        Map commonRequest       = BeanUtil.createProperties(commonRequestDto);
        int aaaaaa              = commonRequestDto.getAaaa();


OK
        Object commonRequestDto =
SingletonS2Container.getComponent(CommonRequestDto.class);
        Map commonRequest       = BeanUtil.createProperties(commonRequestDto);
        int aaaa                =
Integer.parseInt(commonRequest.get("aaaa").toString());


ここではDTOにアクセスしているが、他に、メソッド呼び出しも行いたい


以上、よろしくお願いします


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