you can give it a try ;)

about the lookup, cdiutil is not a jee component so it will fail if the
call of cdiutil is not done in a jee component (etc ;)), that's why i said
i don't know if it is done in a jee component (servlet, listener...). I
know zk uses its own thread and in this case it can fail.

*Romain Manni-Bucau*
*Twitter: @rmannibucau*
*Blog: http://rmannibucau.wordpress.com*




2012/9/2 Luca Merolla <[email protected]>

> 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
> > >
> >
>

Reply via email to