The full stack trace exception that I get is this:
org.zkoss.xel.XelException: Cannot locate the BeanManager for JavaEE 6. sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) java.lang.reflect.Constructor.newInstance(Constructor.java:513) org.zkoss.lang.Classes.newInstance(Classes.java:73) org.zkoss.lang.Exceptions.wrap(Exceptions.java:203) org.zkoss.xel.XelException$Aide.wrap(XelException.java:47) org.zkoss.zkplus.cdi.CDIUtil.getBeanManager(CDIUtil.java:56) org.zkoss.zkplus.cdi.DelegatingVariableResolver.<init>(DelegatingVariableResolver.java:42) sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) java.lang.reflect.Constructor.newInstance(Constructor.java:513) org.zkoss.zk.ui.select.Selectors.newVariableResolvers(Selectors.java:269) org.zkoss.bind.BindComposer.doBeforeComposeChildren(BindComposer.java:146) org.zkoss.zk.ui.impl.UiEngineImpl.doBeforeComposeChildren(UiEngineImpl.java:874) org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild0(UiEngineImpl.java:813) org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:770) org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:679) org.zkoss.zk.ui.impl.UiEngineImpl.execCreate(UiEngineImpl.java:643) org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild0(UiEngineImpl.java:816) org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:770) org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:679) org.zkoss.zk.ui.impl.UiEngineImpl.execCreate(UiEngineImpl.java:643) org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild0(UiEngineImpl.java:816) org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:770) org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:679) org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:741) org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:701) org.zkoss.zk.ui.impl.UiEngineImpl.execCreate(UiEngineImpl.java:643) org.zkoss.zk.ui.impl.UiEngineImpl.execNewPage0(UiEngineImpl.java:394) org.zkoss.zk.ui.impl.UiEngineImpl.execNewPage(UiEngineImpl.java:316) org.zkoss.zk.ui.http.DHtmlLayoutServlet.process(DHtmlLayoutServlet.java:215) org.zkoss.zk.ui.http.DHtmlLayoutServlet.doGet(DHtmlLayoutServlet.java:135) javax.servlet.http.HttpServlet.service(HttpServlet.java:621) javax.servlet.http.HttpServlet.service(HttpServlet.java:722) javax.naming.NameNotFoundException: Name [BeanManager] is not bound in this Context. Unable to find [BeanManager]. org.apache.naming.NamingContext.lookup(NamingContext.java:820) org.apache.naming.NamingContext.lookup(NamingContext.java:154) org.apache.naming.NamingContext.lookup(NamingContext.java:831) org.apache.naming.NamingContext.lookup(NamingContext.java:168) org.apache.naming.SelectorContext.lookup(SelectorContext.java:158) javax.naming.InitialContext.lookup(InitialContext.java:392) org.zkoss.zkplus.cdi.CDIUtil.getBeanManager(CDIUtil.java:52) org.zkoss.zkplus.cdi.DelegatingVariableResolver.<init>(DelegatingVariableResolver.java:42) sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) java.lang.reflect.Constructor.newInstance(Constructor.java:513) org.zkoss.zk.ui.select.Selectors.newVariableResolvers(Selectors.java:269) org.zkoss.bind.BindComposer.doBeforeComposeChildren(BindComposer.java:146) org.zkoss.zk.ui.impl.UiEngineImpl.doBeforeComposeChildren(UiEngineImpl.java:874) org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild0(UiEngineImpl.java:813) org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:770) org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:679) org.zkoss.zk.ui.impl.UiEngineImpl.execCreate(UiEngineImpl.java:643) org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild0(UiEngineImpl.java:816) org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:770) org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:679) org.zkoss.zk.ui.impl.UiEngineImpl.execCreate(UiEngineImpl.java:643) org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild0(UiEngineImpl.java:816) org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:770) org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:679) org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:741) org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:701) org.zkoss.zk.ui.impl.UiEngineImpl.execCreate(UiEngineImpl.java:643) org.zkoss.zk.ui.impl.UiEngineImpl.execNewPage0(UiEngineImpl.java:394) org.zkoss.zk.ui.impl.UiEngineImpl.execNewPage(UiEngineImpl.java:316) org.zkoss.zk.ui.http.DHtmlLayoutServlet.process(DHtmlLayoutServlet.java:215) org.zkoss.zk.ui.http.DHtmlLayoutServlet.doGet(DHtmlLayoutServlet.java:135) javax.servlet.http.HttpServlet.service(HttpServlet.java:621) javax.servlet.http.HttpServlet.service(HttpServlet.java:722) On Sun, Sep 2, 2012 at 4:51 PM, Luca Merolla <[email protected]> wrote: > Isn't the lookup here? > > http://fossies.org/dox/zk-src-6.0.2/CDIUtil_8java_source.html > > I thought about a custom variable resolver as well, but then I saw this > issue and I thought it might work in my case > http://tracker.zkoss.org/browse/ZK-763?page=com.atlassian.jira.plugin.system.issuetabpanels%3Aall-tabpanel > > On Sun, Sep 2, 2012 at 4:44 PM, Romain Manni-Bucau > <[email protected]>wrote: > >> the point is the beanmanager is available in java:*comp*/*BeanManager* >> only >> for jee components (not sure where the lookup is done from zk). Something >> very close to CDIUtil but portable is done in deltaspike (see >> BeanManagerProvider) >> >> this said writing a custom variable resolver should be pretty quick >> >> *Romain Manni-Bucau* >> *Twitter: @rmannibucau* >> *Blog: http://rmannibucau.wordpress.com* >> >> >> >> >> 2012/9/2 Luca Merolla <[email protected]> >> >> > Probably it's possbile to change the lookup with this feature >> > >> > >> > >> http://fossies.org/dox/zk-src-6.0.2/classorg_1_1zkoss_1_1zkplus_1_1cdi_1_1CDIUtil.html >> > >> > what is the address of the BeanManager for Web Beans? >> > >> > On Sun, Sep 2, 2012 at 12:08 PM, Romain Manni-Bucau >> > <[email protected]>wrote: >> > >> > > Yeah zk uses a lookup which is not standard to get the beanmanager :( >> > > Le 2 sept. 2012 11:37, "Luca Merolla" <[email protected]> a >> écrit : >> > > >> > > > I have tried the CDI Variable Resolver but I get >> > > > >> > > > javax.naming.NameNotFoundException: Name [BeanManager] is not bound >> in >> > > this >> > > > Context. Unable to find [BeanManager]. >> > > > org.apache.naming.NamingContext.lookup(NamingContext.java:820) >> > > > org.apache.naming.NamingContext.lookup(NamingContext.java:154) >> > > > org.apache.naming.NamingContext.lookup(NamingContext.java:831) >> > > > org.apache.naming.NamingContext.lookup(NamingContext.java:154) >> > > > org.apache.naming.NamingContext.lookup(NamingContext.java:831) >> > > > org.apache.naming.NamingContext.lookup(NamingContext.java:168) >> > > > org.apache.naming.SelectorContext.lookup(SelectorContext.java:158) >> > > > javax.naming.InitialContext.lookup(InitialContext.java:392) >> > > > org.zkoss.zkplus.cdi.CDIUtil.getBeanManager(CDIUtil.java:52) >> > > > ... >> > > > >> > > > in Tomcat6 + Weld there are some steps to configure >> > > > >> > > > >> > >> http://blog.zkoss.org/index.php/2010/01/07/integrate-zk-and-jsr-299weld/ >> > > > >> > > > I guess there is an eqiuvalent for OpenWebBeans for that >> > > > >> > > > <Resource name="BeanManager" auth="Container" >> > > > type="javax.enterprise.inject.spi.BeanManager" >> > > > factory="org.jboss.weld.resources.ManagerObjectFactory"/> >> > > > >> > > > >> > > > >> > > > On Sun, Sep 2, 2012 at 9:26 AM, Romain Manni-Bucau < >> > > [email protected] >> > > > >wrote: >> > > > >> > > > > >> > > > > >> > > > >> > > >> > >> http://grepcode.com/file_/repo1.maven.org/maven2/org.zkoss.zk/zkplus/5.0.9/org/zkoss/zkplus/jndi/JndiVariableResolver.java/?v=source >> > > > > >> > > > > Seems the web.xml is not important and that the convention is not >> the >> > > > > standard or tomee one. >> > > > > >> > > > > The cdiutil class doesn't use the standard too. >> > > > > >> > > > > IMO the faster will be to write a custom resolver. >> > > > > >> > > > > Wdyt? >> > > > > Le 2 sept. 2012 09:19, "Romain Manni-Bucau" < >> [email protected]> >> > a >> > > > > écrit : >> > > > > >> > > > > > Hmm should work (maybe the bound name is >> > comp/env/accountbeanlocal). >> > > > > > >> > > > > > But why dont you use the cdi variable resolver? >> > > > > > >> > > > > > This way no need of any config in web.xml >> > > > > > >> > > > > > - Romain >> > > > > > Le 2 sept. 2012 01:24, "Luca Merolla" <[email protected]> >> a >> > > > écrit : >> > > > > > >> > > > > >> Hi, >> > > > > >> >> > > > > >> I have a web application that is using Zkoss framework and the >> > MVVM >> > > > > >> pattern. >> > > > > >> Basically the ViewModel classes (which are pojos) needs to >> call >> > > some >> > > > > EJBs >> > > > > >> which are inside the same EAR folder. >> > > > > >> In JBoss 7.1 I have configured the application in this way and >> > it's >> > > > > >> working >> > > > > >> >> > > > > >> In web.xml I have all the ejbs declared in this way: >> > > > > >> <ejb-local-ref> >> > > > > >> <ejb-ref-name>accountBean</ejb-ref-name> >> > > > > >> <ejb-ref-type>Session</ejb-ref-type> >> > > > > >> >> > > > <local-home>org.test.common.bean.local.AccountBeanLocal</local-home> >> > > > > >> <local>org.test.common.bean.local.AccountBeanLocal</local> >> > > > > >> </ejb-local-ref> >> > > > > >> >> > > > > >> And in the ViewModel classes I use the @WireVariable annotation >> > > (from >> > > > ZK >> > > > > >> framework) by simply matching the name and the EJB is bounded >> > > > > >> >> > > > > >> @WireVariable private AccountBeanLocal accountBean; >> > > > > >> >> > > > > >> With the latest TomEE snapshot the EJB is not bounded. I >> believe >> > > > > >> ejb-local-ref are ignored or simply it does not work in the >> same >> > way >> > > > as >> > > > > >> JBoss. >> > > > > >> Do you have any advice or alternative solution to this problem? >> > > > > >> >> > > > > >> Thanks in advance, >> > > > > >> Luca >> > > > > >> >> > > > > > >> > > > > >> > > > >> > > > >> > > > >> > > > -- >> > > > *Luca Merolla* >> > > > Management, Business & Technology Consultant >> > > > >> > > > >> > > > <http://maps.google.com/maps?q=&hl=en> *Mobile:* +393774569974 >> > > > *Email:* [email protected] >> > > > *http://nl.linkedin.com/in/lucamerolla* >> > > > *Blog <http://lucamerolla.wordpress.com>* >> > > > >> > > > >> > > > Merolla Consulting Limited >> > > > >> > > >> > >> > >> > >> > -- >> > *Luca Merolla* >> > Management, Business & Technology Consultant >> > >> > >> > <http://maps.google.com/maps?q=&hl=en> *Mobile:* +393774569974 >> > *Email:* [email protected] >> > *http://nl.linkedin.com/in/lucamerolla* >> > *Blog <http://lucamerolla.wordpress.com>* >> > >> > >> > Merolla Consulting Limited >> > >> > > >
