Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-1730

Wrong TCCL during ValidatorFactory retrieval

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 8.0.0.Alpha3
    • Fix Version/s: 8.0.0.Alpha4
    • Component/s: None
    • Labels:
      None

      Description

      Here https://github.com/wildfly/wildfly/blob/master/ee/src/main/java/org/jboss/as/ee/beanvalidation/ValidatorJndiInjectable.java#L52

      the TCCL is set to the classloader of the ValidatorFactory. If the ValidatorFactory is LazyValidatorFactory which delegates to a client proxy obtained from Weld, this call fails with

      Caused by: java.lang.IllegalStateException: JBAS016071: Singleton not set for ModuleClassLoader for Module "org.jboss.as.ee:main" from local module loader @76724357 (finder: local module finder @47a34181 (r$
              at org.jboss.as.weld.services.ModuleGroupSingletonProvider$TCCLSingleton.get(ModuleGroupSingletonProvider.java:75) [wildfly-weld-8.0.0.Alpha4-SNAPSHOT.jar:8.0.0.Alpha4-SNAPSHOT]
              at org.jboss.weld.Container.instance(Container.java:54) [weld-core-impl-2.0.2.Final.jar:2013-06-27 10:15]
              at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:70) [weld-core-impl-2.0.2.Final.jar:2013-06-27 10:15]
              at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:100) [weld-core-impl-2.0.2.Final.jar:2013-06-27 10:15]
              at org.jboss.weld.proxies.ValidatorFactory$618047133$Proxy$_$$_WeldClientProxy.getValidator(Unknown Source) [weld-core-impl-2.0.2.Final.jar:]
              at org.jboss.as.ee.beanvalidation.LazyValidatorFactory.getValidator(LazyValidatorFactory.java:83)
              at org.jboss.as.ee.beanvalidation.ValidatorJndiInjectable.getInstanceSafely(ValidatorJndiInjectable.java:53)
              at org.jboss.as.ee.beanvalidation.ValidatorJndiInjectable.getInstanceClassName(ValidatorJndiInjectable.java:61)
              at org.jboss.as.naming.ServiceBasedNamingStore.list(ServiceBasedNamingStore.java:176)
              at org.jboss.as.naming.NamingContext.list(NamingContext.java:323)
              at org.jboss.as.naming.InitialContext.list(InitialContext.java:140)
              at org.jboss.as.naming.NamingContext.list(NamingContext.java:339)
              at javax.naming.InitialContext.list(InitialContext.java:455) [rt.jar:1.7.0_25]
              at org.jboss.as.test.integration.web.injection.SimpleServlet.testAS7_5347(SimpleServlet.java:59) [classes:]
              ... 29 more
      

      My assumption is that setting the TCCL is not necessary here at all though I may be wrong.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  emmartins Eduardo Martins
                  Reporter:
                  jharting Jozef Hartinger
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: