Uploaded image for project: 'Weld'
  1. Weld
  2. WELD-2166

UnsupportedOperationException during initialization if an interceptor enabled both for the application and for the synthetic bean archive

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 2.3.5.Final
    • 2.3.4.Final
    • Java SE Support
    • None

      Code:

              WeldContainer weld = new Weld()
                      .containerId(id)
                      .disableDiscovery()
                      .beanClasses(classes)
                      .addInterceptor(TransactionalInterceptor.class)
                      .addBeanClass(TransactionSupport.class)
                      .extensions(new TransactionExtension(), new OsgiExtension())
                      .initialize();
      

      Exception:

      java.lang.UnsupportedOperationException
      	at com.google.common.collect.UnmodifiableIterator.remove(UnmodifiableIterator.java:43)
      	at com.google.common.collect.TransformedIterator.remove(TransformedIterator.java:53)
      	at org.jboss.weld.bootstrap.enablement.GlobalEnablementBuilder.filter(GlobalEnablementBuilder.java:296)
      	at org.jboss.weld.bootstrap.enablement.GlobalEnablementBuilder.createModuleEnablement(GlobalEnablementBuilder.java:239)
      	at org.jboss.weld.bootstrap.BeanDeployment.createEnablement(BeanDeployment.java:213)
      	at org.jboss.weld.bootstrap.WeldStartup.startInitialization(WeldStartup.java:389)
      	at org.jboss.weld.bootstrap.WeldBootstrap.startInitialization(WeldBootstrap.java:76)
      	at org.jboss.weld.environment.se.Weld.initialize(Weld.java:583)
      	at org.apache.aries.jpa.cdi.AbstractTest.createCdi(AbstractTest.java:141)
      	at org.apache.aries.jpa.cdi.AbstractTest.createCdi(AbstractTest.java:129)
      	at org.apache.aries.jpa.cdi.SimpleTest.test(SimpleTest.java:54)
      

      The collection comes from Weld#buildSyntheticBeansXml() which creates immutable collections.

              mkouba@redhat.com Martin Kouba
              g_nodet Guillaume Nodet (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: