Hi Ryan, I suggest to update to the official RC6 release in case something changed since your snapshot (unlikely). Otherwise, if you could send us a reproducible example (based on tutorial part 12 or on your own code) that would help us debug this issue more quickly. You can send it privately to [EMAIL PROTECTED] if you prefer.
For example, if you override init(Context, Request, Response) in your custom Resource, and forget to invoke super.init() first, then when you do a getContext(), a new context is created because the one from the application wasn't saved by the super.init() method... Best regards, Jerome > -----Message d'origine----- > De : Ryan Daum [mailto:[EMAIL PROTECTED] > Envoyé : mardi 13 mars 2007 20:19 > À : [email protected] > Objet : Re: Possible bug in ServerServlet? > > Jerome, it seems that the Context that I am getting inside my > resource is a different instance than the one inside my > Application. I was able to verify this, but unable to see > where in the call chain it occured precisely. > > This is with the early RC6 you provided. > > This is preventing me not only from passing in values through > the context attributes, but also from accessing the Spring > application context from inside the resource (since the > Context I have further down is not a ServletContextAdapter. > > Any ideas? > > Ryan > > > On 3/13/07, Jerome Louvel <[EMAIL PROTECTED]> wrote: > > > Hi Ryan, > > I was able to successfully modify the Tutorial Part12 to use the > SpringFinder and to pass a value via the context to the > target User resource > (see files attached). I haven't used Spring for the > wiring but the > SpringFinder code in itself seems to work fine. > > Let us know if you still have the issue. > > Best regards, > Jerome > > > -----Message d'origine----- > > De : Ryan Daum [mailto: [EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]> ] > > Envoyé : samedi 10 mars 2007 18:11 > > À : [email protected] > > Objet : Re: Possible bug in ServerServlet? > > > > Thanks Jerome; > > > > I'm having another problem now, which I can't seem to track > > down. It could be a problem with my code, but this worked in > > RC4. In my Application subclass I am doing the following: > > > > /* > > * Some attributes everybody needs. > > */ > > context.getAttributes().put(MODEL_KEY, model); > > context.getAttributes().put(REGISTRY_KEY, registry); > > > > Later, inside my resource (which is now instantiated with > > SpringFinder, so that's one difference): > > > > // obtain model from context > > this.rdfModel = (Model) > > > context.getAttributes().get(AbstractRestApplication.MODEL_KEY); > > > > Unfortunately, the attributes map is empty now, and the RDF > > Model comes out as null. > > > > Is this a bug? If not, what is the most acceptable way to > > share global state initialized by the application? I might > > end up having to inject it with Spring... > > > > Ryan > > > > > > On 3/9/07, Jerome Louvel < [EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]> > wrote: > > > > > > Hi Ryan, > > > > This is a bug that I've just fixed. I have uploaded a > > snapshot with the fix > > which is also available in SVN. Let me know if it let's > > you get the > > ServletContexAdapter (and associated > ServletContext) as before: > > http://www.restlet.org/downloads/1.0/current.zip > > > > Best regards, > > Jerome > > > > > -----Message d'origine----- > > > De : Ryan Daum [mailto: [EMAIL PROTECTED] > > > Envoyé : vendredi 9 mars 2007 22:14 > > > À : [email protected] > > > Objet : Possible bug in ServerServlet? > > > > > > Line 197 sets the context of the created > application to a > > > ServletContextAdapter; however this only > happens in the case > > > that a NoSuchMethodException is triggered by > the attempt to > > > create the Application through its > constructor. Thus if one > > > has a valid constructor on the Application, > one does not get > > > a ServletContextAdapter, just a plain > ApplicationContext. > > > > > > Is this intentional? It seems errant... > > > > > > -- > > > Ryan Daum > > > [EMAIL PROTECTED] > > > Technical Lead, Toronto > > > 647.724.5232 x 2073 > > > > > > > > > > > > > > > -- > > Ryan Daum > > [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > > Senior Developer, Toronto > > 647.724.5232 x 2073 > > > > > > > > > -- > Ryan Daum > [EMAIL PROTECTED] > Senior Developer, Toronto > 647.724.5232 x 2073 >

