RMIとAOPでSpringアプリケーションを実装しようとしています。サーバーコンポーネントに問題があります。インタフェースはRemote
を拡張し、それがそうで開始し、持つだけで正常に動作している場合SpringとAOPを持つRMI
UnknownAdviceTypeException: Advice object [org.springframework.context.annotati[email protected]1f90645] is neither a supported subinterface of [org.aopalliance.aop.Advice] nor an [org.springframework.aop.Advisor]
:私は公開するサービス・インターフェースがRemote
を拡張していないとの方法はRemoteException
をスローしない場合、私はエラーを取得しています。 私application.xml
は、唯一のBeanは宣言した:
<bean id="testService" class="org.springframework.remoting.rmi.RmiServiceExporter">
<property name="serviceName" value="TestService" />
<property name="service" ref="testServiceImpl"/>
<property name="serviceInterface"
value="xxx.service.TestService" />
</bean>
を実装が@Service
注釈を持っていながら、私のインターフェイスのみ、@Transactional
注釈を持っています。
私のクライアントでもエラーが発生します。ここで私は一意のbeanではないエラーが発生します:found bean testService
とtestServiceImpl
。私client.xmlのは、次のようになります。
<bean class="xxx.start.Client">
<property name="testService" ref="testService"/>
</bean>
<bean id="testService" class="org.springframework.remoting.rmi.RmiProxyFactoryBean">
<property name="serviceUrl" value="rmi://localhost:1099/TestService"/>
<property name="serviceInterface" value="xxx.service.TestService"/>
</bean>
私はこのguideを踏襲しますが、上記のエラーを行きます。もしあなたが私を助けてくれたら、非常に嬉しいです。 RMIなしでJUnitテストを実行すると、すべて正常に動作します。
となりました。これは、問題につながる '@ Transactional'をインターフェースに置かないでください。あなたの実装に入れてください。この設定で、これでプロキシのプロキシができました。 –
@M.Deinumでも '@ Transactinal'はクラス内のすべてのメソッドに対してトランザクションを開きませんか?そうであれば、それを必要としないメソッドのトランザクションも開きます。私はimplで '@ Transactional'を使ってテストしましたが、まだアドバイスに関するエラーが表示されます – XtremeBaumer
それはインターフェイスにあるかどうかにかかわらず、それはまだ公開されているメソッドにのみ適用されますインタフェースメソッド)。 –