[akabana-user:18] Re: 「S2Flex2」、「S2Factory for FDS2」の機能について

matsumura-y @ jp.fujitsu.com matsumura-y @ jp.fujitsu.com
2006年 10月 2日 (月) 15:17:25 JST


松村です。

ふなくら(nod)さん
度々すみません、もう一つお願いいたします。

"jun funakura" <jun.funakura @ gmail.com>さん:
> > また、現在「Flex2 + FDS2 + S2Flex2 + S2」でのサンプルを作ろうと思い、
> > 「S2Factory for FDS2」をダウンロードし http://akabana.sandbox.seasar.org/ja/products/fds/index.html#
> >  の通りに設定しましたが、うまく動かせません。
> >
> > Tomcat起動時に、
> >
> > flex.messaging.config.ConfigurationException: An error occurred trying to
> > construct FlexFactory 'org.seasar.flex2.rpc.remoting.service.fds2.factory.
> > Seasar2Factory'.   The underlying cause is: 'org.seasar.framework.exception.
> > EmptyRuntimeException
> >
> > のエラーが出てしまいます。

は、ダウンロードしたfds-s2factory-example中のapp.diconが、

<!DOCTYPE components PUBLIC "-//SEASAR2.4//DTD S2Container 2.4//EN" 
    "http://www.seasar.org/dtd/components24.dtd">

となっていたためのようです。
SEASAR2.4 を SEASAR に修正すれば大丈夫でした。

そして、
add.mxmlにアクセスして実行すると足し算ができました。

と、ここからが問題です。
このプロジェクトに自作のサンプルを加えて実行してみたところ

[RPC Fault faultString="[ESSR0044]クラスが見つかりませんでした。
詳細はjava.lang.ClassNotFoundException: helloService" faultCode="Server.
Processing" faultDetail="null"] Class

のエラーが出力されます。

こちらで定義した手順は、
1.remoting-config.xmlに、mxmlのリモートオブジェクト名を追加

    -- mxml側 --
    <mx:RemoteObject id="ro" destination="helloService" result="
resultHandler(event)"/>
    
    -- remoting-config.xml側 --
    <destination id="helloService">
        <properties>
            <factory>s2</factory>
        </properties>
    </destination>
    
2.リモートオブジェクト用のサービスインタフェース・実装クラスを作成

    app.diconの定義がそのまま使えるよう(fds-s2factory-exampleに合わせ)
    WEB-INF/src/examples/flex2 の下にsampleサブパッケージを作成し
    HelloServiceインタフェース、impl/HelloServiceImplクラスを作成

3.flex2_example-cooldeploy.diconへのサブパッケージ定義追加

    先ほど作ったsampleサブパッケージ名の定義を追加

    <component name="sampleProject" class="org.seasar.framework.container.
cooldeploy.impl.CoolProjectImpl">
        <property name="rootPackageName">"examples.flex2.sample"</property>
    </component>

    とその下の、CoolComponentAutoRegister の中に
        <initMethod name="addProject">
            <arg>sampleProject</arg>
        </initMethod>
    を追加

4.RemotingServiceの設定

    app.diconと同じフォルダにある flex-services.xml の serviceタグの中に
    
            <destination id="helloService">
                <properties>
                    <source>helloService</source>
                    <service-name>helloService</service-name>
                </properties>
                <channels>
                    <channel ref="s2-amf"/>
                </channels>
            </destination>

    を追加
    これがいまいち分かっていません・・・。
    マニュアルページの中には、「Metaタグ」か「Annotation」で定義すると
    書かれています。
    
以上です。
なにかお気づきになりましたら、ご返答お願いいたします。

お忙しいところ申し訳ございませんが、よろしくお願いいたします。

+--------------------------------------------------------------------+
 (株)富士通東北システムズ
   プラットフォームビジネス統括部 システム基盤ビジネス部
   松村 泰久(Matsumura Yasuhisa)
   Mail:matsumura-y @ jp.fujitsu.com
   TEL:022-292-5031  FAX:022-292-5046
+--------------------------------------------------------------------+


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