Re: GAE loses shared resources
Hi Igor, Thanks for the hint, but I don't think that will work for me. I did try to pre-load the resources on application startup, but I was unable to find which resources I'd registered. GAE does not allow any manner of dumpKeys() from the cache. The only-preloading solution I can think of is to have a single cache entry that maintains a list of cached resource keys and update that every time I store to the cache. The downside is that if that entry is lost, pointers to the other entries are lost. Also, it may have stale data if the resource keys are lost. See: http://code.google.com/appengine/docs/java/memcache/usingjcache.html#Features_Not_Supported My hope is to lazily load resources much like PackageResources are done. Any other suggestions or is there something I'm missing? Thanks! Jake -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/GAE-loses-shared-resources-tp2065471p2067654.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: GAE loses shared resources
see org.apache.wicket.extensions.Initializer for an example of how to registered sharedresources on startup -igor 2010/4/26 Jacob Brookover : > Hello all, > > It’s been 2 weeks with no suggestions, so I figured I would give this > another shot. > > I¹m running Wicket on Google App Engine. ?Things have been going fairly > well, but I¹ve encountered a new issue. ?GAE, at any moment, can wipe and > restart your application. ?In doing so, you lose everything including > anything you¹ve added to SharedResources. ?Unfortunately, this can happen in > the middle of a page load as illustrated here: > > -Page request comes in > -MarkupFilter reads initial markup and creates some SharedResources (e.g. > For different image file states) > -MarkupFilter sets the URL in the markup based on the URL provided by the > mounted SharedResource (e.g. ³img/logo.png² becomes > ³/resources/INDIRA/img/logo_d.png² because I wanted the disabled version). > -Markup is returned to the browser > -GAE restarts the application, losing the added SharedResource mapping > -Browser requests the resource according to the mounted URL > -Wicket cannot find resource, missing image > > My current hack idea is to add any shared resource to the GAE MemCache (URL > maps to File). ?That works, but now, I just need to know where Wicket > actually looks up the file so I can add a fallback to check the GAE MemCache > if the file is not found. ?My understanding is that the mounted > SharedResource path resolves to an actual path in the ServletContext, but I > can¹t figure out where that is happening. > > SharedResources.get() is final, so I can’t override that. I found > references to WebRequestCodingStrategy.RESOURCES_PATH_PREFIX, but none of > that seemed to help. ?Finally, I dove deep into WicketFilter, > WebRequest/Response, SharedResourceRequestTarget etc but got completely > lost and didn’t see an obvious solution.. ?I assume it¹s in there someplace, > though. > > Any help would be appreciated. > > Thanks! > > Jake > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
GAE loses shared resources
Hello all, It’s been 2 weeks with no suggestions, so I figured I would give this another shot. I¹m running Wicket on Google App Engine. ?Things have been going fairly well, but I¹ve encountered a new issue. ?GAE, at any moment, can wipe and restart your application. ?In doing so, you lose everything including anything you¹ve added to SharedResources. ?Unfortunately, this can happen in the middle of a page load as illustrated here: -Page request comes in -MarkupFilter reads initial markup and creates some SharedResources (e.g. For different image file states) -MarkupFilter sets the URL in the markup based on the URL provided by the mounted SharedResource (e.g. ³img/logo.png² becomes ³/resources/INDIRA/img/logo_d.png² because I wanted the disabled version). -Markup is returned to the browser -GAE restarts the application, losing the added SharedResource mapping -Browser requests the resource according to the mounted URL -Wicket cannot find resource, missing image My current hack idea is to add any shared resource to the GAE MemCache (URL maps to File). ?That works, but now, I just need to know where Wicket actually looks up the file so I can add a fallback to check the GAE MemCache if the file is not found. ?My understanding is that the mounted SharedResource path resolves to an actual path in the ServletContext, but I can¹t figure out where that is happening. SharedResources.get() is final, so I can’t override that. I found references to WebRequestCodingStrategy.RESOURCES_PATH_PREFIX, but none of that seemed to help. ?Finally, I dove deep into WicketFilter, WebRequest/Response, SharedResourceRequestTarget etc but got completely lost and didn’t see an obvious solution.. ?I assume it¹s in there someplace, though. Any help would be appreciated. Thanks! Jake
Re: GAE loses shared resources
I'm going to bump this with some more information... I see that Application's getSharedResources() is final, as is SharedResources's get() method. So, that doesn't seem like it would work. SharedResourceRequestTarget is referenced in several places directly (not using a factory), so that's probably not ideal. Also, there would be a lot of code duplication in it's get() method. So, still looking for a solution to this issue. Seems pretty critical for extending an application in the cloud. Thanks! Jake jbrookover wrote: > > Hello all, > > I¹m running Wicket on Google App Engine. Things have been going fairly > well, but I¹ve encountered a new issue. GAE, at any moment, can wipe and > restart your application. In doing so, you lose everything including > anything you¹ve added to SharedResources. Unfortunately, this can happen > in > the middle of a page load as illustrated here: > > -Page request comes in > -Nifty MarkupFilter reads initial markup and creates some SharedResources > (for a variety of image states based on the filename in the markup) > -MarkupFilter sets the URL in the markup based on the URL provided by the > mounted SharedResource (e.g. ³img/logo.png² becomes > ³/resources/INDIRA/img/logo_d.png² because I wanted the disabled version). > -Markup is returned to the browser > -GAE restarts the application, losing the added SharedResource mapping > -Browser requests the resource according to the mounted URL > -Wicket cannot find resource, missing image > > My current hack idea is to add any shared resource to the GAE MemCache > (URL > maps to File). That works, but now, I just need to know where Wicket > actually looks up the file so I can add a fallback to check the GAE > MemCache > if the file is not found. My understanding is that the mounted > SharedResource path resolves to an actual path in the ServletContext, but > I > can¹t figure out where that is happening. > > I initially thought that I would just override SharedResources.get(), but > I > don¹t think that is called when simply handling requests. I also found > references to WebRequestCodingStrategy.RESOURCES_PATH_PREFIX, but none of > that seemed to help. Finally, I dove deep into WicketFilter, > WebRequest/Response, SharedResourceRequestTarget etc but got completely > lost. I assume it¹s in there someplace, though. > > Any help would be appreciated. > > Thanks! > > Jake > > -- View this message in context: http://old.nabble.com/GAE-loses-shared-resources-tp28205198p28219156.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
GAE loses shared resources
Hello all, I¹m running Wicket on Google App Engine. Things have been going fairly well, but I¹ve encountered a new issue. GAE, at any moment, can wipe and restart your application. In doing so, you lose everything including anything you¹ve added to SharedResources. Unfortunately, this can happen in the middle of a page load as illustrated here: -Page request comes in -Nifty MarkupFilter reads initial markup and creates some SharedResources (for a variety of image states based on the filename in the markup) -MarkupFilter sets the URL in the markup based on the URL provided by the mounted SharedResource (e.g. ³img/logo.png² becomes ³/resources/INDIRA/img/logo_d.png² because I wanted the disabled version). -Markup is returned to the browser -GAE restarts the application, losing the added SharedResource mapping -Browser requests the resource according to the mounted URL -Wicket cannot find resource, missing image My current hack idea is to add any shared resource to the GAE MemCache (URL maps to File). That works, but now, I just need to know where Wicket actually looks up the file so I can add a fallback to check the GAE MemCache if the file is not found. My understanding is that the mounted SharedResource path resolves to an actual path in the ServletContext, but I can¹t figure out where that is happening. I initially thought that I would just override SharedResources.get(), but I don¹t think that is called when simply handling requests. I also found references to WebRequestCodingStrategy.RESOURCES_PATH_PREFIX, but none of that seemed to help. Finally, I dove deep into WicketFilter, WebRequest/Response, SharedResourceRequestTarget etc but got completely lost. I assume it¹s in there someplace, though. Any help would be appreciated. Thanks! Jake