The easiest way to do this is to delegate your JpaRealm into @Stateless EJB,
which can @Inject EntityManager.
You can lookup EntityManager from JNDI as well, but it gets complicated with
resource management there.
Here's some code (untested):
MyBeanLocal beanRef = (MyBeanLocal)new
InitialContext().lookup("java:global/MyBean!com.xxx.beans.MyBeanLocal")
User user = beanRef.getUser("user1")
and the MyBean will take care of all the JPA stuff, which it can do since
its managed by the container.
--
View this message in context:
http://shiro-user.582556.n2.nabble.com/Shiro-in-CDI-JPA2-JSF2-project-tp7577437p7577439.html
Sent from the Shiro User mailing list archive at Nabble.com.