[Seasar-user:8980] Re: [Teeda]カスタムバリデータ内にあるDaoと同じDaoをページで使用するとエラーになってしまう
Shinpei Ohtani
[E-MAIL ADDRESS DELETED]
2007年 7月 5日 (木) 23:57:52 JST
大谷です.
下記時間の都合がつき次第見てみます.
出来ればサンプルのコードなどを提供してもらえると幸いです.
よろしくお願いします.
07/07/04 に takemura<[E-MAIL ADDRESS DELETED]> さんは書きました:
> 竹村と申します
>
> Teedaでのカスタムバリデータ内のvalidateメソッド内で
> daoを用いた入力チェックを行っているのですが状況により
> validateをクリアした次のPage内のdo〜メソッド内で
>
> java.lang.IllegalArgumentException: object is not an instance of
> declaring class
>
> が発生してしまいます。
>
> しかしエラーが発生するケースが奇妙なのです。
> validate内は下記のようになっています
>
> Emp emp = empDao.selectByEmpNo(empNo);
>
> if (emp == null) {
> Object[] args = new Object[] { value };
> FacesMessage message = FacesMessageUtil.getMessage(context,
> MESSAGE_ID, args);
> throw new ValidatorException(message, MESSAGE_ID, args);
> }
>
> daoで検索してnullだった場合は正常に元の画面にエラーが表示
> されるのですが empがnullではなくvalidateをスルーして
> Pageのdo〜メソッドに行って同じempDaoのメソッドを呼ぶと
> 上記エラーが発生してしまいます。
> (エラーになるdaoのメソッドはvalidateをかまさないと正常に動作します)
> ためしにvalidator内に無いdaoをPage内のdo〜メソッドで試したところ
> 正常に動作しました。
>
> まとめるとvalidator内にあるdaoと同じdaoをvalidator検証後Page内の
> do〜メソッドで呼ぶとエラーになってしまうようです。
>
> 仕様バージョン
> Teeda 1.07
> S2 2.4.14
> S2Dao 1.0.44
>
> デプロイ:HOT
> 構成:churaのsmartDeploy構成
>
>
> 以下スタックトレースです
> DEBUG 2007-07-04 23:14:42,484 [http-8080-Processor25] HOT deployを開始します
> DEBUG 2007-07-04 23:14:42,484 [http-8080-Processor25]
>
> DEBUG 2007-07-04 23:14:42,781 [http-8080-Processor25] クラス
> (jp.hoge.app1.web.search.EmpSearchPage[search_empSearchPage])のコンポー
> ネント定義を登録します
> DEBUG 2007-07-04 23:14:42,875 [http-8080-Processor25] クラス
> (jp.hoge.app1.dao.DeptDao[deptDao])のコンポーネント定義を登録します
> DEBUG 2007-07-04 23:14:42,937 [http-8080-Processor25] クラス
> (jp.hoge.app1.dxo.LabelValueDxo[labelValueDxo])のコンポーネント定義を登
> 録します
> DEBUG 2007-07-04 23:14:42,968 [http-8080-Processor25] クラス
> (jp.hoge.app1.dao.EmpDao[empDao])のコンポーネント定義を登録します
> DEBUG 2007-07-04 23:15:12,500 [http-8080-Processor25] BEGIN
> jp.hoge.app1.dao.EmpDao#selectByEmpNo(7369)
> DEBUG 2007-07-04 23:15:12,734 [http-8080-Processor25] SELECT Emp.id,
> Emp.DEPT_ID, Emp.EMP_NAME, Emp.EMP_NO, Emp.hiredate, Emp.MGR_ID,
> Emp.sal, Emp.VERSION_NO, dept.id AS id_0, dept.DEPT_NAME AS DEPT_NAME_0,
> dept.DEPT_NO AS DEPT_NO_0, dept.loc AS loc_0, dept.VERSION_NO AS
> VERSION_NO_0 FROM Emp LEFT OUTER JOIN Dept dept ON Emp.DEPT_ID = dept.ID
> WHERE Emp.EMP_NO = 7369
> DEBUG 2007-07-04 23:15:12,750 [http-8080-Processor25] END
> jp.hoge.app1.dao.EmpDao#selectByEmpNo(7369) : [E-MAIL ADDRESS DELETED]
> DEBUG 2007-07-04 23:15:12,750 [http-8080-Processor25] BEGIN
> jp.hoge.app1.web.search.EmpSearchPage#doSearch()
> DEBUG 2007-07-04 23:15:12,750 [http-8080-Processor25] トランザクションを
> 開始しました
> DEBUG 2007-07-04 23:15:14,468 [http-8080-Processor25] BEGIN
> jp.hoge.app1.dao.EmpDao#searchEmp(jp.hoge.app1.web.search.EmpSearchPage$$EnhancedByS2AOP$$[E-MAIL ADDRESS DELETED])
> DEBUG 2007-07-04 23:15:14,484 [http-8080-Processor25] END
> jp.hoge.app1.dao.EmpDao#searchEmp(jp.hoge.app1.web.search.EmpSearchPage$$EnhancedByS2AOP$$[E-MAIL ADDRESS DELETED])
> Throwable:java.lang.IllegalArgumentException: object is not an instance
> of declaring class
> DEBUG 2007-07-04 23:15:14,484 [http-8080-Processor25] トランザクションを
> ロールバックしました
> java.lang.IllegalArgumentException: object is not an instance of
> declaring class
> 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:585)
> at org.seasar.framework.util.MethodUtil.invoke(MethodUtil.java:73)
> at
> org.seasar.framework.beans.impl.PropertyDescImpl.getValue(PropertyDescImpl.java:188)
> at org.seasar.dao.node.BindVariableNode.accept(BindVariableNode.java:59)
> at org.seasar.dao.node.ContainerNode.accept(ContainerNode.java:34)
> at org.seasar.dao.node.IfNode.accept(IfNode.java:58)
> at org.seasar.dao.node.ContainerNode.accept(ContainerNode.java:34)
> at
> org.seasar.dao.impl.AbstractDynamicCommand.apply(AbstractDynamicCommand.java:66)
> at
> org.seasar.dao.impl.SelectDynamicCommand.execute(SelectDynamicCommand.java:50)
> at
> org.seasar.dao.interceptors.S2DaoInterceptor.invoke(S2DaoInterceptor.java:53)
> at
> org.seasar.dao.pager.PagerS2DaoInterceptorWrapper.invoke(PagerS2DaoInterceptorWrapper.java:71)
> at
> jp.hoge.app1.dao.EmpDao$$EnhancedByS2AOP$$100fa88$$MethodInvocation$$searchEmp4.proceed(MethodInvocationClassGenerator.java)
> at
> org.seasar.framework.aop.interceptors.TraceInterceptor.invoke(TraceInterceptor.java:70)
> at
> jp.hoge.app1.dao.EmpDao$$EnhancedByS2AOP$$100fa88$$MethodInvocation$$searchEmp4.proceed(MethodInvocationClassGenerator.java)
> at
> jp.hoge.app1.dao.EmpDao$$EnhancedByS2AOP$$100fa88.searchEmp(EmpDao$$EnhancedByS2AOP$$100fa88.java)
> at jp.hoge.app1.web.search.EmpSearchPage.doSearch(EmpSearchPage.java:115)
> at
> jp.hoge.app1.web.search.EmpSearchPage$$EnhancedByS2AOP$$68a881.$$doSearch$$invokeSuperMethod$$(EmpSearchPage$$EnhancedByS2AOP$$68a881.java)
> at
> jp.hoge.app1.web.search.EmpSearchPage$$EnhancedByS2AOP$$68a881$$MethodInvocation$$doSearch2.proceed(MethodInvocationClassGenerator.java)
> at
> org.seasar.extension.tx.RequiredInterceptor.invoke(RequiredInterceptor.java:48)
> at
> jp.hoge.app1.web.search.EmpSearchPage$$EnhancedByS2AOP$$68a881$$MethodInvocation$$doSearch2.proceed(MethodInvocationClassGenerator.java)
> at
> org.seasar.framework.aop.interceptors.ThrowsInterceptor.invoke(ThrowsInterceptor.java:73)
> at
> jp.hoge.app1.web.search.EmpSearchPage$$EnhancedByS2AOP$$68a881$$MethodInvocation$$doSearch2.proceed(MethodInvocationClassGenerator.java)
> at
> org.seasar.framework.aop.interceptors.TraceInterceptor.invoke(TraceInterceptor.java:70)
> at
> jp.hoge.app1.web.search.EmpSearchPage$$EnhancedByS2AOP$$68a881$$MethodInvocation$$doSearch2.proceed(MethodInvocationClassGenerator.java)
> at
> jp.hoge.app1.web.search.EmpSearchPage$$EnhancedByS2AOP$$68a881.doSearch(EmpSearchPage$$EnhancedByS2AOP$$68a881.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:585)
> at org.seasar.framework.util.MethodUtil.invoke(MethodUtil.java:73)
> at
> org.seasar.framework.beans.impl.BeanDescImpl.invoke(BeanDescImpl.java:213)
> at
> org.seasar.teeda.extension.html.impl.HtmlComponentInvokerImpl.invoke(HtmlComponentInvokerImpl.java:159)
> at
> org.seasar.teeda.extension.html.impl.HtmlActionListener.processAction(HtmlActionListener.java:62)
> at javax.faces.component.UICommand.broadcast(UICommand.java:149)
> at
> org.seasar.teeda.extension.component.html.THtmlCommandButton.broadcast(THtmlCommandButton.java:53)
> at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:192)
> at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:117)
> at
> org.seasar.teeda.core.lifecycle.impl.InvokeApplicationPhase.executePhase(InvokeApplicationPhase.java:29)
> at
> org.seasar.teeda.core.lifecycle.AbstractPhase.execute(AbstractPhase.java:55)
> at
> org.seasar.teeda.core.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:94)
> at javax.faces.webapp.FacesServlet.service(FacesServlet.java:92)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
> at
> org.seasar.teeda.core.filter.RequestDumpFilter.doFilter(RequestDumpFilter.java:125)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
> at
> org.seasar.framework.container.hotdeploy.HotdeployFilter.doFilter(HotdeployFilter.java:63)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
> at
> org.seasar.framework.container.filter.S2ContainerFilter.doFilter(S2ContainerFilter.java:64)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
> at
> org.seasar.extension.filter.EncodingFilter.doFilter(EncodingFilter.java:62)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
> at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
> at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
> at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
> at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
> at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
> at
> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
> at
> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
> at
> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
> at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
> at java.lang.Thread.run(Thread.java:595)
> DEBUG 2007-07-04 23:15:14,484 [http-8080-Processor25] END
> jp.hoge.app1.web.search.EmpSearchPage#doSearch() : null
> DEBUG 2007-07-04 23:15:14,484 [http-8080-Processor25] BEGIN
> jp.hoge.app1.web.search.EmpSearchPage#prerender()
> DEBUG 2007-07-04 23:15:14,484 [http-8080-Processor25] トランザクションを
> 開始しました
> DEBUG 2007-07-04 23:15:14,500 [http-8080-Processor25] クラス
> (jp.hoge.app1.dto.UserDto[userDto])のコンポーネント定義を登録します
> DEBUG 2007-07-04 23:15:14,500 [http-8080-Processor25] BEGIN
> jp.hoge.app1.dao.DeptDao#selectAll()
> DEBUG 2007-07-04 23:15:14,515 [http-8080-Processor25] SELECT Dept.id,
> Dept.DEPT_NAME, Dept.DEPT_NO, Dept.loc, Dept.VERSION_NO FROM Dept
> DEBUG 2007-07-04 23:15:14,515 [http-8080-Processor25] END
> jp.hoge.app1.dao.DeptDao#selectAll() :
> [[E-MAIL ADDRESS DELETED], [E-MAIL ADDRESS DELETED],
> [E-MAIL ADDRESS DELETED], [E-MAIL ADDRESS DELETED]]
> DEBUG 2007-07-04 23:15:14,515 [http-8080-Processor25] BEGIN
> jp.hoge.app1.dxo.LabelValueDxo#deptToMap([[E-MAIL ADDRESS DELETED],
> [E-MAIL ADDRESS DELETED], [E-MAIL ADDRESS DELETED],
> [E-MAIL ADDRESS DELETED]])
> DEBUG 2007-07-04 23:15:14,578 [http-8080-Processor25] END
> jp.hoge.app1.dxo.LabelValueDxo#deptToMap([[E-MAIL ADDRESS DELETED],
> [E-MAIL ADDRESS DELETED], [E-MAIL ADDRESS DELETED],
> [E-MAIL ADDRESS DELETED]]) : [{label=ACCOUNTING, value=1},
> {label=RESEARCH, value=2}, {label=SALES, value=3}, {label=OPERATIONS,
> value=4}]
> DEBUG 2007-07-04 23:15:14,578 [http-8080-Processor25] トランザクションを
> コミットしました
> DEBUG 2007-07-04 23:15:14,578 [http-8080-Processor25] END
> jp.hoge.app1.web.search.EmpSearchPage#prerender() : null
> DEBUG 2007-07-04 23:15:14,609 [http-8080-Processor25] クラス
> (jp.hoge.app1.web.layout.Layout2Page[layout_layout2Page])のコンポーネン
> ト定義を登録します
> DEBUG 2007-07-04 23:15:14,640 [http-8080-Processor25] BEGIN
> jp.hoge.app1.web.layout.Layout2Page#prerender()
> DEBUG 2007-07-04 23:15:14,640 [http-8080-Processor25] トランザクションを
> 開始しました
> DEBUG 2007-07-04 23:15:14,640 [http-8080-Processor25] トランザクションを
> コミットしました
> DEBUG 2007-07-04 23:15:14,640 [http-8080-Processor25] END
> jp.hoge.app1.web.layout.Layout2Page#prerender() : null
> DEBUG 2007-07-04 23:15:14,671 [http-8080-Processor25]
>
>
> DEBUG 2007-07-04 23:15:14,671 [http-8080-Processor25] HOT deployを終了し
> ました
>
>
>
>
>
>
>
>
> _______________________________________________
> Seasar-user mailing list
> [E-MAIL ADDRESS DELETED]
> https://ml.seasar.org/mailman/listinfo/seasar-user
>
--
=============================
Shinpei Ohtani
[E-MAIL ADDRESS DELETED]
=============================
Seasar-user メーリングリストの案内