Category: spring

Why not use RESTeasy to create REST services?

Posted by – February 9, 2009

After few days using RESTeasy in my project I found a very annoying issue related with its Spring support, please consider the bean declaration below:

1
2
3
4
5
6
<bean id="remoteAuthenticationService" class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">
    <property name="serviceUrl"
            value="http://${host}:${port}/adminserver/remoteAuthenticationService.esp"/>
    <property name="serviceInterface" value="com.fastsearch.esp.admin.RemoteAuthenticationService"/>
    <property name="httpInvokerRequestExecutor" ref="executor"/>
</bean>

For some reason the RESTeasy ContextLoaderListener implementation is unable to resolve property placeholders used by some properties of beans at singleton scope, when I read these properties from my bean logic I see all properties placeholders there as they weren’t resolved.

So I decided to try Jersey since it uses the standard implementation of ContextLoaderListener that comes with Spring, now my application works as expected, all properties placeholders are being correctly resolved on my Spring singleton beans.

Share