Thank you for the fast reply!

The reason why I put it into ext-webapp was because the persistence  
unit code and the authenticator using it are in the same .jar file.  
When I just put the .jar file in the lib folder for this virtual host  
(I don't want to put it into the main lib or ext folder as it should  
not interact with other hosts) I got a class loader error when it  
tried to access the enhanced classes. It was something about a "live  
instance" etc. Once I moved it to ext-webapps the error went away and  
I could use the persistence unit in servlets on different webapps.

Basically what I try to do is:
I got 2 different .jar files that belong to a user management  
framework. One contains the basic user objects, realms and policies  
and the authenticator. The 2nd one contains not required add on's like  
user profiles etc. Then there are addictional .jars that implement  
forums, blogs etc based on the first 2. All of that uses JPA.

The goal is to have all this units shared amoung multiple web apps  
running inside a virtual host with a single sign on using the  
authenticator in the first .jar file.

One question right now is... Even if the authenticator is not webbeans  
aware, why does a simple lookup over JNDI does not get me the  
PersistenceUnit or PersistenceContext ?

Regards,
Andreas Fischer

On Jan 9, 2008, at 10:53 AM, Scott Ferguson wrote:

>
> On Jan 8, 2008, at 8:26 PM, Andreas Fischer wrote:
>
>> I try to write an Authenticator that uses a persistence unit that
>> stores users identities.
>> The unit is stored in ext-webapps so multiple applications can use  
>> it.
>
> I've just added a bug report for this.  The <authenticator> isn't
> webbeans-aware at the moment.
>
> By the way, the unit could be in resin/lib (or resin/ext), not ext-
> webapps.
>
> The only purpose of ext-webapps is to support those libraries that
> aren't classloader-aware, i.e. that can only work in a single web-app
> at one time.
>
> -- Scott
>
>>
>> If I try to use annotations only null is passed as the persistence
>> manager. If I try to look either the persistence context up in the
>> authenticator over JNDI I get a name not found. Even if I try to  
>> delay
>> the actual lookup until loginImpl is called the Unit / Context can
>> still not be found.
>>
>> Looking up the same context in an example servlet works over
>> annotations.
>>
>> It shouldn't be such an uncommon case for an authenticator to access
>> infomration from a persistence context? I mean it is easy to work
>> arround the problem by using SQL queries but using the persistence
>> unit approach would make things easier.
>>
>>
>> _______________________________________________
>> resin-interest mailing list
>> resin-interest@caucho.com
>> http://maillist.caucho.com/mailman/listinfo/resin-interest
>
>
>
> _______________________________________________
> resin-interest mailing list
> resin-interest@caucho.com
> http://maillist.caucho.com/mailman/listinfo/resin-interest



_______________________________________________
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest

Reply via email to