Duplicate loading of applications in XP7

Enonic version: 7.2.1
OS: Windows 10

Hi ya,

I’m using gradle deploy to build my apps, this creates a jar-file and puts in the /$XP_HOME/deploy folder. After I while this app had many updates and newer releases, it ended up with something like 10+ different jar-files for the same app inside the deploy folder. After installing a “hello world boot kitten” in the main.js of this app I can see this kitten being initiated for each jar-file. This cannot be optimal way of booting apps? To me it looks like every version of the same app is being installed and started, until the newest one takes precedence. But there’s no reason at all to install or start the old apps, it could even lead to some very hard to debug problems.

Here, see the hello world boot kitten in action using two numbered versions of the same app at the start of XP7. One kitten comes from 1.0.5-SNAPSHOT the other from 1.0.6-SNAPSHOT. Before reporting this I had 10 different versions of the app, all of them being installed and their main.js being executed.

We use a simple gradle script to strip the version number from the jar file. We add this to run after the deploy task in our projects.

    doLast {
        copy {
            from "build/libs/${projectName}-${version}.jar"
            into "${deployDir}"
            rename ("${projectName}-${version}.jar", "${projectName}.jar")
        }
    }
1 Like

Thx Daniel, nice idea, that would mitigate the problem.

I now have five cats btw! Which is weird, since I only have 4 jar-files of the same app in that deploy-folder.

2020-03-18 19:47:52,686 INFO  org.eclipse.jetty.server.session - No SessionScavenger set, using defaults
2020-03-18 19:47:52,691 INFO  org.eclipse.jetty.server.session - 1e18987f-0c84-494d-ab5a-3f3fb3de43d3 Scavenging every 660000ms
2020-03-18 19:47:52,741 INFO  o.e.jetty.server.AbstractConnector - Started xp@5ac2cab3{HTTP/1.1,[http/1.1]}{0.0.0.0:8080}
2020-03-18 19:47:52,749 INFO  o.e.jetty.server.AbstractConnector - Started api@5bf7e4b5{HTTP/1.1,[http/1.1]}{0.0.0.0:4848}
2020-03-18 19:47:52,757 INFO  o.e.jetty.server.AbstractConnector - Started status@53ac7aa7{HTTP/1.1,[http/1.1]}{0.0.0.0:2609}
2020-03-18 19:47:52,759 INFO  org.eclipse.jetty.server.Server - Started @46389ms
2020-03-18 19:47:52,772 INFO  c.e.xp.web.jetty.impl.JettyService - Started Jetty
2020-03-18 19:47:52,773 INFO  c.e.xp.web.jetty.impl.JettyService - Listening on ports [8080](xp), [4848](management) and [2609](monitoring)
2020-03-18 19:47:54,345 INFO  c.e.x.c.i.app.ApplicationServiceImpl - Searching for installed applications
2020-03-18 19:47:55,671 INFO  c.e.x.c.i.app.ApplicationServiceImpl - Found [14] installed applications
2020-03-18 19:47:55,933 INFO  c.e.x.c.i.app.ApplicationServiceImpl - Stored application [com.gjensidige.builders.theme] installed successfully
2020-03-18 19:47:56,091 INFO  c.e.x.c.i.app.ApplicationServiceImpl - Application [com.gjensidige.builders.theme] started successfully
2020-03-18 19:47:56,572 INFO  c.e.x.c.i.app.ApplicationServiceImpl - Stored application [com.enonic.app.oidcidprovider] installed successfully
2020-03-18 19:47:56,620 INFO  com.gjensidige.builders.theme - (/main.js) ***init_the_cat****************************
2020-03-18 19:47:56,645 INFO  com.gjensidige.builders.theme - (/main.js) *       |\      _,,,---,,_
2020-03-18 19:47:56,666 INFO  com.gjensidige.builders.theme - (/main.js) * ZZZzz /,`.-'`'    -.  ;-;;,_
2020-03-18 19:47:56,681 INFO  com.gjensidige.builders.theme - (/main.js) *      |,4-  ) )-,_. ,\ (  `'-'
2020-03-18 19:47:56,704 INFO  com.gjensidige.builders.theme - (/main.js) *     '---''(_/--'  `-'\_)  Builder's Cat
2020-03-18 19:47:56,711 INFO  com.gjensidige.builders.theme - (/main.js) *******************************************
2020-03-18 19:47:56,705 INFO  c.e.x.c.i.app.ApplicationServiceImpl - Application [com.enonic.app.oidcidprovider] started successfully
2020-03-18 19:47:56,996 INFO  c.e.x.c.i.app.ApplicationServiceImpl - Stored application [systems.rcd.enonic.datatoolbox] installed successfully
2020-03-18 19:47:57,303 INFO  c.e.x.c.i.app.ApplicationServiceImpl - Application [systems.rcd.enonic.datatoolbox] started successfully
2020-03-18 19:47:57,343 INFO  systems.rcd.enonic.datatoolbox - (/main.js) Data Toolbox started.
2020-03-18 19:47:57,769 INFO  c.e.x.c.i.app.ApplicationServiceImpl - Stored application [com.enonic.app.contentstudio] installed successfully
2020-03-18 19:47:57,933 INFO  c.e.x.c.i.app.ApplicationServiceImpl - Application [com.enonic.app.contentstudio] started successfully
2020-03-18 19:47:58,087 INFO  c.e.x.c.i.app.ApplicationServiceImpl - Stored application [com.enonic.app.contentviewer] installed successfully
2020-03-18 19:47:58,181 INFO  c.e.x.c.i.app.ApplicationServiceImpl - Application [com.enonic.app.contentviewer] started successfully
2020-03-18 19:47:58,515 INFO  c.e.x.c.i.app.ApplicationServiceImpl - Stored application [com.enonic.app.guillotine] installed successfully
2020-03-18 19:47:58,690 INFO  c.e.x.c.i.app.ApplicationServiceImpl - Application [com.enonic.app.guillotine] started successfully
2020-03-18 19:47:58,903 INFO  c.e.x.c.i.app.ApplicationServiceImpl - Stored application [com.enonic.app.graphiql] installed successfully
2020-03-18 19:47:59,187 INFO  c.e.x.c.i.app.ApplicationServiceImpl - Application [com.enonic.app.graphiql] started successfully
2020-03-18 19:47:59,364 INFO  c.e.x.c.i.app.ApplicationServiceImpl - Stored application [com.enonic.app.sitemapxml] installed successfully
2020-03-18 19:47:59,570 INFO  c.e.x.c.i.app.ApplicationServiceImpl - Application [com.enonic.app.sitemapxml] started successfully
2020-03-18 19:47:59,783 INFO  c.e.x.c.i.app.ApplicationServiceImpl - Stored application [com.enonic.app.cronjob] installed successfully
2020-03-18 19:47:59,996 INFO  c.e.x.c.i.app.ApplicationServiceImpl - Application [com.enonic.app.cronjob] started successfully
2020-03-18 19:48:00,385 INFO  c.e.x.c.i.app.ApplicationServiceImpl - Stored application [com.enonic.app.snapshotter] installed successfully
2020-03-18 19:48:00,635 INFO  c.e.a.snapshotter.SnapshotRunnerImpl - All notifiers configured, starting schedules
2020-03-18 19:48:00,807 INFO  c.e.a.snapshotter.SnapshotRunnerImpl - Scheduler already started
2020-03-18 19:48:00,823 INFO  c.e.a.snapshotter.SnapshotRunnerImpl - Scheduler already started
2020-03-18 19:48:00,823 INFO  c.e.x.c.i.app.ApplicationServiceImpl - Application [com.enonic.app.snapshotter] started successfully
2020-03-18 19:48:00,995 INFO  c.e.x.c.i.app.ApplicationServiceImpl - Stored application [com.enonic.app.metafields] installed successfully
2020-03-18 19:48:01,135 INFO  c.e.x.c.i.app.ApplicationServiceImpl - Application [com.enonic.app.metafields] started successfully
2020-03-18 19:48:01,385 INFO  c.e.x.c.i.app.ApplicationServiceImpl - Stored application [com.enonic.app.siteimprove] installed successfully
2020-03-18 19:48:01,595 INFO  c.e.x.c.i.app.ApplicationServiceImpl - Application [com.enonic.app.siteimprove] started successfully
2020-03-18 19:48:01,891 INFO  c.e.x.c.i.app.ApplicationServiceImpl - Stored application [com.enonic.app.logbrowser] installed successfully
2020-03-18 19:48:02,016 INFO  c.e.x.c.i.app.ApplicationServiceImpl - Application [com.enonic.app.logbrowser] started successfully
2020-03-18 19:48:02,282 INFO  c.e.x.c.i.app.ApplicationServiceImpl - Stored application [com.gjensidige.builders.idprovider] installed successfully
2020-03-18 19:48:02,376 INFO  c.e.x.c.i.app.ApplicationServiceImpl - Application [com.gjensidige.builders.idprovider] started successfully
2020-03-18 19:48:03,078 INFO  c.e.x.c.i.app.ApplicationServiceImpl - Local application [com.gjensidige.builders.theme] installed successfully
2020-03-18 19:48:03,125 INFO  c.e.x.c.i.app.ApplicationServiceImpl - Application [com.gjensidige.builders.theme] started successfully
2020-03-18 19:48:03,172 INFO  com.gjensidige.builders.theme - (/main.js) ***init_the_cat****************************
2020-03-18 19:48:03,188 INFO  com.gjensidige.builders.theme - (/main.js) *       |\      _,,,---,,_
2020-03-18 19:48:03,188 INFO  com.gjensidige.builders.theme - (/main.js) * ZZZzz /,`.-'`'    -.  ;-;;,_
2020-03-18 19:48:03,203 INFO  com.gjensidige.builders.theme - (/main.js) *      |,4-  ) )-,_. ,\ (  `'-'
2020-03-18 19:48:03,219 INFO  com.gjensidige.builders.theme - (/main.js) *     '---''(_/--'  `-'\_)  Builder's Cat
2020-03-18 19:48:03,219 INFO  com.gjensidige.builders.theme - (/main.js) *******************************************
2020-03-18 19:48:03,406 INFO  c.e.x.c.i.app.ApplicationServiceImpl - Local application [com.gjensidige.builders.theme] installed successfully
2020-03-18 19:48:03,516 INFO  c.e.x.c.i.app.ApplicationServiceImpl - Application [com.gjensidige.builders.theme] started successfully
2020-03-18 19:48:03,609 INFO  com.gjensidige.builders.theme - (/main.js) ***init_the_cat****************************
2020-03-18 19:48:03,703 INFO  com.gjensidige.builders.theme - (/main.js) *       |\      _,,,---,,_
2020-03-18 19:48:03,703 INFO  com.gjensidige.builders.theme - (/main.js) * ZZZzz /,`.-'`'    -.  ;-;;,_
2020-03-18 19:48:03,703 INFO  com.gjensidige.builders.theme - (/main.js) *      |,4-  ) )-,_. ,\ (  `'-'
2020-03-18 19:48:03,703 INFO  com.gjensidige.builders.theme - (/main.js) *     '---''(_/--'  `-'\_)  Builder's Cat
2020-03-18 19:48:03,703 INFO  com.gjensidige.builders.theme - (/main.js) *******************************************
2020-03-18 19:48:04,031 INFO  c.e.x.c.i.app.ApplicationServiceImpl - Local application [com.gjensidige.builders.theme] installed successfully
2020-03-18 19:48:04,093 INFO  c.e.x.c.i.app.ApplicationServiceImpl - Application [com.gjensidige.builders.theme] started successfully
2020-03-18 19:48:04,125 INFO  com.gjensidige.builders.theme - (/main.js) ***init_the_cat****************************
2020-03-18 19:48:04,125 INFO  com.gjensidige.builders.theme - (/main.js) *       |\      _,,,---,,_
2020-03-18 19:48:04,140 INFO  com.gjensidige.builders.theme - (/main.js) * ZZZzz /,`.-'`'    -.  ;-;;,_
2020-03-18 19:48:04,140 INFO  com.gjensidige.builders.theme - (/main.js) *      |,4-  ) )-,_. ,\ (  `'-'
2020-03-18 19:48:04,140 INFO  com.gjensidige.builders.theme - (/main.js) *     '---''(_/--'  `-'\_)  Builder's Cat
2020-03-18 19:48:04,218 INFO  com.gjensidige.builders.theme - (/main.js) *******************************************
2020-03-18 19:48:04,447 INFO  c.e.x.c.i.app.ApplicationServiceImpl - Local application [com.gjensidige.builders.theme] installed successfully
2020-03-18 19:48:04,541 INFO  c.e.x.c.i.app.ApplicationServiceImpl - Application [com.gjensidige.builders.theme] started successfully
2020-03-18 19:48:04,635 INFO  com.gjensidige.builders.theme - (/main.js) ***init_the_cat****************************
2020-03-18 19:48:04,650 INFO  com.gjensidige.builders.theme - (/main.js) *       |\      _,,,---,,_
2020-03-18 19:48:04,666 INFO  com.gjensidige.builders.theme - (/main.js) * ZZZzz /,`.-'`'    -.  ;-;;,_
2020-03-18 19:48:04,682 INFO  com.gjensidige.builders.theme - (/main.js) *      |,4-  ) )-,_. ,\ (  `'-'
2020-03-18 19:48:04,682 INFO  com.gjensidige.builders.theme - (/main.js) *     '---''(_/--'  `-'\_)  Builder's Cat
2020-03-18 19:48:04,697 INFO  com.gjensidige.builders.theme - (/main.js) *******************************************
2020-03-18 19:48:04,931 INFO  c.e.x.l.i.framework.FrameworkService - Started Enonic XP in 56298 ms

We have created task to solve this now: https://github.com/enonic/xp-gradle-plugin/issues/24

1 Like