Exposing a proxied service in OSGi is not the best idea. Generally all services 
are proxied under the hood by framework. So it's better to expose a 
implementation with given interface and start a RmiProxyFactoryBean (even with 
Spring) with imported service in second bundle. From architecture point of view 
you'll have a clean separation and your logic won't be affected by Spring 
dependencies.

If you can't do that then you could try to use following construction:

<bean id="factory" class="org.springframework.remoting.rmi.RmiProxyFactoryBean">

</bean>

<bean id="service" factory-ref="factory" factory-method="getObject" />

<service ref="service" interface="theInterface" />

Best regards,
Łukasz Dywicki
--
Code-House
http://code-house.org



Wiadomość napisana przez Filippo Balicchia w dniu 2012-01-10, o godz. 18:57:

> Hello,
> I need to expose a service that use class RmiProxyFactoryBean, but
> blueprint container can't start cause it doesn't find implementation
> of my interface.
> 
> here the configuration.
> 
> <bean id="myManagerRMI"
> class="org.springframework.remoting.rmi.RmiProxyFactoryBean">
>               <property name="serviceUrl"
>                       value="${ipaddress}/myManagerRmi" />
>               <property name="serviceInterface" value="myInterface" />
>               <property name="cacheStub" value="true" />
>               <property name="lookupStubOnStartup" value="false" />
>               <property name="refreshStubOnConnectFailure" value="true" />
>       </bean>
> 
>       <service ref="myManagerRMI" interface="myInterface"
>               ranking="1" />
> 
> 
> Is possible to use spring proxy in blueprint ?
> 
> The same configuration in spring osgi works.
> 
> Could you tell me please where what is wrong in my configuration
> 
> Thanks for help
> 
> 
> --Filippo

Reply via email to