Issue Type: Bug Bug
Affects Versions: 1.1.13.Final
Assignee: Jozef Hartinger
Created: 12/Jun/13 3:38 AM

Weld observes AfterBeanDiscovery events with @Default qualifier. However, if another CDI container is present, e.g. if another module is using OpenWebBeans to manage CDI solely for this component, then Weld will receive this event and throw an IllegalStateException:

Exception in thread "main" java.lang.IllegalStateException: Singleton is not set
	at org.jboss.weld.bootstrap.api.helpers.IsolatedStaticSingletonProvider$IsolatedStaticSingleton.get(
	at org.jboss.weld.Container.instance(
	at org.jboss.weld.context.AbstractContext.<init>(
	at org.jboss.weld.context.AbstractManagedContext.<init>(
	at org.jboss.weld.context.AbstractUnboundContext.<init>(
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(
	at java.lang.reflect.Method.invoke(
	at org.apache.webbeans.event.ObserverMethodImpl.notify(
	at org.apache.webbeans.event.NotificationManager.fireEvent(
	at org.apache.webbeans.container.BeanManagerImpl.fireEvent(
	at org.apache.webbeans.container.BeanManagerImpl.fireEvent(
	at org.apache.webbeans.config.BeansDeployer.fireAfterBeanDiscoveryEvent(
	at org.apache.webbeans.config.BeansDeployer.deploy(
	at org.apache.webbeans.lifecycle.AbstractLifeCycle.startApplication(

I consider this being a major issue because it implies that it's impossible to develop components / modules / bean archives (whatever you call it) which use a private CDI container. As soon as Weld is present on the class path, e.g. to manage CDI for the client application, you will get this IllegalStateException.

Project: Weld
Priority: Major Major
Reporter: Christian Schlichtherle
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: