Issue
- If there is a war file which contains many jar dependencies in its WEB-INF/lib, deploying it to the osgi framework in DXP takes too much time - sometimes 20 minutes for a single WAR.
Environment
- Liferay DXP 7.0+
Resolution
- Contact Liferay Support to build a hotfix for you which contains LPS-86820
Additional Information
- When deploying a war file to the osgi framework, the WAB generator scans every class to check for annotations, so a full classpath scan is performed for each ServletContainerInitializer (instead of one scan for all) This takes quadratic time.
There is also a limit in the number of open files the osgi framework can handle, which is set to 100 by default. This limit is easily reached, and once it happens there is significant overhead handling new files. - LPS-86820 contains many optimizations. :
- It adds module.framework.properties.osgi.bundlefile.limit=100000 to increase the file limit
- Annotation scanning can now be blacklisted with a portal property, for example:
module.framework.web.servlet.annotation.scanning.blacklist=\ antlr/,\ ch/qos/logback/,\ com/ctc/wstx/,\ com/fasterxml/jackson/,\ com/google/,\ com/ibm/,\ com/liferay/,\ com/netflix/,\ com/sun/,\ com/thoughtworks/,\ de/odysseus/el/,\ edu/umd/cs/findbugs/,\ io/swagger/annotations/,\ javassist/,\ javax/,\ jersey/repackaged/,\ net/jcip/,\ net/logstash/,\ net/minidev/,\ net/oauth/,\ net/sf/cglib/,\ net/sf/ehcache/,\ nu/validator/,\ ognl/,\ org/antlr/,\ org/aopalliance/,\ org/apache/axis/,\ org/apache/commons/,\ org/apache/cxf/,\ org/apache/el/,\ org/apache/http/,\ org/apache/log4j/,\ org/apache/neethi/,\ org/apache/sanselan/,\ org/apache/shindig/,\ org/apache/shiro/,\ org/apache/taglibs/,\ org/apache/tools/,\ org/apache/velocity/,\ org/apache/ws/,\ org/apache/xml/,\ org/codehaus/,\ org/cyberneko/,\ org/eclipse/,\ org/glassfish/,\ org/hibernate/,\ org/jboss/logging/,\ org/jdom/,\ org/joda/,\ org/json/,\ org/jsoup/,\ org/jvnet/,\ org/objectweb/asm/,\ org/osgi/,\ org/slf4j/,\ org/springframework/aop/,\ org/springframework/asm/,\ org/springframework/beans/,\ org/springframework/cache/,\ org/springframework/cglib/,\ org/springframework/context/,\ org/springframework/core/,\ org/springframework/ejb/,\ org/springframework/expression/,\ org/springframework/format/,\ org/springframework/http/,\ org/springframework/instrument/,\ org/springframework/jmx/,\ org/springframework/jndi/,\ org/springframework/lang/,\ org/springframework/mail/,\ org/springframework/mock/,\ org/springframework/objenesis/,\ org/springframework/remoting/,\ org/springframework/scheduling/,\ org/springframework/scripting/,\ org/springframework/stereotype/,\ org/springframework/test/,\ org/springframework/ui/,\ org/springframework/util/,\ org/springframework/validation/,\ org/springframework/web/,\ org/thymeleaf/,\ org/unbescape/,\ org/xmlpull/,\ org/yaml/ - Annotated classes are now cached (which will make the second bootup much faster)
-
Added support to disable bnd plugins
bnd plugins can now be disabled for WABs, via portal properties.
If you know your WARs do not need bnd plugins, disabling this should help with startup performance.# # Set These to False to Disable Web Generator Bnd Plugins # #module.framework.web.generator.bnd.plugin.enabled[aQute.bnd.cdi.CDIAnnotations]=false #module.framework.web.generator.bnd.plugin.enabled[aQute.bnd.metatype.MetatypeAnnotations]=false