Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-12237

[GSS](7.2.z) Too Many Dependencies Error occurs while deploying a large number of SLSBs to EAP 7

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Done
    • Icon: Major Major
    • 7.2.2.CR1, 7.2.2.GA
    • 7.0.2.GA, 7.0.6.GA
    • EJB
    • None

      When deploying an application which contains a large number of stateless session beans (more than approximately 3000 classes) in one ejb-jar, the deploy operation fails due to the following exception (*1).

      2017-06-29 18:34:15,659 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC000001: Failed to start service jboss.deployment.unit."jboss-ejb-remote-server-side.jar".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."jboss-ejb-remote-server-side.jar".INSTALL: WFLYSRV0153: Failed to process phase INSTALL of deployment "jboss-ejb-remote-server-side.jar"
              at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:154)
              at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
              at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
              at java.lang.Thread.run(Thread.java:748)
      Caused by: java.lang.IllegalArgumentException: Too many dependencies specified (max is 16383)    .......... (*1)
              at org.jboss.msc.service.ServiceBuilderImpl.doAddDependency(ServiceBuilderImpl.java:216)
              at org.jboss.msc.service.ServiceBuilderImpl.addDependenciesNoCheck(ServiceBuilderImpl.java:158)
              at org.jboss.msc.service.ServiceBuilderImpl.addDependencies(ServiceBuilderImpl.java:152)
              at org.jboss.msc.service.ServiceBuilderImpl.addDependencies(ServiceBuilderImpl.java:142)
              at org.jboss.as.naming.deployment.JndiNamingDependencyProcessor.deploy(JndiNamingDependencyProcessor.java:59)
              at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:147)
              ... 5 more
      

      The exception (*1) is thrown at line 216 (*2) in org/jboss/msc/service/ServiceBuilderImpl.java.

      202    private Dependency doAddDependency(final ServiceName name, final DependencyType type) {
      203        if (name == null) {
      204            throw new IllegalArgumentException("name is null");
      205        }
      206        if (type == null) {
      207            throw new IllegalArgumentException("type is null");
      208        }
      209        final Dependency existing = dependencies.get(name);
      210        if (existing != null) {
      211            if (type == DependencyType.REQUIRED) existing.setDependencyType(DependencyType.REQUIRED);
      212            return existing;
      213        }
      214        final Dependency newDep = new Dependency(name, type);
      215        if (dependencies.size() == ServiceControllerImpl.MAX_DEPENDENCIES) {
      216            throw new IllegalArgumentException("Too many dependencies specified (max is " + ServiceControllerImpl.MAX_DEPENDENCIES + ")");    .......... (*2)
      217        }
      218        dependencies.put(name, newDep);
      219        return newDep;
      220    }
      

      When I tested using ejb-remote_01879526.zip attached in this report and traced “name” argument of ServiceBuilderImpl#doAddDependency(final ServiceName name, final DependencyType type) and dependencies.size() at each call using byteman ..... (*3), I found that the following 6 dependencies per SLSB are added from a certain service. If one jar file contains more than about 3000 SLSBs, the total number of dependencies reaches ServiceControllerImpl.MAX_DEPENDENCIES (16383).

      • service jboss.naming.context.java.comp.jboss-ejb-remote-server-side.jboss-ejb-remote-server-side.<class-name>.InAppClientContainer
      • service jboss.naming.context.java.comp.jboss-ejb-remote-server-side.jboss-ejb-remote-server-side.<class-name>.InstanceName
      • service jboss.deployment.unit."jboss-ejb-remote-server-side.jar".component.<class-name>.JndiBindingsService
      • service jboss.naming.context.java.comp.jboss-ejb-remote-server-side.jboss-ejb-remote-server-side.<class-name>.UserTransaction
      • service jboss.naming.context.java.comp.jboss-ejb-remote-server-side.jboss-ejb-remote-server-side.<class-name>.TransactionSynchronizationRegistry
      • service jboss.naming.context.java.comp.jboss-ejb-remote-server-side.jboss-ejb-remote-server-side.<class-name>.BeanManager

      My customer's application contains 3494 SLSBs and they are encountering this issue. Improvement that the number of dependencies from a certain service does not easily reach ServiceControllerImpl.MAX_DEPENDENCIES is needed.

      Steps to Reproduce:

      You can reproduce this issue using ejb-remote_01879526.zip attached in this report which is based on jboss-eap-7.0.0.GA-quickstarts/ejb-remote.

      1. Extract ejb-remote_01879526.zip under jboss-eap-7.0.0.GA-quickstarts directory.
      2. Build ejb-remote_01879526.
        $ cd ejb-remote_01879526
        $ ./generate.sh    ..... (*4)
        $ cd server-side
        $ mvn clean package
        
      3. Deploy jboss-ejb-remote-server-side.jar.
        $ cd ejb-remote_01879526/server-side
        $ mvn wildfly:deploy
        

        If you create 2000 SLSBs using generate.sh, you can deploy jboss-ejb-remote-server-side.jar successfuly.
        If you create 3000 SLSBs, you can see IllegalArgumentException (*1) at deployment time.

      (*3) Byteman script I used is "script.btm" attached in this report.

      (*4) There are 2 scripts in ejb-remote_01879526 directory. To create a large number of SLSBs, specify the number of SLSBs you want to create to NUM_SLSB variable in generate.sh and run it. To remove all SLSBs created by generate.sh, specify the number of all SLSBs to NUM_SLSB variable in remove_generated.sh and run it.

      • generate.sh (script for creating a lot of SLSBs)
      • remove_generated.sh (script for removing all SLSBs created using generate.sh)

        1. script.btm
          0.7 kB
          Masato Yoshida

              ropalka Richard Opalka
              rhn-support-myoshida Masato Yoshida
              Votes:
              0 Vote for this issue
              Watchers:
              14 Start watching this issue

                Created:
                Updated:
                Resolved: