-3

My development tomee automatically reloads the context when deployment is finished. The log indicates that new Jars have been added but I havent done anything.

Why is the Context reloading?

sep 03, 2018 8:29:35 FM org.apache.openejb.server.cxf.rs.CxfRsHttpListener configureFactory INFO:
com.dassault_systemes.federated_search.search_utils.answer.SearchAnswerMessageBodyWriter@1722ba49 sep 03, 2018 8:29:35 FM org.apache.openejb.server.cxf.rs.CxfRsHttpListener configureFactory INFO:
com.dassault_systemes.platform.restServices.MediaProviderJSON@118a5aca sep 03, 2018 8:29:35 FM org.apache.openejb.server.cxf.rs.CxfRsHttpListener configureFactory INFO:
com.dassault_systemes.platform.restServices.MediaProviderJSONP@64dec4ca sep 03, 2018 8:29:35 FM org.apache.openejb.server.cxf.rs.CxfRsHttpListener configureFactory INFO:
com.dassault_systemes.platform.ven.jackson.jaxrs.json.JsonParseExceptionMapper@5d35cfc8 sep 03, 2018 8:29:35 FM org.apache.openejb.server.cxf.rs.CxfRsHttpListener configureFactory INFO:
com.dassault_systemes.platform.ven.jackson.jaxrs.json.JacksonJaxbJsonProvider@5f47c6d5 sep 03, 2018 8:29:35 FM org.apache.openejb.server.cxf.rs.CxfRsHttpListener configureFactory INFO:
com.dassault_systemes.platform.ven.jackson.jaxrs.json.JacksonJsonProvider@1c588bfd sep 03, 2018 8:29:35 FM org.apache.openejb.server.cxf.rs.CxfRsHttpListener configureFactory INFO:
com.dassault_systemes.platform.ven.jackson.jaxrs.json.JsonMappingExceptionMapper@eb2f428 sep 03, 2018 8:29:35 FM org.apache.openejb.server.cxf.rs.CxfRsHttpListener configureFactory INFO:
org.apache.openejb.server.cxf.rs.EJBAccessExceptionMapper@5d3567dc sep 03, 2018 8:29:35 FM org.apache.openejb.server.cxf.rs.CxfRsHttpListener logEndpoints INFO: REST Application: http://localhost:9311/3dspace/resources/PreCost
-> com.matrixone.apps.apr.costing.precost.service.PreCostServiceModular sep 03, 2018 8:29:35 FM org.apache.openejb.server.cxf.rs.CxfRsHttpListener logEndpoints INFO: Service URI: http://localhost:9311/3dspace/resources/PreCost/PreCostServices
-> Pojo com.matrixone.apps.apr.costing.precost.service.PreCostService sep 03, 2018 8:29:35 FM org.apache.openejb.server.cxf.rs.CxfRsHttpListener logEndpoints INFO: GET http://localhost:9311/3dspace/resources/PreCost/PreCostServices/getChartData -> Response getChartData(HttpServletRequest) throws Exception [2018-09-03 08:29:35,460] Artifact castor-webapp:war exploded: Artifact is deployed successfully [2018-09-03 08:29:35,462] Artifact castor-webapp:war exploded: Deploy took 266 999 milliseconds [TIMING] [pool-8-thread-1] INFO 2018-09-03T08:29:37,266 - The call to [com.hm.pdm.core.common.department.DepartmentLogicImpl.getAll()] returned normally after 5933 ms. - {} [TIMING] [pool-8-thread-1] INFO 2018-09-03T08:29:37,267 - The call to [com.hm.pdm.core.common.department.DepartmentLogicImpl.getAll()] returned normally after 5935 ms. - {} sep 03, 2018 8:29:40 FM org.apache.catalina.loader.WebappClassLoaderBase modified INFO:
Additional JARs have been added sep 03, 2018 8:29:40 FM org.apache.catalina.core.StandardContext reload INFO: Reloading Context with name [/3dspace] has started [SPRING] [ContainerBackgroundProcessor[StandardEngine[Catalina]]] INFO 2018-09-03T08:29:41,005 (AbstractApplicationContext.java:987) - Closing WebApplicationContext for namespace 'SpringMVC-servlet': startup date [Mon Sep 03 08:29:25 CEST 2018]; parent: Root WebApplicationContext - {} [TVC-SYSTEM] [ContainerBackgroundProcessor[StandardEngine[Catalina]]] INFO 2018-09-03T08:29:41,024 (TVCServlet.java:179) - Shutdown in progress... - {} [TVC-SYSTEM] [ContainerBackgroundProcessor[StandardEngine[Catalina]]] INFO 2018-09-03T08:29:41,061 (TVCServlet.java:182) - Heippa - {} [CASTOR] [ContainerBackgroundProcessor[StandardEngine[Catalina]]] DEBUG 2018-09-03T08:29:41,126 (AjaxJSONTransactionFilter.java:101) - Destroying AjaxJSONTransactionFilter... - {} [CASTOR] [ContainerBackgroundProcessor[StandardEngine[Catalina]]] INFO 2018-09-03T08:29:41,131 (Log.java:440) - org.tuckey.web.filters.urlrewrite.UrlRewriteFilter INFO: destroy called - {} [CASTOR] [ContainerBackgroundProcessor[StandardEngine[Catalina]]] DEBUG 2018-09-03T08:29:41,131 (AjaxJSONServiceFilter.java:62) - Destroying AjaxJSONServiceFilter... - {} [CASTOR] [ContainerBackgroundProcessor[StandardEngine[Catalina]]] DEBUG 2018-09-03T08:29:41,132 (AjaxJSONTransactionFilter.java:101) - Destroying QaTransactionFilter... - {} [SPRING] [ContainerBackgroundProcessor[StandardEngine[Catalina]]] INFO 2018-09-03T08:29:41,171 (AbstractApplicationContext.java:987) - Closing Root WebApplicationContext: startup date [Mon Sep 03 08:27:41 CEST 2018]; root of context hierarchy - {} [CASTOR] [ContainerBackgroundProcessor[StandardEngine[Catalina]]] INFO 2018-09-03T08:29:41,175 (AbstractExecutorsConfiguration.java:116) - About to destroy executor: CORE_ASYNC_JOBS - {} [CASTOR] [ContainerBackgroundProcessor[StandardEngine[Catalina]]] INFO 2018-09-03T08:29:41,175 (AbstractExecutorsConfiguration.java:116) - About to destroy executor: CORE_ASYNCHRONOUSLY_WITH_DELAY - {} [SPRING] [ContainerBackgroundProcessor[StandardEngine[Catalina]]] INFO 2018-09-03T08:29:41,175 (MBeanExporter.java:449) - Unregistering JMX-exposed beans on shutdown - {} [SPRING] [ContainerBackgroundProcessor[StandardEngine[Catalina]]] INFO 2018-09-03T08:29:41,175 (MBeanRegistrationSupport.java:241) - Unregistering JMX-exposed beans - {} sep 03, 2018 8:29:41 FM org.apache.openejb.assembler.classic.Assembler destroyApplication INFO: Undeploying app: C:\GIT\castor\castor-main\HM_PDM\src\castor-webapp\target\castor-webapp sep 03, 2018 8:29:42 FM org.apache.openejb.util.OptionsLog info INFO: Using 'openjpa.Log=org.apache.openejb.openjpa.JULOpenJPALogFactory' sep 03, 2018 8:29:42 FM org.apache.openejb.assembler.classic.Assembler destroyApplication WARNING: Log4j not installed. The following properties will be ignored. sep 03, 2018 8:29:42 FM org.apache.openejb.assembler.classic.Assembler destroyApplication WARNING: Ignored Property overrides property 'log4j.skipJansi' sep 03, 2018 8:29:42 FM org.apache.openejb.assembler.classic.Assembler destroyApplication INFO: Undeployed app: C:\GIT\castor\castor-main\HM_PDM\src\castor-webapp\target\castor-webapp sep 03, 2018 8:29:42 FM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads SEVERE: The web application [/3dspace] appears to have started a thread named [Timer-0] but has failed to stop it. This is very likely to create a memory leak. sep 03, 2018 8:29:42 FM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads SEVERE: The web application [/3dspace] appears to have started a thread named [oracle.jdbc.driver.BlockSource.ThreadedCachingBlockSource.BlockReleaser] but has failed to stop it. This is very likely to create a memory leak. sep 03, 2018 8:29:42 FM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads

Jesper
  • 304
  • 6
  • 10

1 Answers1

1

I can't say for sure for TomEE, but Tomcat's algorithm is dead simple: Scan the webapps folder for changed files (or folders if you work with Exploded WARs, it's quite the same in terms of the asked question).

The file is considered changed if its last modification/update time changes. Another option is that a file is completely new.

When such a file is detected, it triggers the undeploy of the old version of the application and deploys a new one.

Note, this algorithm doesn't analyze the file for internal changes, its just doesn't matter, if you changed the file, then probably you wanted it to redeploy.

So the answer is simple - just don't update the webapps folder if you don't want to redeploy.

Mark Bramnik
  • 39,963
  • 4
  • 57
  • 97