On 20/06/2016 13:47, Mark Thomas wrote: > On 20/06/2016 13:27, Mike Noordermeer wrote: >> Further profiling leads me to believe that Tomcat starts using >> JarWarResources if a <Context><Resources/></Context> block is placed >> in the server.xml file (even if unpackWars and unpackWar are true). >> Still looking into why it is doing this though... > > It is caused by the StandardRoot being started earlier (in > StandardContext.initInternal()) before the docBase has been adjusted to > the expanded WAR. > > It may be possible to remove the WebResource initialisation from > StandardContext.initInternal() entirely but that would need some > research to figure out why it was there in the first place.
I dug into the history. It looks to be an unnecessary hangover from the previous resources implementation. This has been fixed in 9.0.x [1] and I'll back-port it to 8.5.x and 8.0.x. Mark [1] http://svn.apache.org/viewvc?view=revision&revision=1749328 > > Mark > >> >> --Mike >> >> On 20 June 2016 at 12:06, Mike Noordermeer <m...@normi.net> wrote: >>> Hi, >>> >>> I'm experiencing a very weird issue, and do not really have an idea >>> where to start looking for the solution, hopefully someone here has an >>> idea. >>> As the Tomcat 8.5 Cache.getResource() call added some logging about >>> the cache being too small, I'm trying to increase the size. The weird >>> thing, is that simply defining a <Resources /> element slows down my >>> webapp startup greatly. >>> >>> ============== >>> >>> Setup 1: >>> >>> server.xml >>> --- >>> <Host name="localhost" appBase="webapps" >>> unpackWARs="true" autoDeploy="false" deployOnStartup="false"> >>> <Context path="" docBase="../app/warfile.war"> >>> <Resources /> >>> </Context> >>> </Host> >>> --- >>> >>> Deploy time app: 180 seconds >>> >>> ============== >>> >>> Setup 2: >>> >>> server.xml >>> --- >>> <Host name="localhost" appBase="webapps" >>> unpackWARs="true" autoDeploy="false" deployOnStartup="true"> >>> </Host> >>> --- >>> >>> Catalina/localhost/ROOT.xml >>> --- >>> <Context docBase="../app/warfile.war"> >>> <Resources /> >>> </Context> >>> --- >>> >>> Deploy time app: 20 seconds >>> >>> ============== >>> >>> If I remove the Resources element, everything is fine in all >>> scenario's (but then I cannot increase the cache size). >>> >>> Going through the code, I can't see what would be different about >>> defining an empty Resources element or no Resources element, or what >>> would be different in defining the webapp in server.xml or in a >>> separate context file. Any insights and ideas are appreciated. >>> >>> Many thanks, >>> >>> Mike >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org >> For additional commands, e-mail: users-h...@tomcat.apache.org >> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org