users@glassfish.java.net

Custom realm using entity beans - is it possible?

From: <glassfish_at_javadesktop.org>
Date: Wed, 19 Sep 2007 11:22:51 PDT

I have implemented a custom realm to authenticate users off our surly old legacy database, and created some entity beans to make said database less surly. Unfortunately, I can't seem to communicate with the persistence context. The init function in my realm class does this:

try{
            emf = Persistence.createEntityManagerFactory("ACLEntitiesTestPU");
            em = emf.createEntityManager();
        }catch(Exception e){
            log("Persistence context unavailable");
            throw new BadRealmException("Creation of persistence manager failed");
        }

which always throws the exception.

So my question is, does a realm even have access to the container? If it doesn't, can I define an independent persistence context? Or, do I really need to go back to old school JDBC queries here?

Many thanks for any help.

-
Loren
[Message sent by forum member 'loren_' (loren_)]

http://forums.java.net/jive/thread.jspa?messageID=236066