Hi Simon,

Thanks for reporting this issue. I've renamed the setRoutes(Map) method in
setAttachments(Map). I've also added usage example to Javadocs.

Checked in SVN trunk.

Best regards,
Jerome  

> -----Message d'origine-----
> De : Simon Olofsson [mailto:[EMAIL PROTECTED] 
> Envoyé : jeudi 24 janvier 2008 10:24
> À : discuss@restlet.tigris.org
> Objet : Problem with SpringHost
> 
> Hi,
> 
> I've been working with Restlet for some time now, and it's a great
> framework.
> 
> But I've got one problem with the Spring Extension in 1.1 M1. 
> I want to
> use SpringHost and attach some Restlets to it. SpringHost has 
> the method
> setRoutes(Map<String,Object> routes). But when I configure this in my
> beans.xml:
>   <bean id="myID" class="org.restlet.ext.spring.SpringHost">
>     <property name="resourceDomain" value="^myVHost.*" />
>     <property name="routes">
>       <map>
>         <entry key="/">
>           <bean class="MyRestlet" />
>         </entry>
>       </map>
>     </property>
>   </bean>
> I get the following error:
> [...]java.lang.IllegalArgumentException: Cannot convert value of type
> [java.util.LinkedHashMap] to required type 
> [org.restlet.util.RouteList]
> for property 'routes'[...]
> It seems that Spring tries to call the method setRoutes(RouteList
> routes) from the Router class.
> 
> When I create my own class MySpringHost (extends VirtualHost) and name
> the method setAttachments(Map<String, Object> routes) and then use:
>   <bean id="myID" class="MySpringHost">
>     <property name="resourceDomain" value="^myVHost.*" />
>     <property name="attachments">
>       <map>
>         <entry key="/">
>           <bean class="MyRestlet" />
>         </entry>
>       </map>
>     </property>
>   </bean>
> everything works fine.
> 
> Is there any workaround or configuration option, other than 
> creating my
> own SpringHost and renaming the method?
> 
> Thanks,
> Simon

Reply via email to