Legacy Knowledge Base
Published Sep. 10, 2025

Deployment of WAR files with many jar dependencies is very slow in DXP

Written By

Zalán Szakolci

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

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
Did this article resolve your issue ?

Legacy Knowledge Base