java.lang.IllegalStateException: JBAS016071: Singleton not set for org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl$AggregatedClassLoader@4eeb95dc. This means that you are trying to access a weld deployment with a Thread Context ClassLoader that is not associated with the deployment.

JBoss Issue Tracker | Emond Papegaaij | 3 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    When trying to use CDI injection in JPA entity listeners, deployment fails with the following exception: {code} 16:16:37,448 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 15) MSC000001: Failed to start service jboss.persistenceunit."inject-ear.ear#primary": org.jboss.msc.service.StartException in service jboss.persistenceunit."inject-ear.ear#primary": java.lang.IllegalStateException: JBAS016071: Singleton not set for org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl$AggregatedClassLoader@4eeb95dc. This means that you are trying to access a weld deployment with a Thread Context ClassLoader that is not associated with the deployment. at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:169) at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:117) at java.security.AccessController.doPrivileged(Native Method) [rt.jar:1.7.0_25] at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:463) [wildfly-security-manager-1.0.0.Beta3.jar:1.0.0.Beta3] at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:178) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_25] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_25] at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_25] at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-threads-2.1.1.Final.jar:2.1.1.Final] Caused by: java.lang.IllegalStateException: JBAS016071: Singleton not set for org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl$AggregatedClassLoader@4eeb95dc. This means that you are trying to access a weld deployment with a Thread Context ClassLoader that is not associated with the deployment. at org.jboss.as.weld.services.ModuleGroupSingletonProvider$TCCLSingleton.get(ModuleGroupSingletonProvider.java:75) at org.jboss.as.weld.services.ModuleGroupSingletonProvider$TCCLSingleton.get(ModuleGroupSingletonProvider.java:128) at org.jboss.weld.Container.instance(Container.java:65) at org.jboss.weld.manager.BeanManagerImpl.getBeans(BeanManagerImpl.java:563) at org.jboss.weld.injection.FieldInjectionPoint.inject(FieldInjectionPoint.java:90) at org.jboss.weld.util.Beans.injectBoundFields(Beans.java:358) at org.jboss.weld.util.Beans.injectFieldsAndInitializers(Beans.java:369) at org.jboss.weld.injection.producer.DefaultInjector.inject(DefaultInjector.java:72) at org.jboss.weld.injection.producer.ResourceInjector.inject(ResourceInjector.java:60) at org.jboss.weld.injection.producer.DefaultInjector$1.proceed(DefaultInjector.java:66) at org.jboss.weld.injection.InjectionContextImpl.run(InjectionContextImpl.java:48) at org.jboss.weld.injection.producer.DefaultInjector.inject(DefaultInjector.java:64) at org.jboss.weld.injection.producer.BasicInjectionTarget.inject(BasicInjectionTarget.java:90) at org.hibernate.jpa.event.internal.jpa.BeanManagerListenerFactory$BeanMetaData.<init>(BeanManagerListenerFactory.java:82) at org.hibernate.jpa.event.internal.jpa.BeanManagerListenerFactory$BeanMetaData.<init>(BeanManagerListenerFactory.java:71) at org.hibernate.jpa.event.internal.jpa.BeanManagerListenerFactory.buildListener(BeanManagerListenerFactory.java:57) at org.hibernate.jpa.event.internal.jpa.LegacyCallbackProcessor.resolveCallbacks(LegacyCallbackProcessor.java:168) at org.hibernate.jpa.event.internal.jpa.LegacyCallbackProcessor.processCallbacksForEntity(LegacyCallbackProcessor.java:71) at org.hibernate.jpa.event.spi.JpaIntegrator.integrate(JpaIntegrator.java:150) at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:310) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1837) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:854) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:847) at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.withTccl(ClassLoaderServiceImpl.java:396) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:846) at org.jboss.as.jpa.hibernate4.TwoPhaseBootstrapImpl.build(TwoPhaseBootstrapImpl.java:44) at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:151) ... 8 more {code} I've created a small showcase of the problem: https://github.com/papegaaij/listener-injection

    JBoss Issue Tracker | 3 years ago | Emond Papegaaij
    java.lang.IllegalStateException: JBAS016071: Singleton not set for org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl$AggregatedClassLoader@4eeb95dc. This means that you are trying to access a weld deployment with a Thread Context ClassLoader that is not associated with the deployment.
  2. 0

    When trying to use CDI injection in JPA entity listeners, deployment fails with the following exception: {code} 16:16:37,448 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 15) MSC000001: Failed to start service jboss.persistenceunit."inject-ear.ear#primary": org.jboss.msc.service.StartException in service jboss.persistenceunit."inject-ear.ear#primary": java.lang.IllegalStateException: JBAS016071: Singleton not set for org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl$AggregatedClassLoader@4eeb95dc. This means that you are trying to access a weld deployment with a Thread Context ClassLoader that is not associated with the deployment. at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:169) at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:117) at java.security.AccessController.doPrivileged(Native Method) [rt.jar:1.7.0_25] at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:463) [wildfly-security-manager-1.0.0.Beta3.jar:1.0.0.Beta3] at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:178) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_25] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_25] at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_25] at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-threads-2.1.1.Final.jar:2.1.1.Final] Caused by: java.lang.IllegalStateException: JBAS016071: Singleton not set for org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl$AggregatedClassLoader@4eeb95dc. This means that you are trying to access a weld deployment with a Thread Context ClassLoader that is not associated with the deployment. at org.jboss.as.weld.services.ModuleGroupSingletonProvider$TCCLSingleton.get(ModuleGroupSingletonProvider.java:75) at org.jboss.as.weld.services.ModuleGroupSingletonProvider$TCCLSingleton.get(ModuleGroupSingletonProvider.java:128) at org.jboss.weld.Container.instance(Container.java:65) at org.jboss.weld.manager.BeanManagerImpl.getBeans(BeanManagerImpl.java:563) at org.jboss.weld.injection.FieldInjectionPoint.inject(FieldInjectionPoint.java:90) at org.jboss.weld.util.Beans.injectBoundFields(Beans.java:358) at org.jboss.weld.util.Beans.injectFieldsAndInitializers(Beans.java:369) at org.jboss.weld.injection.producer.DefaultInjector.inject(DefaultInjector.java:72) at org.jboss.weld.injection.producer.ResourceInjector.inject(ResourceInjector.java:60) at org.jboss.weld.injection.producer.DefaultInjector$1.proceed(DefaultInjector.java:66) at org.jboss.weld.injection.InjectionContextImpl.run(InjectionContextImpl.java:48) at org.jboss.weld.injection.producer.DefaultInjector.inject(DefaultInjector.java:64) at org.jboss.weld.injection.producer.BasicInjectionTarget.inject(BasicInjectionTarget.java:90) at org.hibernate.jpa.event.internal.jpa.BeanManagerListenerFactory$BeanMetaData.<init>(BeanManagerListenerFactory.java:82) at org.hibernate.jpa.event.internal.jpa.BeanManagerListenerFactory$BeanMetaData.<init>(BeanManagerListenerFactory.java:71) at org.hibernate.jpa.event.internal.jpa.BeanManagerListenerFactory.buildListener(BeanManagerListenerFactory.java:57) at org.hibernate.jpa.event.internal.jpa.LegacyCallbackProcessor.resolveCallbacks(LegacyCallbackProcessor.java:168) at org.hibernate.jpa.event.internal.jpa.LegacyCallbackProcessor.processCallbacksForEntity(LegacyCallbackProcessor.java:71) at org.hibernate.jpa.event.spi.JpaIntegrator.integrate(JpaIntegrator.java:150) at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:310) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1837) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:854) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:847) at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.withTccl(ClassLoaderServiceImpl.java:396) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:846) at org.jboss.as.jpa.hibernate4.TwoPhaseBootstrapImpl.build(TwoPhaseBootstrapImpl.java:44) at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:151) ... 8 more {code} I've created a small showcase of the problem: https://github.com/papegaaij/listener-injection

    JBoss Issue Tracker | 3 years ago | Emond Papegaaij
    java.lang.IllegalStateException: JBAS016071: Singleton not set for org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl$AggregatedClassLoader@4eeb95dc. This means that you are trying to access a weld deployment with a Thread Context ClassLoader that is not associated with the deployment.
  3. 0

    Weld Not Working

    wpthm.com | 2 years ago
    java.lang.IllegalStateException: JBAS016071: Singleton not set for ModuleClassLoader for Module "deployment.metaKonnector.war:main" from Service Module Loader. This means that you are trying to access a weld deployment with a Thread Context ClassLoader that is not associated with the deployment.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Problem with Liferay Faces CDI on JBoss 7.1 - Forums | Liferay

    liferay.com | 1 year ago
    java.lang.IllegalStateException: JBAS016071: Singleton not set for ModuleClassLoader for Module "deployment.jsf2-cdi-portlet.war:main" from Service Module Loader. This means that you are trying to access a weld deployment with a Thread Context ClassLoader that is not associated with the deployment.
  6. 0

    Problem with Liferay Faces CDI on JBoss 7.1 - Forums | Liferay

    liferay.com | 1 year ago
    java.lang.IllegalStateException: JBAS016071: Singleton not set for ModuleClassLoader for Module "deployment.jsf2-cdi-portlet.war:main" from Service Module Loader. This means that you are trying to access a weld deployment with a Thread Context ClassLoader that is not associated with the deployment.

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.IllegalStateException

      JBAS016071: Singleton not set for org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl$AggregatedClassLoader@4eeb95dc. This means that you are trying to access a weld deployment with a Thread Context ClassLoader that is not associated with the deployment.

      at org.jboss.as.weld.services.ModuleGroupSingletonProvider$TCCLSingleton.get()
    2. Weld
      ModuleGroupSingletonProvider$TCCLSingleton.get
      1. org.jboss.as.weld.services.ModuleGroupSingletonProvider$TCCLSingleton.get(ModuleGroupSingletonProvider.java:75)
      2. org.jboss.as.weld.services.ModuleGroupSingletonProvider$TCCLSingleton.get(ModuleGroupSingletonProvider.java:128)
      2 frames
    3. Weld Implementation
      BasicInjectionTarget.inject
      1. org.jboss.weld.Container.instance(Container.java:65)
      2. org.jboss.weld.manager.BeanManagerImpl.getBeans(BeanManagerImpl.java:563)
      3. org.jboss.weld.injection.FieldInjectionPoint.inject(FieldInjectionPoint.java:90)
      4. org.jboss.weld.util.Beans.injectBoundFields(Beans.java:358)
      5. org.jboss.weld.util.Beans.injectFieldsAndInitializers(Beans.java:369)
      6. org.jboss.weld.injection.producer.DefaultInjector.inject(DefaultInjector.java:72)
      7. org.jboss.weld.injection.producer.ResourceInjector.inject(ResourceInjector.java:60)
      8. org.jboss.weld.injection.producer.DefaultInjector$1.proceed(DefaultInjector.java:66)
      9. org.jboss.weld.injection.InjectionContextImpl.run(InjectionContextImpl.java:48)
      10. org.jboss.weld.injection.producer.DefaultInjector.inject(DefaultInjector.java:64)
      11. org.jboss.weld.injection.producer.BasicInjectionTarget.inject(BasicInjectionTarget.java:90)
      11 frames
    4. org.hibernate.jpa
      JpaIntegrator.integrate
      1. org.hibernate.jpa.event.internal.jpa.BeanManagerListenerFactory$BeanMetaData.<init>(BeanManagerListenerFactory.java:82)
      2. org.hibernate.jpa.event.internal.jpa.BeanManagerListenerFactory$BeanMetaData.<init>(BeanManagerListenerFactory.java:71)
      3. org.hibernate.jpa.event.internal.jpa.BeanManagerListenerFactory.buildListener(BeanManagerListenerFactory.java:57)
      4. org.hibernate.jpa.event.internal.jpa.LegacyCallbackProcessor.resolveCallbacks(LegacyCallbackProcessor.java:168)
      5. org.hibernate.jpa.event.internal.jpa.LegacyCallbackProcessor.processCallbacksForEntity(LegacyCallbackProcessor.java:71)
      6. org.hibernate.jpa.event.spi.JpaIntegrator.integrate(JpaIntegrator.java:150)
      6 frames
    5. Hibernate
      Configuration.buildSessionFactory
      1. org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:310)
      2. org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1837)
      2 frames
    6. org.hibernate.jpa
      EntityManagerFactoryBuilderImpl$4.perform
      1. org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:854)
      2. org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:847)
      2 frames
    7. org.hibernate.boot
      ClassLoaderServiceImpl.withTccl
      1. org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.withTccl(ClassLoaderServiceImpl.java:396)
      1 frame
    8. org.hibernate.jpa
      EntityManagerFactoryBuilderImpl.build
      1. org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:846)
      1 frame
    9. WildFly Hibernate
      TwoPhaseBootstrapImpl.build
      1. org.jboss.as.jpa.hibernate4.TwoPhaseBootstrapImpl.build(TwoPhaseBootstrapImpl.java:44)
      1 frame
    10. JPA
      PersistenceUnitServiceImpl$1$1.run
      1. org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:151)
      2. org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:117)
      2 frames
    11. Java RT
      AccessController.doPrivileged
      1. java.security.AccessController.doPrivileged(Native Method)[rt.jar:1.7.0_25]
      1 frame
    12. WildFly Security Manager
      WildFlySecurityManager.doChecked
      1. org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:463)[wildfly-security-manager-1.0.0.Beta3.jar:1.0.0.Beta3]
      1 frame
    13. JPA
      PersistenceUnitServiceImpl$1.run
      1. org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:178)
      1 frame
    14. Java RT
      Thread.run
      1. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[rt.jar:1.7.0_25]
      2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[rt.jar:1.7.0_25]
      3. java.lang.Thread.run(Thread.java:724)[rt.jar:1.7.0_25]
      3 frames
    15. JBoss Threads
      JBossThread.run
      1. org.jboss.threads.JBossThread.run(JBossThread.java:122)[jboss-threads-2.1.1.Final.jar:2.1.1.Final]
      1 frame