Re initializing Spring root WebApplicationContext

1,591 views
Skip to first unread message

Pravanjan Niranjan

unread,
Feb 24, 2014, 3:48:22 AM2/24/14
to google-a...@googlegroups.com
Hi All ,

  Though i have already optimized my app with spring simple url handler mapping still can see some request reinitializing the app with all controller mapping. 
  This  cause the request to wait more than expected time and sometime id does get timeout which is bad sing for us and user too. 
   
Thanks,
Pravanjan




  • javax.servlet.ServletContext log: Initializing Spring root WebApplicationContext
  • I 2014-02-24 13:49:02.633
    [s~live-jobssystem-v3/7.373722206753019867].<stdout>: [INFO ] at org.springframework.web.context.ContextLoader.(ContextLoader.java:187) : Root WebApplicationContext: initialization started 
     
    
  • I 2014-02-24 13:49:02.798
    [s~live-jobssystem-v3/7.373722206753019867].<stdout>: [INFO ] at org.springframework.context.support.AbstractApplicationContext.(AbstractApplicationContext.java:456) : Refreshing Root WebApplicationContext: startup date [Mon Feb 24 08:19:02 UTC 2014]; root of context hierarchy 
     
    
  • I 2014-02-24 13:49:03.067
    [s~live-jobssystem-v3/7.373722206753019867].<stdout>: [INFO ] at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.(XmlBeanDefinitionReader.java:315) : Loading XML bean definitions from ServletContext resource [/WEB-INF/dispatch-servlet.xml] 
     
    
  • I 2014-02-24 13:49:03.456
    [s~live-jobssystem-v3/7.373722206753019867].<stdout>: [INFO ] at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.(ClassPathScanningCandidateComponentProvider.java:186) : JSR-330 'javax.inject.Named' annotation found and supported for component scanning 
     
    
  • I 2014-02-24 13:49:05.073
    [s~live-jobssystem-v3/7.373722206753019867].<stdout>: [INFO ] at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.(AutowiredAnnotationBeanPostProcessor.java:137) : JSR-330 'javax.inject.Inject' annotation found and supported for autowiring 
     
    
  • I 2014-02-24 13:49:05.151
    [s~live-jobssystem-v3/7.373722206753019867].<stdout>: [INFO ] at org.springframework.beans.factory.support.DefaultListableBeanFactory.(DefaultListableBeanFactory.java:555) : Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@191397: defining beans [googleDriveJobController,salesforceServerResource,scheduleEventResource,messageFormQueue,jobFCController,jobController,directoryManagementController,accountFCController,migrateJobs,backUpController,cronBatchMessageController,batchMessageController,messageController,accountController,migrationDetails,playGroundJobController,jobsAction,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,paramResolver,viewResolver]; root of factory hierarchy 
     
    
  • I 2014-02-24 13:49:06.482
    [s~live-jobssystem-v3/7.373722206753019867].<stdout>: [INFO ] at org.springframework.web.context.ContextLoader.(ContextLoader.java:214) : Root WebApplicationContext: initialization completed in 3849 ms 
     
    

Rafael

unread,
Feb 24, 2014, 1:06:18 PM2/24/14
to google-appengine
Can you describe what optimizations you did already?


--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengi...@googlegroups.com.
To post to this group, send email to google-a...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/groups/opt_out.

Pravanjan Niranjan

unread,
Feb 25, 2014, 9:39:31 AM2/25/14
to google-a...@googlegroups.com
Hi Rafael,
   This is the process which i have used to remove for complete scan of all package. 
    

Thanks
Pravanjan
--
Thanks,
Pravanjan

Rafael

unread,
Feb 25, 2014, 12:53:32 PM2/25/14
to google-appengine
Pravanjan, 

I see you are trying everything to keep the spring initialization low. Welcome to the club. 

Based on your mappings in your example you still have this annotation that I don't think is used anymore: @RequestMapping(value=”/welcome”)

Do you know you can use org.reflections to reduce the component scanning at boot time?
I've written a couple of techniques we used to reduce the boot time with spring: 

Basically, the best results are achieved by using org.reflections and using proguard to shrink the dependencies. 

Unfortunately, all those configurations and optimizations are done across modules and using Maven. The maven integration just completely kills the productivity. 

Our app code base grew big and arrived to a point where it is a real pain to maintain the code base with appengine. 
We are being forced to migrate the web development (HTML rendering) part to something like playframework/nodejs using Compute Engine. 
We are going to make the GCE servlet to call our appengine JSON API's. 

Also, are you aware appengine does a TLD scanning for JSP tags everytime you boot the app? Even if you don't ever use JSP? I'm wondering if you can figure out how to solve that.

thanks
rafa
Reply all
Reply to author
Forward
0 new messages