mardi 31 mars 2015

Spring context loader

I have a question about spring context. My application's using spring and spring scheduler. In web.xml, i declared:



<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>


My question is:


If I declared org.springframework.web.context.ContextLoaderListener in web.xml, the scheduler will run twice, all beans are duplicate, and App start-up time about 160 seconds.


If I remove org.springframework.web.context.ContextLoaderListener, spring throws exception: No WebApplicationContext found: no ContextLoaderListener registered. And App start-up time reduce to 80 seconds.


How can i solve it? Thanks all!


Aucun commentaire:

Enregistrer un commentaire