The main goal is so that you can use test using Jetty (Maven's jetty:run,
specifically) and package for app servers without having to make any changes
to the code or config. A JPA Persistence Unit is generally considered to be
a container managed resource in a JEE environment, and the spec recommends
that persistence units are bound under java:comp/env/persistence/<unit
name>.

Derek

On Tue, Nov 11, 2008 at 8:01 AM, Alex Boisvert <[EMAIL PROTECTED]> wrote:

> Hi Derek,
>
> I also question why you'd want to have either
> EntityManager/EntityManagerFactory in JNDI.  It seems more flexible and
> portable across appservers to create them directly in your code, or by some
> kind of dependency injection.  Noaways JNDI seems to used mostly for
> appserver-managed resources, like DataSources, JMS Destinations, JCA
> ConnectionFactories, and so on.
>
> Since Jetty isn't providing JPA support, why go out of your way to pretend
> it does?
>
> alex
>
>
>
> On Tue, Nov 11, 2008 at 6:36 AM, Derek Chen-Becker <[EMAIL PROTECTED]>wrote:
>
>> I was wondering if anyone out here has experience setting up JNDI under
>> Jetty. I have just about everything working with Lift, Jetty and JNDI except
>> for one small issue. Jetty doesn't seem to support returning unique
>> instances of an object per lookup, something that's required for the
>> EntityManager lookup for JPA. I've asked several times on the Jetty mailing
>> lists but so far have received no answer at all. I've also searched through
>> the Jetty source to see if there's a way to do it, but I'm not familiar with
>> the code base enough to make sense of it all or even where to look
>> specifically. At the very least I'd like to write an ObjectFactory for the
>> EM lookup, but I've only found one thread in the lists on that topic and it
>> seemed to end with Jan over at mortbay questioning why you would ever need
>> this functionality:
>>
>> http://markmail.org/message/ijfafwn2xvi2ppwa
>>
>> Anyways, if I can't get it working "properly" I may just punt and set it
>> up so that I bind an EntityManagerFactory where the EntityManager would
>> normally be found and then just test in the code when I do a lookup to see
>> what I've gotten back. Any ideas or suggestions would be appreciated!
>>
>> Derek
>>
>>
>>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to