RE: Unable to setup SpringBeanRouter configure
Hi guys, Thanks for the update Pritam, I'm glad it now works for you. Thanks as well to Rhett for the prompt support! I hope all those Spring issues with Restlet 2.0 are behind us now. BTW, I've just noticed a detailed blog post on this topic by 'bits.of.info': "Integrating Restlet with Spring" http://bitsofinfo.wordpress.com/2009/10/07/integrating-restlet-with-spring/ Best regards, Jerome Louvel -- Restlet ~ Founder and Lead developer ~ http://www.restlet.org Noelios Technologies ~ Co-founder ~ http://www.noelios.com -Message d'origine- De : infinity [mailto:infinity2hea...@gmail.com] Envoyé : lundi 5 octobre 2009 22:34 À : discuss@restlet.tigris.org Objet : Re: Unable to setup SpringBeanRouter configure Works with 2.0M5. Thanks Pritam wrote: > > I'm using 2.0M4, will try 2.0M5. Can you point out the file in which this > bug was fixed so that I could test in the interim? > > (I'm using Nabble and I assume the "reply" does go the mailing list) > > > Rhett Sutphin wrote: >> >> Hi, >> >> On Oct 5, 2009, at 12:03 PM, infinity wrote: >> >>> Hi Rhett, >>> >>> >>> Rhett Sutphin wrote: >>>> >>>> This mapping combined with the URIs in your resource beans means that >>>> your server should respond to >>>> >>>> http://servername:port/ws/ws/contact/{operation} >>>> http://servername:port/ws/mock/1/data/Contact/{userId} >>>> http://servername:port/mock/ws/contact/{operation} >>>> http://servername:port/mock/mock/1/data/Contact/{userId} >>>> >>>> I'm guessing that's not what you want. Router attachment URIs >>>> (whether you use SpringRouter, SpringBeanRouter, or something else) >>>> are relative to the attachment point of the router. >>>> >>>> Rhett >>>> >>>> >>> >>> I think you're mistaken. Did you look at the updated configuration >>> in the >>> parent post? I have the same configuration working for singleton beans >>> (entry key ). >> >> This is a mailing list. If you want your changes to be seen by >> everyone, you need to send a new message. >> >>> For a prototype bean, >>> >> class="com.xxx.yyy.rest.resource.ContactData" scope="prototype" >>> autowire="byName"/> >>> >>> with a router prepending a /ws, I would expect >>> http://servername:port/appname/ws/contact/{operation} >>> >>> But it doesn't work. I get the following warning in the log, if that >>> helps. >>> >>> Oct 5, 2009 12:21:27 PM org.restlet.resource.Finder handle >>> WARNING: No target class was defined for this finder: >>> org.restlet.ext.spring.springbeanfin...@c7afdd >>> Oct 5, 2009 12:21:27 PM org.restlet.engine.log.LogFilter afterHandle >> >> Are you using 2.0-M5? This was a bug in 2.0-M4, but it should be >> fixed now. If not, could you build a minimal reproduceable test case >> and file a bug? >> >> Thanks, >> Rhett >> >>> -- >>> View this message in context: >>> http://n2.nabble.com/Unable-to-setup-SpringBeanRouter-confiiguration-with-Vi rtualHost-tp3769405p3770177.html >>> Sent from the Restlet Discuss mailing list archive at Nabble.com. >>> >>> -- >>> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=24038 11 >> >> -- >> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=24038 14 >> >> > > -- View this message in context: http://n2.nabble.com/Unable-to-setup-SpringBeanRouter-confiiguration-with-Vi rtualHost-tp3769405p3771459.html Sent from the Restlet Discuss mailing list archive at Nabble.com. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=24038 79 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2404869
Re: Unable to setup SpringBeanRouter configure
Works with 2.0M5. Thanks Pritam wrote: > > I'm using 2.0M4, will try 2.0M5. Can you point out the file in which this > bug was fixed so that I could test in the interim? > > (I'm using Nabble and I assume the "reply" does go the mailing list) > > > Rhett Sutphin wrote: >> >> Hi, >> >> On Oct 5, 2009, at 12:03 PM, infinity wrote: >> >>> Hi Rhett, >>> >>> >>> Rhett Sutphin wrote: This mapping combined with the URIs in your resource beans means that your server should respond to http://servername:port/ws/ws/contact/{operation} http://servername:port/ws/mock/1/data/Contact/{userId} http://servername:port/mock/ws/contact/{operation} http://servername:port/mock/mock/1/data/Contact/{userId} I'm guessing that's not what you want. Router attachment URIs (whether you use SpringRouter, SpringBeanRouter, or something else) are relative to the attachment point of the router. Rhett >>> >>> I think you're mistaken. Did you look at the updated configuration >>> in the >>> parent post? I have the same configuration working for singleton beans >>> (entry key ). >> >> This is a mailing list. If you want your changes to be seen by >> everyone, you need to send a new message. >> >>> For a prototype bean, >>> >> class="com.xxx.yyy.rest.resource.ContactData" scope="prototype" >>> autowire="byName"/> >>> >>> with a router prepending a /ws, I would expect >>> http://servername:port/appname/ws/contact/{operation} >>> >>> But it doesn't work. I get the following warning in the log, if that >>> helps. >>> >>> Oct 5, 2009 12:21:27 PM org.restlet.resource.Finder handle >>> WARNING: No target class was defined for this finder: >>> org.restlet.ext.spring.springbeanfin...@c7afdd >>> Oct 5, 2009 12:21:27 PM org.restlet.engine.log.LogFilter afterHandle >> >> Are you using 2.0-M5? This was a bug in 2.0-M4, but it should be >> fixed now. If not, could you build a minimal reproduceable test case >> and file a bug? >> >> Thanks, >> Rhett >> >>> -- >>> View this message in context: >>> http://n2.nabble.com/Unable-to-setup-SpringBeanRouter-confiiguration-with-VirtualHost-tp3769405p3770177.html >>> Sent from the Restlet Discuss mailing list archive at Nabble.com. >>> >>> -- >>> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2403811 >> >> -- >> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2403814 >> >> > > -- View this message in context: http://n2.nabble.com/Unable-to-setup-SpringBeanRouter-confiiguration-with-VirtualHost-tp3769405p3771459.html Sent from the Restlet Discuss mailing list archive at Nabble.com. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2403879
Re: Unable to setup SpringBeanRouter configure
I'm using 2.0M4, will try 2.0M5. Can you point out the file in which this bug was fixed so that I could test in the interim? (I'm using Nabble and I assume the "reply" does go the mailing list) Rhett Sutphin wrote: > > Hi, > > On Oct 5, 2009, at 12:03 PM, infinity wrote: > >> Hi Rhett, >> >> >> Rhett Sutphin wrote: >>> >>> This mapping combined with the URIs in your resource beans means that >>> your server should respond to >>> >>> http://servername:port/ws/ws/contact/{operation} >>> http://servername:port/ws/mock/1/data/Contact/{userId} >>> http://servername:port/mock/ws/contact/{operation} >>> http://servername:port/mock/mock/1/data/Contact/{userId} >>> >>> I'm guessing that's not what you want. Router attachment URIs >>> (whether you use SpringRouter, SpringBeanRouter, or something else) >>> are relative to the attachment point of the router. >>> >>> Rhett >>> >>> >> >> I think you're mistaken. Did you look at the updated configuration >> in the >> parent post? I have the same configuration working for singleton beans >> (entry key ). > > This is a mailing list. If you want your changes to be seen by > everyone, you need to send a new message. > >> For a prototype bean, >> > class="com.xxx.yyy.rest.resource.ContactData" scope="prototype" >> autowire="byName"/> >> >> with a router prepending a /ws, I would expect >> http://servername:port/appname/ws/contact/{operation} >> >> But it doesn't work. I get the following warning in the log, if that >> helps. >> >> Oct 5, 2009 12:21:27 PM org.restlet.resource.Finder handle >> WARNING: No target class was defined for this finder: >> org.restlet.ext.spring.springbeanfin...@c7afdd >> Oct 5, 2009 12:21:27 PM org.restlet.engine.log.LogFilter afterHandle > > Are you using 2.0-M5? This was a bug in 2.0-M4, but it should be > fixed now. If not, could you build a minimal reproduceable test case > and file a bug? > > Thanks, > Rhett > >> -- >> View this message in context: >> http://n2.nabble.com/Unable-to-setup-SpringBeanRouter-confiiguration-with-VirtualHost-tp3769405p3770177.html >> Sent from the Restlet Discuss mailing list archive at Nabble.com. >> >> -- >> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2403811 > > -- > http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2403814 > > -- View this message in context: http://n2.nabble.com/Unable-to-setup-SpringBeanRouter-confiiguration-with-VirtualHost-tp3769405p3770255.html Sent from the Restlet Discuss mailing list archive at Nabble.com. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2403818
Re: Unable to setup SpringBeanRouter configure
Hi, On Oct 5, 2009, at 12:03 PM, infinity wrote: > Hi Rhett, > > > Rhett Sutphin wrote: >> >> This mapping combined with the URIs in your resource beans means that >> your server should respond to >> >> http://servername:port/ws/ws/contact/{operation} >> http://servername:port/ws/mock/1/data/Contact/{userId} >> http://servername:port/mock/ws/contact/{operation} >> http://servername:port/mock/mock/1/data/Contact/{userId} >> >> I'm guessing that's not what you want. Router attachment URIs >> (whether you use SpringRouter, SpringBeanRouter, or something else) >> are relative to the attachment point of the router. >> >> Rhett >> >> > > I think you're mistaken. Did you look at the updated configuration > in the > parent post? I have the same configuration working for singleton beans > (entry key ). This is a mailing list. If you want your changes to be seen by everyone, you need to send a new message. > For a prototype bean, > class="com.xxx.yyy.rest.resource.ContactData" scope="prototype" > autowire="byName"/> > > with a router prepending a /ws, I would expect > http://servername:port/appname/ws/contact/{operation} > > But it doesn't work. I get the following warning in the log, if that > helps. > > Oct 5, 2009 12:21:27 PM org.restlet.resource.Finder handle > WARNING: No target class was defined for this finder: > org.restlet.ext.spring.springbeanfin...@c7afdd > Oct 5, 2009 12:21:27 PM org.restlet.engine.log.LogFilter afterHandle Are you using 2.0-M5? This was a bug in 2.0-M4, but it should be fixed now. If not, could you build a minimal reproduceable test case and file a bug? Thanks, Rhett > -- > View this message in context: > http://n2.nabble.com/Unable-to-setup-SpringBeanRouter-confiiguration-with-VirtualHost-tp3769405p3770177.html > Sent from the Restlet Discuss mailing list archive at Nabble.com. > > -- > http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2403811 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2403814
Re: Unable to setup SpringBeanRouter configure
Hi Rhett, Rhett Sutphin wrote: > > This mapping combined with the URIs in your resource beans means that > your server should respond to > > http://servername:port/ws/ws/contact/{operation} > http://servername:port/ws/mock/1/data/Contact/{userId} > http://servername:port/mock/ws/contact/{operation} > http://servername:port/mock/mock/1/data/Contact/{userId} > > I'm guessing that's not what you want. Router attachment URIs > (whether you use SpringRouter, SpringBeanRouter, or something else) > are relative to the attachment point of the router. > > Rhett > > I think you're mistaken. Did you look at the updated configuration in the parent post? I have the same configuration working for singleton beans (entry key ). For a prototype bean, with a router prepending a /ws, I would expect http://servername:port/appname/ws/contact/{operation} But it doesn't work. I get the following warning in the log, if that helps. Oct 5, 2009 12:21:27 PM org.restlet.resource.Finder handle WARNING: No target class was defined for this finder: org.restlet.ext.spring.springbeanfin...@c7afdd Oct 5, 2009 12:21:27 PM org.restlet.engine.log.LogFilter afterHandle -- View this message in context: http://n2.nabble.com/Unable-to-setup-SpringBeanRouter-confiiguration-with-VirtualHost-tp3769405p3770177.html Sent from the Restlet Discuss mailing list archive at Nabble.com. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2403811
Re: Unable to setup SpringBeanRouter configure
Hi Infinity, On Oct 5, 2009, at 11:25 AM, infinity wrote: > Rhett, > > Spring context loaded in web.xml (tomcat) via context params > > > > restletServlet > org.restlet.ext.spring.SpringServerServlet class> > > > restletServlet > /ws/* > /mock/* > This mapping combined with the URIs in your resource beans means that your server should respond to http://servername:port/ws/ws/contact/{operation} http://servername:port/ws/mock/1/data/Contact/{userId} http://servername:port/mock/ws/contact/{operation} http://servername:port/mock/mock/1/data/Contact/{userId} I'm guessing that's not what you want. Router attachment URIs (whether you use SpringRouter, SpringBeanRouter, or something else) are relative to the attachment point of the router. Rhett > > > > > > Comma separated list of Spring context configuration files. > > contextConfigLocation > > /WEB-INF/spring/spring-core.xml, > /WEB-INF/spring/spring-mail.xml, > /WEB-INF/spring/spring-restlet.xml, > > > > > >Spring bean name that inherits from Component. It is used to > instantiate > and attach >the described component, contained applications and connectors > > (Used by > org.restlet.ext.spring.SpringServerServlet) > > org.restlet.component > > component > > > > > Btw, I corrected the virtual host configuration from the parent > post. pl > refer the same. > > > > Rhett Sutphin wrote: >> >> Hi Infinity, >> >> On Oct 5, 2009, at 10:03 AM, infinity wrote: >> >>> I'm trying to setup a SpringBeanRouter as per the javadocs since I >>> cannot use >>> SpringRouter if I use spring prototype beans for attachements acc to >>> this >>> http://n2.nabble.com/Unable-to-inject-Protoype-beans-into-a-singleton-bean-via-value-ref-for-a-Spring-Router-td3756435.html#a3756435 >>> issue . >>> >>> Is there something wrong with the following configuration? >>> >>> >>> http://www.springframework.org/schema/beans"; >>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; >>> xmlns:util="http://www.springframework.org/schema/util"; >>> xsi:schemaLocation="http://www.springframework.org/schema/beans >>> http://www.springframework.org/schema/beans/spring-beans-2.5.xsd";> >>> >>> >>> >> class="org.restlet.ext.spring.SpringComponent"> >>> >>> >>> HTTP, HTTPS >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >> class="org.restlet.ext.spring.SpringBeanRouter"/> >>> >>> >>>>> class="com.xx.rest.resource.ContactData" scope="prototype" >>> autowire="byName"/> >>> >> class="com.xxx.mock.resource.ContactData" scope="prototype" >>> autowire="byName"/> >>> >>> The server loads fine but none of Server Resources are invoked. >>> There is no >>> stacktrace either. Pl suggest. >> >> What sort of server are you using? How are you loading the beans >> from >> this context and attaching them to the server? >> >> Rhett >> >>> >>> >>> -- >>> View this message in context: >>> http://n2.nabble.com/Unable-to-setup-SpringBeanRouter-configure-tp3769405p3769405.html >>> Sent from the Restlet Discuss mailing list archive at Nabble.com. >>> >>> -- >>> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2403701 >> >> -- >> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2403785 >> >> > > -- > View this message in context: > http://n2.nabble.com/Unable-to-setup-SpringBeanRouter-confiiguration-with-VirtualHost-tp3769405p3769937.html > Sent from the Restlet Discuss mailing list archive at Nabble.com. > > -- > http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2403797 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2403803
Re: Unable to setup SpringBeanRouter configure
Rhett, Spring context loaded in web.xml (tomcat) via context params restletServlet org.restlet.ext.spring.SpringServerServlet restletServlet /ws/* /mock/* Comma separated list of Spring context configuration files. contextConfigLocation /WEB-INF/spring/spring-core.xml, /WEB-INF/spring/spring-mail.xml, /WEB-INF/spring/spring-restlet.xml, Spring bean name that inherits from Component. It is used to instantiate and attach the described component, contained applications and connectors (Used by org.restlet.ext.spring.SpringServerServlet) org.restlet.component component Btw, I corrected the virtual host configuration from the parent post. pl refer the same. Rhett Sutphin wrote: > > Hi Infinity, > > On Oct 5, 2009, at 10:03 AM, infinity wrote: > >> I'm trying to setup a SpringBeanRouter as per the javadocs since I >> cannot use >> SpringRouter if I use spring prototype beans for attachements acc to >> this >> http://n2.nabble.com/Unable-to-inject-Protoype-beans-into-a-singleton-bean-via-value-ref-for-a-Spring-Router-td3756435.html#a3756435 >> issue . >> >> Is there something wrong with the following configuration? >> >> >> http://www.springframework.org/schema/beans"; >>xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; >> xmlns:util="http://www.springframework.org/schema/util"; >>xsi:schemaLocation="http://www.springframework.org/schema/beans >> http://www.springframework.org/schema/beans/spring-beans-2.5.xsd";> >> >> >>> class="org.restlet.ext.spring.SpringComponent"> >> >> >> HTTP, HTTPS >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >>> class="org.restlet.ext.spring.SpringBeanRouter"/> >> >> >> > class="com.xx.rest.resource.ContactData" scope="prototype" >> autowire="byName"/> >>> class="com.xxx.mock.resource.ContactData" scope="prototype" >> autowire="byName"/> >> >> The server loads fine but none of Server Resources are invoked. >> There is no >> stacktrace either. Pl suggest. > > What sort of server are you using? How are you loading the beans from > this context and attaching them to the server? > > Rhett > >> >> >> -- >> View this message in context: >> http://n2.nabble.com/Unable-to-setup-SpringBeanRouter-configure-tp3769405p3769405.html >> Sent from the Restlet Discuss mailing list archive at Nabble.com. >> >> -- >> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2403701 > > -- > http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2403785 > > -- View this message in context: http://n2.nabble.com/Unable-to-setup-SpringBeanRouter-confiiguration-with-VirtualHost-tp3769405p3769937.html Sent from the Restlet Discuss mailing list archive at Nabble.com. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2403797
Re: Unable to setup SpringBeanRouter configure
Hi Infinity, On Oct 5, 2009, at 10:03 AM, infinity wrote: > I'm trying to setup a SpringBeanRouter as per the javadocs since I > cannot use > SpringRouter if I use spring prototype beans for attachements acc to > this > http://n2.nabble.com/Unable-to-inject-Protoype-beans-into-a-singleton-bean-via-value-ref-for-a-Spring-Router-td3756435.html#a3756435 > issue . > > Is there something wrong with the following configuration? > > > http://www.springframework.org/schema/beans"; >xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; > xmlns:util="http://www.springframework.org/schema/util"; >xsi:schemaLocation="http://www.springframework.org/schema/beans > http://www.springframework.org/schema/beans/spring-beans-2.5.xsd";> > > > class="org.restlet.ext.spring.SpringComponent"> > > > HTTP, HTTPS > > > > > > > > > > > > > > > > > > > > > > class="org.restlet.ext.spring.SpringBeanRouter"/> > > > class="com.xx.rest.resource.ContactData" scope="prototype" > autowire="byName"/> > class="com.xxx.mock.resource.ContactData" scope="prototype" > autowire="byName"/> > > The server loads fine but none of Server Resources are invoked. > There is no > stacktrace either. Pl suggest. What sort of server are you using? How are you loading the beans from this context and attaching them to the server? Rhett > > > -- > View this message in context: > http://n2.nabble.com/Unable-to-setup-SpringBeanRouter-configure-tp3769405p3769405.html > Sent from the Restlet Discuss mailing list archive at Nabble.com. > > -- > http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2403701 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2403785
Unable to setup SpringBeanRouter configure
I'm trying to setup a SpringBeanRouter as per the javadocs since I cannot use SpringRouter if I use spring prototype beans for attachements acc to this http://n2.nabble.com/Unable-to-inject-Protoype-beans-into-a-singleton-bean-via-value-ref-for-a-Spring-Router-td3756435.html#a3756435 issue . Is there something wrong with the following configuration? http://www.springframework.org/schema/beans"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xmlns:util="http://www.springframework.org/schema/util"; xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd";> HTTP, HTTPS The server loads fine but none of Server Resources are invoked. There is no stacktrace either. Pl suggest. -- View this message in context: http://n2.nabble.com/Unable-to-setup-SpringBeanRouter-configure-tp3769405p3769405.html Sent from the Restlet Discuss mailing list archive at Nabble.com. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2403701