[Seasar-user:17369] Re: [S2Dao]SQL実行処理時間をログ出力したい

浅野護 [E-MAIL ADDRESS DELETED]
2009年 5月 1日 (金) 16:56:45 JST


すみません。私の理解不足でご指摘いただいている内容があまり理解できません。

現在行っている設定をまとめますと以下になります。
(以下の作業をする前から、対象のDAOメソッドは正常に動作していました)

1.インターセプターの作成

public class DaoMeasuringInterceptor extends AbstractInterceptor {
    private static final long serialVersionUID = 7906850638320578037L;

    public Object invoke(MethodInvocation invocation) throws Throwable {
        …
        Object ret = invocation.proceed();
        return ret;
    }
}


2.app_aop.diconに上記インターセプターを登録

<components namespace="app_aop">
<include path="convention.dicon"/>
<component name="actionSupportInterceptor"
class="org.seasar.teeda.extension.interceptor.ActionSupportInterceptor" />
<component name="appFacesExceptionThrowsInterceptor"
class="org.seasar.teeda.core.interceptor.AppFacesExceptionThrowsInterceptor"
/>

    <component name="daoMeasuringInterceptor"
class="xxxxxxxx.interceptor.DaoMeasuringInterceptor" />
</components>


3.AaaDao.diconを作成(「src/main/resources」の直下)

<?xml version="1.0" encoding="Shift_JIS"?>
<!DOCTYPE components PUBLIC "-//SEASAR//DTD S2Container//EN"
"http://www.seasar.org/dtd/components.dtd">
<components>
  <include path="dao.dicon"/>
  <include path="app_aop.dicon"/>
  <component class="jp.co.sharp.butsu.jd20.dao.Jed8x0Dao">
    <aspect>traceInterceptor</aspect>
    <aspect>daoMeasuringInterceptor</aspect>
    <aspect>dao.interceptor</aspect>
  </component>
</components>


4.app.diconにAaaDao.diconのincludeを追加(←今回新たに試しました)

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE components PUBLIC "-//SEASAR//DTD S2Container 2.4//EN"
"http://www.seasar.org/dtd/components24.dtd">
<components>
<include path="convention.dicon"/>
<include path="aop.dicon"/>
<include path="app_aop.dicon"/>
<include path="teedaExtension.dicon"/>
<include path="dao.dicon"/>
<include path="dxo.dicon"/>
    <include path="AaaDao.dicon"/>
</components>

ちなみにDAOインターフェースは以下になります。

@S2Dao(bean = Aaa.class)
public interface AaaDao {
    @Arguments({"lginid","xxx"})
    @Query("xxxxxxxxxx'")
    public Aaa selectUserByLginid(String lginid,String xxx);

    @SqlFile
    @Arguments({"xxx", "yyy", "zzz"})
    public List<Aaa> selectUserBySyryteskcd(String xxx, String yyy, String
zzz);
}


上記の設定を行いログイン画面を開こうとすると以下のエラーが発生します。

初歩的な間違いとは思いますが、よろしくお願いいたします。



-----------(エラー)----------------------
HTTPステータス 500 -

--------------------------------------------------------------------------------

type 例外レポート

メッセージ

説明 The server encountered an internal error () that prevented it from
fulfilling this request.

例外

javax.servlet.ServletException: サーブレット facesServlet のServlet.init()が例外を投げました
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
java.lang.Thread.run(Unknown Source)


原因

java.lang.IllegalStateException: no factory
javax.faces.context.FacesContextFactory configured for this application
javax.faces.FactoryFinder.getFactory(FactoryFinder.java:48)
javax.faces.internal.WebAppUtil.getFactory(WebAppUtil.java:142)
javax.faces.webapp.FacesServlet.init(FacesServlet.java:72)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
java.lang.Thread.run(Unknown Source)


注意 原因のすべてのスタックトレースは、Apache Tomcat/5.5.26のログに記録されています


--------------------------------------------------------------------------------

Apache Tomcat/5.5.26






2009/05/01 16:10 Koichi Kobayashi <[E-MAIL ADDRESS DELETED]>:

> 小林 (koichik) です.
>
> Date:    Fri, 1 May 2009 16:04:38 +0900
> From:    浅野護 <[E-MAIL ADDRESS DELETED]>
> To:      [E-MAIL ADDRESS DELETED]
> Subject: [Seasar-user:17367] Re: [S2Dao]SQL実行処理時間をログ出力したい
>
> > お世話になります。
> > DBアクセスはしているのですが、トレースは出力されませんでした。
> > ということは、AaaDao.diconが読み込まれていないということでしょうか?
> >
> > 前のメールにも記述しましたが、「src/main/resources」の直下に置いただけで、例えば app.diconなどに
> > includeさせるなどはしていません。
>
> どこからも include していないなら,それは
> 存在していないのと同じです.
> AaaDao は別のところで定義されているのでしょう.
>
> SMART deploy を使っているなら,customizer.dicon で
> daoMeasuringInterceptor を設定する必要があります.
>
>
> --
> <component name="koichik">
>    <property name="fullName">"Koichi Kobayashi"</property>
>    <property name="email">"[E-MAIL ADDRESS DELETED]"</property>
>    <property name="blog">"http://d.hatena.ne.jp/koichik"</property>
> </component>
>
> _______________________________________________
> Seasar-user mailing list
> [E-MAIL ADDRESS DELETED]
> https://ml.seasar.org/mailman/listinfo/seasar-user
>
-------------- next part --------------
HTMLの添付ファイルを保管しました...
URL: <http://ml.seasar.org/archives/seasar-user/attachments/20090501/a91f278e/attachment.html>


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