Uploaded image for project: 'Build'
  1. Build
  2. BUILD-1032

Can not install 3.1.x soft-locking module in DX Core bundle

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Neutral Neutral
    • BOM 6.2.31
    • BOM 6.2.9
    • BOM
    • 2

      Reproduce

      1.  Follow soft-locking module documentation to install the module.
      2.  Start up Magnolia, error would show in the log
        2023-03-15 06:01:13,483 ERROR .objectfactory.guice.GuiceComponentProviderBuilder: Magnolia failed to load module configuration with types 
        ...
        ...
        ...
        1) Error injecting constructor, java.lang.IllegalStateException: Duplicate key info.magnolia.module.softlocking.SoftLockingModule (attempted merging values soft-locking and soft-locking-core)
          at info.magnolia.config.module.ModuleMap2BeanTransformer.<init>(ModuleMap2BeanTransformer.java:87)
          while locating info.magnolia.config.module.ModuleMap2BeanTransformer
            for the 7th parameter of info.magnolia.config.module.ModuleConfigurationSourceFactory.<init>(ModuleConfigurationSourceFactory.java:63)
          while locating info.magnolia.config.module.ModuleConfigurationSourceFactory
            for the 3rd parameter of info.magnolia.config.module.ModuleConfigurationRegistry.<init>(ModuleConfigurationRegistry.java:77)
          at info.magnolia.objectfactory.guice.GuiceComponentConfigurationModule.bindImplementation(GuiceComponentConfigurationModule.java:160) (via modules: com.google.inject.util.Modules$OverrideModule -> com.google.inject.util.Modules$OverrideModule -> info.magnolia.objectfactory.guice.GuiceComponentProviderBuilder$1 -> info.magnolia.objectfactory.guice.GuiceComponentConfigurationModule)
          while locating info.magnolia.config.module.ModuleConfigurationRegistry
          while locating info.magnolia.config.registry.Registry annotated with @com.google.inject.internal.Element(setName=,uniqueId=52, type=MULTIBINDER, keyType=)
        Caused by: java.lang.IllegalStateException: Duplicate key info.magnolia.module.softlocking.SoftLockingModule (attempted merging values soft-locking and soft-locking-core)
        	at java.base/java.util.stream.Collectors.duplicateKeyException(Collectors.java:133)
        	at java.base/java.util.stream.Collectors.lambda$uniqKeysMapAccumulator$1(Collectors.java:180)
        	at java.base/java.util.stream.ReduceOps$3ReducingSink.accept(ReduceOps.java:169)
        	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
        	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655)
        	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
        	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
        	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
        	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        	at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
        	at info.magnolia.config.module.ModuleMap2BeanTransformer.<init>(ModuleMap2BeanTransformer.java:92)
        	at info.magnolia.config.module.ModuleMap2BeanTransformer$$FastClassByGuice$$34922d13.newInstance(<generated>)
        	at com.google.inject.internal.DefaultConstructionProxyFactory$FastClassProxy.newInstance(DefaultConstructionProxyFactory.java:89)
        	at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:114)
        	at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:91)
        	at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:306)
        	at com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:42)
        	at com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:65)
        	at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:113)
        	at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:91)
        	at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:306)
        	at com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:42)
        	at com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:65)
        	at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:113)
        	at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:91)
        	at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:306)
        	at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
        	at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:168)
        	at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:39)
        	at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:62)
        	at com.google.inject.internal.InternalInjectorCreator.loadEagerSingletons(InternalInjectorCreator.java:213)
        	at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:184)
        	at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:111)
        	at com.google.inject.Guice.createInjector(Guice.java:87)
        	at com.google.inject.Guice.createInjector(Guice.java:78)
        	at info.magnolia.objectfactory.guice.GuiceComponentProviderBuilder.build(GuiceComponentProviderBuilder.java:148)
        	at info.magnolia.objectfactory.guice.GuiceComponentProviderBuilder.build(GuiceComponentProviderBuilder.java:195)
        	at info.magnolia.cms.beans.config.ConfigLoader.load(ConfigLoader.java:142)
        	at info.magnolia.init.MagnoliaServletContextListener$1.doExec(MagnoliaServletContextListener.java:259)
        	at info.magnolia.context.MgnlContext$VoidOp.exec(MgnlContext.java:407)
        	at info.magnolia.context.MgnlContext$VoidOp.exec(MgnlContext.java:404)
        	at info.magnolia.context.MgnlContext.doInSystemContext(MgnlContext.java:378)
        	at info.magnolia.init.MagnoliaServletContextListener.startServer(MagnoliaServletContextListener.java:256)
        	at info.magnolia.init.MagnoliaServletContextListener.contextInitialized(MagnoliaServletContextListener.java:182)
        	at info.magnolia.init.MagnoliaServletContextListener.contextInitialized(MagnoliaServletContextListener.java:128)
        	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4768)
        	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5230)
        	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396)
        	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386)
        	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        	at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
        	at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)
        	at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919)
        	at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:835)
        	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396)
        	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386)
        	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        	at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
        	at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)
        	at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919)
        	at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:265)
        	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        	at org.apache.catalina.core.StandardService.startInternal(StandardService.java:432)
        	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        	at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:930)
        	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        	at org.apache.catalina.startup.Catalina.start(Catalina.java:772)
        	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:345)
        	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:476)
        

      Expected
      I would expect to be able to install both modules simultaneously.

      Actual
      When installed together a conflict is created.

      Workaround

      • Exclude previous version which included in the bundle, then add a new one, like below:
          <dependencies>
            <dependency>
              <groupId>info.magnolia.dx</groupId>
              <artifactId>magnolia-dx-core-demo-webapp</artifactId>
              <type>pom</type>
              <exclusions>
                <exclusion>
                  <groupId>info.magnolia</groupId>
                  <artifactId>magnolia-module-soft-locking</artifactId>
                </exclusion>
                ....
              </exclusions>
            </dependency>
            
            <dependency>
              <groupId>info.magnolia.soft-locking</groupId>
              <artifactId>magnolia-soft-locking</artifactId>
              <version>3.1.2</version>
            </dependency>
            ....
        
          </dependencies>
        
        

      Notes

      • We have changed the module structure which leads to duplication of the same configured bean Caused by: java.lang.IllegalStateException: Duplicate key info.magnolia.module.softlocking.SoftLockingModule (attempted merging values soft-locking and soft-locking-core)
      • Need to update the bundle POM/BOM to include newer version and remove the old one.

       

      Dev notes

        Acceptance criteria

              miguel.martinez Miguel Martinez
              viet.nguyen Viet Nguyen
              Thomas Duffey
              AuthorX
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved:
                Work Started:

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - Not Specified
                  Not Specified
                  Logged:
                  Time Spent - 1d 2.5h
                  1d 2.5h