Uploaded image for project: 'TomEE'
  1. TomEE
  2. TOMEE-4011

Multi-threaded Deployment of multiple war-files runs in TomEERuntimeException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 9.0.0.RC1, 8.0.11, 8.0.13
    • None
    • TomEE Core Server

    Description

       

      Precondition:

      • set startStopThreads="0" in server.xml to enable multi-threaded deployments
      • deploy multiple war files in parallel

      Result:

       FINEST|16588/0|22-06-24 13:30:35|    Caused by: org.apache.tomee.catalina.TomEERuntimeException: org.apache.openejb.OpenEJBException: Creating application failed: C:\services\tomee\webapps\my-services: ValidatorFactory already exists for module 1: ParsedName{path=openejb/ValidatorFactory/1, component=1}
      FINEST|16588/0|22-06-24 13:30:35|        at org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:1352)
      FINEST|16588/0|22-06-24 13:30:35|        at org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAppBuilder.java:1162)
      FINEST|16588/0|22-06-24 13:30:35|        at org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:134)
      FINEST|16588/0|22-06-24 13:30:35|        at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
      FINEST|16588/0|22-06-24 13:30:35|        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5135)
      FINEST|16588/0|22-06-24 13:30:35|        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
      FINEST|16588/0|22-06-24 13:30:35|        ... 13 more
      FINEST|16588/0|22-06-24 13:30:35|    Caused by: org.apache.openejb.OpenEJBException: Creating application failed: C:\services\tomee\webapps\my-services: ValidatorFactory already exists for module 1: ParsedName{path=openejb/ValidatorFactory/1, component=1}
      FINEST|16588/0|22-06-24 13:30:35|        at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:1107)
      FINEST|16588/0|22-06-24 13:30:35|        at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:762)
      FINEST|16588/0|22-06-24 13:30:35|        at org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:1340)
      FINEST|16588/0|22-06-24 13:30:35|        ... 18 more
      FINEST|16588/0|22-06-24 13:30:35|    Caused by: org.apache.openejb.OpenEJBException: ValidatorFactory already exists for module 1: ParsedName{path=openejb/ValidatorFactory/1, component=1}
      FINEST|16588/0|22-06-24 13:30:35|        at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:911)
      FINEST|16588/0|22-06-24 13:30:35|        ... 20 more
      FINEST|16588/0|22-06-24 13:30:35|    Caused by: javax.naming.NameAlreadyBoundException: ParsedName{path=openejb/ValidatorFactory/1, component=1}
      FINEST|16588/0|22-06-24 13:30:35|        at org.apache.openejb.core.ivm.naming.NameNode.bind(NameNode.java:180)
      FINEST|16588/0|22-06-24 13:30:35|        at org.apache.openejb.core.ivm.naming.NameNode.bind(NameNode.java:190)
      FINEST|16588/0|22-06-24 13:30:35|        at org.apache.openejb.core.ivm.naming.NameNode.bind(NameNode.java:163)
      FINEST|16588/0|22-06-24 13:30:35|        at org.apache.openejb.core.ivm.naming.NameNode.bind(NameNode.java:197)
      FINEST|16588/0|22-06-24 13:30:35|        at org.apache.openejb.core.ivm.naming.NameNode.bind(NameNode.java:197)
      FINEST|16588/0|22-06-24 13:30:35|        at org.apache.openejb.core.ivm.naming.NameNode.bind(NameNode.java:190)
      FINEST|16588/0|22-06-24 13:30:35|        at org.apache.openejb.core.ivm.naming.NameNode.bind(NameNode.java:190)
      FINEST|16588/0|22-06-24 13:30:35|        at org.apache.openejb.core.ivm.naming.NameNode.bind(NameNode.java:163)
      FINEST|16588/0|22-06-24 13:30:35|        at org.apache.openejb.core.ivm.naming.NameNode.bind(NameNode.java:190)
      FINEST|16588/0|22-06-24 13:30:35|        at org.apache.openejb.core.ivm.naming.IvmContext.bind(IvmContext.java:322)
      FINEST|16588/0|22-06-24 13:30:35|        at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:897)
      FINEST|16588/0|22-06-24 13:30:35|        ... 20 more
      FINEST|16588/0|22-06-24 13:30:35|24-Jun-2022 13:30:34.698 INFO [Catalina-utility-3] sun.reflect.DelegatingMethodAccessorImpl.invoke Deployment of web application archive [C:\services\tomee\webapps\my-services.war] has finished in [25,288] ms 

      The reason might be that 

      org.apache.openejb.config.Module is not thread-safe and the method  module.getUniqueId() does not return unique id's. The attached patch could fix this issue.

      This exception does not occur on every startup (because it is a race condition) but the more war's are deployed the more likely you get the exception.

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            mkuballa Marco Kuballa
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: