Thanks for the answers Pete!

There is still one open question left if you could be so kind:

>From the link Nicklas posted (RI Appendix A.1.3. JNDI)
> public interface NamingContext
> for example in an environment where JNDI isn't available

and from the spec:
> Alternatively, the application may obtain the Manager object from
> JNDI. The container must register an instance of
> Manager with name java:app/Manager in JNDI at deployment time.

But any JNDI lookup will fail if we run in a non-JNDI setup as mentioned in the 
SPI docu (like e.g. a standalone swing client).

So is kind of a standalone JDK scenario in the official scope or only setups 
where JNDI is available?
And for the ServletEngine scenario like tomcat, resin and jetty, can we simply 
skip binding the Manager to JNDI if we are running in SE (context is readonly)? 

txs in advance,
strub


--- Pete Muir <[email protected]> schrieb am Do, 5.2.2009:
> Von: Pete Muir <[email protected]>
> Betreff: Re: JNDI usage question
> An: "Mark Struberg" <[email protected]>
> CC: [email protected]
> Datum: Donnerstag, 5. Februar 2009, 15:39
> On 5 Feb 2009, at 14:27, Mark Struberg wrote:
> 
> > Hi and thanks!
> >
> > My basic understanding so far (Pete, Nicklas, please
> correct me if  
> > I'm wrong):
> >
> > 1.) WebBeans will be part of the EE6 spec (along OSGi,
> JSF-2.0,  
> > JPA-2.0, ...) is this still correct?
> 
> Still an open question - the review is currently under way.
> 
> >
> >
> > 2.) If I build a webapp using WebBeans, I simply have
> to add a META- 
> > INF/web-beans.xml (now beans.xml but I'm seriously
> unhappy with this  
> > renaming, since this name conflicts with the spring
> beans.xml!).  
> > This will activate the WebBeans scanner for this
> webapp.
> 
> Yes.
> 
> >
> >
> > 3.) Before reading your SPI docs, I always thought the
> standard for  
> > an EE webapp build should be to NOT include any
> webbeans  
> > implementation in any JAR or WAR.
> 
> It doesn't, the library resides in the AS, which
> adjusts the classpath  
> of the deployed application inside a deployer.
> 
> >
> >> you must insert the webbeans-ri.jar into the
> applications
> >> isolated classloader.
> > Is this a preliminary restriction which will be
> removed if RI is  
> > final? Our (or at least my) goal is to have a webapp
> which can  
> > simply be deployed in Geronimo + OWB, and may be moved
> over to JBoss  
> > + RI without the need of repackaging.
> 
> Assuming Geronimo includes OWB, and you aren't putting
> owb.jar inside  
> the EAR this would work.
> 
> >
> >
> > txs,
> > strub
> >
> > PS: I'm not sure how to handle crossposts to the
> webbeans-...@jboss  
> > list, so Pete feel free to fwd it if it's ok.
> >
> >
> > --- Nicklas Karlsson <[email protected]>
> schrieb am Do, 5.2.2009:
> >
> >> Von: Nicklas Karlsson <[email protected]>
> >> Betreff: Re: JNDI usage question
> >> An: [email protected],
> "Pete Muir" <[email protected] 
> >> >
> >> Datum: Donnerstag, 5. Februar 2009, 7:38
> >> Instead of causing more confusion by guessing, I
> cc:ed Pete
> >> Muir who
> >> is the RI project manager, perhaps he can shed
> some light
> >> on the
> >> issue.
> >>
> >> On Thu, Feb 5, 2009 at 1:48 AM, Mark Struberg
> >> <[email protected]> wrote:
> >>> Thanks for your comment Nicklas!
> >>>
> >>> I didn't look at the RI implementation
> side that
> >> closely, because this shouldn't become a copy
> & past
> >> lesson ;)
> >>>
> >>> What I've learned from the link you've
> posted:
> >>> .) it seems we are not that far off the track,
> since
> >> the RI also has a SPI for JNDI and resource lookup
> (~ our
> >> singleton finder)
> >>>
> >>> .) the RI also aims at non EE environments,
> and not
> >> even EJB lite containers but also even more
> lightweight
> >> (which is not mentioned in the spec btw,
> isn't?)
> >>>
> >>> .) there seems to be a gap between the RI and
> the spec
> >> (or I did miss the point)
> >>>
> >>> From the link you've posted
> >>>> public interface NamingContext
> >>>> for example in an environment where JNDI
> isn't
> >> available
> >>>
> >>> and from the spec:
> >>>> Alternatively, the application may obtain
> the
> >> Manager object from
> >>>> JNDI. The container must register an
> instance of
> >>>> Manager with name java:app/Manager in JNDI
> at
> >> deployment time.
> >>>
> >>> But any JNDI lookup will fail if we run in a
> non-JNDI
> >> setup as mentioned in the SPI docu (like e.g. a
> standalone
> >> swing client).
> >>>
> >>> What really confuses my now is the last
> sentence in
> >> the linked page:
> >>>> If you are integrating the Web Beans into
> an
> >> environment that
> >>>> supports deployment of applications, you
> must
> >> insert the
> >>>> webbeans-ri.jar into the applications
> isolated
> >> classloader. It
> >>>> cannot be loaded from a shared
> classloader.
> >>> I always thought that WebBeans would be an
> integral
> >> part of the EE6 spec and therefore be a provided
> base
> >> functionality of any EE6 certified appsrv? So I
> did expect
> >> that the RI will handle application isolation
> itself, or did
> >> I misinterpret something?
> >>>
> >>> It's really late now, I hope I wasn't
> too
> >> confused already to form clear thoughts and write
> them down
> >> ;)
> >>>
> >>> txs and LieGrue,
> >>> strub
> >>>
> >>>
> >>> --- Nicklas Karlsson
> <[email protected]>
> >> schrieb am Mi, 4.2.2009:
> >>>
> >>>> Von: Nicklas Karlsson
> <[email protected]>
> >>>> Betreff: Re: JNDI usage question
> >>>> An: [email protected]
> >>>> Datum: Mittwoch, 4. Februar 2009, 23:49
> >>>> _They_ are watching and don't think
> so:
> >>>>
> >>
> http://docs.jboss.org/webbeans/reference/1.0.0.ALPHA2/en-US/html/ri-spi.html#d0e3649
> >>>> ;-)
> >>>>
> >>>> On Thu, Feb 5, 2009 at 12:12 AM, Mark
> Struberg
> >>>> <[email protected]> wrote:
> >>>>> So, after a few hous of not thinking
> about
> >> this
> >>>> problem, here is the (possible) answer:
> >>>>>
> >>>>> The Spec only mentions the JNDI
> because
> >> _they_ need it
> >>>> in _their_ scenario!
> >>>>> And what is their scenario?
> >>>>> The WebBeans RI is designed to be an
> integral
> >> part of
> >>>> the JBoss J2EE Server, so the
> webbeans-ri.jar will
> >> reside in
> >>>> the app servers jar classpath and NOT be
> packaged
> >> in any EAR
> >>>> or WAR file.
> >>>>> So the webbeans-ri classes will be
> loaded
> >> through the
> >>>> app-servers parent classloader, which is
> the same
> >> for _all_
> >>>> webapps running in this server. In this
> scenario
> >> one has to
> >>>> make sure that each webapp gets its own
> >> javax.inject.Manager
> >>>> singleton, and the easiest way is to use a
> JNDI
> >>>> java:comp/env environment (because a
> singleton
> >> using static
> >>>> would simply not work)!
> >>>>>
> >>>>> But all this magic is completely
> futile if
> >> our
> >>>> openwebbeans-impl.jar is packaged inside
> the EAR
> >> or WAR,
> >>>> because in this case we are already in the
> correct
> >>>> per-webapp-classloader.
> >>>>>
> >>>>> So we either always lookup the Manager
> from
> >>>> java:comp/env/Manager or our
> ManagerObjectFactory
> >> or even
> >>>> the WebBeansFinder has to be a SPI with a
> JNDI
> >>>> implementation for running on a server
> level and
> >> an
> >>>> implementation using statics if being
> packaged
> >> with the app.
> >>>>>
> >>>>> I can imagine that that there is
> standard
> >> answer to
> >>>> our problem, because using JNDI for each
> and every
> >> Manager
> >>>> access is not the fastest solution. So
> come on EE
> >> guys,
> >>>> enlighten us :)
> >>>>>
> >>>>> Any thoughts on this?
> >>>>>
> >>>>> LieGrü,
> >>>>> strub
> >>>>>
> >>>>> --- Mark Struberg
> <[email protected]>
> >> schrieb am
> >>>> Mi, 4.2.2009:
> >>>>>
> >>>>>> Von: Mark Struberg
> >> <[email protected]>
> >>>>>> Betreff: JNDI usage question
> >>>>>> An:
> [email protected]
> >>>>>> Datum: Mittwoch, 4. Februar 2009,
> 14:53
> >>>>>> Hi!
> >>>>>>
> >>>>>>
> >>>>>> The JNDI context set by
> OpenWebBean is
> >>>>>>
> >>>>>>
> >> WebBeansConstants.WEB_BEANS_MANAGER_JNDI_NAME
> >>>>>>
> >>>>>> But although I see where is gets
> bound
> >> and und
> >>>> bound, I
> >>>>>> cannot see where it is actually
> being
> >> used?
> >>>>>>
> >>>>>> So maybe I'm blind, but what
> for do
> >> we
> >>>> currently use
> >>>>>> the JNDI context? Is this work in
> >> progress, or did
> >>>> I miss
> >>>>>> something?
> >>>>>>
> >>>>>> Just to make sure we have the same
> >> undersanding:
> >>>> how should
> >>>>>> @ApplicationScoped work in
> >>>>>> a) a WAR in a ServletEngine like
> tomcat
> >>>>>> b) a EAR in a J2EE Server like
> Geronimo
> >>>>>> c) a WAR (solo, without EAR) in a
> J2EE
> >> Server like
> >>>> Geronimo
> >>>>>>
> >>>>>> LieGrue,
> >>>>>> strub
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>
> >>>>
> >>>>
> >>>> --
> >>>> ---
> >>>> Nik
> >>>
> >>>
> >>>
> >>>
> >>
> >>
> >>
> >> -- 
> >> ---
> >> Nik
> >
> >
> >



Reply via email to