Reputation: 81
I am developing an application on GAE with spring MVC and using annotations. The application take a long time to load the first time and then it behaves well as long as I access the application. But then when I leave the application for a minute and then I access it again it is taking long time. I have read ppl having similar issues but did not talk about the solution. Has anyone had this problem and was able to fix it ?
One solution was stripping the annotations which I want to do as the last choice.
Thank You
Upvotes: 3
Views: 1582
Reputation: 22045
One way to speed up the initial loading of Spring would be to disable the <context:component-scan base-package="app.controllers" />
line in your springapp-servlet.xml and manually specify all of the controllers in your application like this:
<bean id="rootController" class="app.controllers.RootController" ></bean>
<bean id="otherController" class="app.controllers.OtherController" ></bean>
I'm using Spring MVC on Google App Engine and have gotten loading requests down to ~3 seconds.
Upvotes: 5
Reputation: 2614
There's a precompilation-enabled property in the latest version that you can use to speed this up somewhat. See this article on why. It might not solve runtime-startup issues but I'm hoping the annotations are compile-time.
You can enable it for your application by adding precompilation-enabled to your appengine-web.xml:
<precompilation-enabled>true</precompilation-enabled>
Upvotes: 1