Skip to content

CDI 1.1 Initialization Problem #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
giovannicandido opened this issue Oct 27, 2013 · 4 comments
Closed

CDI 1.1 Initialization Problem #1

giovannicandido opened this issue Oct 27, 2013 · 4 comments

Comments

@giovannicandido
Copy link

I try to deploy on Jboss Wildfly, that uses CDI 1.1 and de error bellow happen, I find some explanation in the links:

https://issues.jboss.org/browse/WELD-1453
https://issues.jboss.org/browse/SOLDER-339

I need to set org.jboss.weld.nonPortableMode system property to deploy the application. But this need to be fixed as this is not a desired workaround

Caused by: org.jboss.weld.exceptions.DefinitionException: Exception List with 1 exceptions:
Exception 0 :
org.jboss.weld.exceptions.IllegalStateException: WELD-001332: BeanManager method getBeans() is not available during application initialization
at org.jboss.weld.bean.builtin.BeanManagerProxy.checkContainerValidated(BeanManagerProxy.java:159)
at org.jboss.weld.bean.builtin.BeanManagerProxy.getBeans(BeanManagerProxy.java:91)
at org.vaadin.addon.cdimvp.MVPExtension.afterBeanDiscovery(MVPExtension.java:35)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:93)
at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:267)
at org.jboss.weld.event.ExtensionObserverMethodImpl.sendEvent(ExtensionObserverMethodImpl.java:119)
at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:254)
at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:233)
at org.jboss.weld.event.ObserverNotifier.notifyObserver(ObserverNotifier.java:169)
at org.jboss.weld.event.ObserverNotifier.notifyObservers(ObserverNotifier.java:128)
at org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:102)
at org.jboss.weld.bootstrap.events.AbstractContainerEvent.fire(AbstractContainerEvent.java:63)
at org.jboss.weld.bootstrap.events.AbstractDefinitionContainerEvent.fire(AbstractDefinitionContainerEvent.java:35)
at org.jboss.weld.bootstrap.events.AfterBeanDiscoveryImpl.fire(AfterBeanDiscoveryImpl.java:55)
at org.jboss.weld.bootstrap.WeldStartup.deployBeans(WeldStartup.java:402)
at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:76)
at org.jboss.as.weld.WeldStartService.start(WeldStartService.java:64)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1944)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1877)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)

@tomivirkki
Copy link
Owner

This is a tricky issue indeed. AfterBeanDiscovery is likely the only phase when I can add an observer method to a bean programmatically. Not being able to iterate over the beans at that point is a real problem.

@giovannicandido
Copy link
Author

Really tricky.

@viljoenp
Copy link
Contributor

BTW you can address this by accumulating a list of all the Beans you are interested with the ProcessBean event , then during the AfterBeanDiscovery event you simply iterate through the accumulated list.
Also Weld 2.0.2 there is a system property that you can disable the exception.

I tested the modified version with Glassfisf 4.

I can send a Patch if you like.

@tomivirkki
Copy link
Owner

Thanks Petrus, merged your pull request and published version 0.9.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants