7 Replies Latest reply on Oct 17, 2016 11:01 AM by hannu1

    Deployments do not wait for OSGi dependencies



      We've been facing another issue throughout our update process (described here: Wildfly 10 + JBoss OSGi problems with startup ). In our setup, we have all jars as osgi subsystem capabilities. I know this is not what you recommended arcivanov, but we eager start our bundles and this is the way we control the start order etc. Our webapps (.wars) are placed in the deployments folder and deployment-scanner detects them from there at startup.


      The webapps are dependant on the OSGi bundles, but do not manage to resolve all their indirect dependencies. All the direct dependencies listed in the MANIFEST.MF "Dependencies:" -section of the .war are resolved, but some of the indirect dependencies fail to be resolved. This causes an ERROR: Failed to start service xx.war, Caused by: ModuleNotFoundException: deployment.bar:1.2.3 at addExportedPaths(Module.java:1244). The error does not have the same module every time and some starts are even clean without errors. This lead me to believe this was a concurrency issue and I tested starting Wildfly with flag "-Djboss.msc.max.container.threads=1". With single service thread this ERROR never happens, but the whole system is obviously way slower.


      I should stress that I performed these tests with the original jboss-modules.jar that comes with Wildfly. Same ERROR occurs with the "fix" we made to jboss-modules though.


      It seems the deployments do not wait for indirect dependencies from OSGi bundles to be resolved before concluding that the dependencies were not found. If we let the server boot up and then redeploy those same dependencies they are deployed without issues. Same is true, if we delay deploying our wars by 20 seconds.