[ 
https://issues.jboss.org/browse/SEAMSECURITY-137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12653286#comment-12653286
 ] 

John Schneider commented on SEAMSECURITY-137:
---------------------------------------------

Through further debugging, I found that there was no EntityManager managed bean 
found, and that was causing the problem. I think that the 
IdentitySessionProducer.createIdentitySession method should write an error to 
the log. Right now, no error happens until there's an NPE in 
org.jboss.seam.security.management.picketlink.JpaIdentityStore.getRelationshipNames(JpaIdentityStore.java:1264)

To have the entityManager be injectable, I tried putting in the 
EntityManagerProducer class found in the idmconsole example, but that was 
throwing a JNDI lookup exception on trying to find a transaction.  I'm hoping 
that the documentation can be modified to include details on how to get the JPA 
Identity Store configured correctly.

For now, I ended up putting in the following producer class, which solved my 
problem:

@Named
@ApplicationScoped
public class ApplicationInitializer {

        @PersistenceContext
        private EntityManager entityManager;

        @Produces
        public EntityManager getEntityManager() {
                return entityManager;
        }

}
                
> IdentitySessionProducer.createIdentitySession doesn't put anything in 
> sessionOptions for JpaIdentityStoreSession
> ----------------------------------------------------------------------------------------------------------------
>
>                 Key: SEAMSECURITY-137
>                 URL: https://issues.jboss.org/browse/SEAMSECURITY-137
>             Project: Seam Security
>          Issue Type: Bug
>    Affects Versions: 3.1.0.CR1
>         Environment: Glassfish 3.1.1 and built in EclipseLink
>            Reporter: John Schneider
>
> IdentitySessionProducer.createIdentitySession checks 
> entityManagerInstance.isUnsatisfied and entityManagerInstance.isAmbiguous() 
> before putting anything in the sessionOptions map, which is later used in 
> JpaIdentityStore.createIdentityStoreSession.  With Glassfish 3.1.1 using 
> builtin EclipseLink, entityManagerInstance is represented by 
> org.jboss.weld.bean.builtin.InstanceImpl.  Invocation of isUnsatisfied is not 
> working.  When I look at it in a debugger, isUnsatistfied doesn't execute; 
> instead readObject executes and throws 
> InvalidObjectException(PROXY_REQUIRED).  I can't tell whether this is just 
> because I'm in a debugger or if this happens during normal execution and is 
> the cause of the problem.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        
_______________________________________________
seam-issues mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/seam-issues

Reply via email to