[ 
https://issues.apache.org/jira/browse/TOMEE-4011?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Richard Zowalla updated TOMEE-4011:
-----------------------------------
    Labels: patch-available  (was: )

> Multi-threaded Deployment of multiple war-files runs in TomEERuntimeException
> -----------------------------------------------------------------------------
>
>                 Key: TOMEE-4011
>                 URL: https://issues.apache.org/jira/browse/TOMEE-4011
>             Project: TomEE
>          Issue Type: Bug
>          Components: TomEE Core Server
>    Affects Versions: 9.0.0.RC1, 8.0.11, 8.0.13
>            Reporter: Marco Kuballa
>            Priority: Major
>              Labels: patch-available
>         Attachments: fix_concurrency_issue_with_Module_uniqueId.patch
>
>
>  
> +*Precondition:*+
>  * set startStopThreads="0" in server.xml to enable multi-threaded deployments
>  * deploy multiple war files in parallel
> +*Result:*+
> {code:java}
>  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 {code}
> 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.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to