Uploaded image for project: 'PicketLink'
  1. PicketLink
  2. PLINK-443

JPAIdentityStore looks for Id.class instead of Identity.class

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • PLINK_2.6.0.CR3
    • PLINK_2.6.0.CR2
    • None
    • None

      In order to work around PLINK-440, I moved all of the PicketLink IDM JPA annotations to the get/set methods in my entity classes. That caused the below NullPointerException to occur. The reason appears to be that JPAIdentityStore is looking for Id.class (the JPA annotation) instead of Identity.class (the PL annotation). Since the annotation locations are mixed (JPA annotations on fields, PL annotations on methods), the property can't be found.

      One workaround (which I am currently using) is to also put the JPA annotations on fields, but this may be a problem for some people as it changes the JPA AccessType from FIELD to PROPERTY. Also, you cannot mix the locations of JPA annotations in the same class or the same inheritance hierarchy, so a lot of annotations might need to be moved.

      Caused by: org.picketlink.idm.IdentityManagementException: PLIDM000501: Could not query IdentityType using query [org.picketlink.idm.query.internal.DefaultIdentityQuery@68612f6b].
      	at org.picketlink.idm.query.internal.DefaultIdentityQuery.getResultList(DefaultIdentityQuery.java:148)
      	at org.picketlink.idm.internal.ContextualIdentityManager.checkUniqueness(ContextualIdentityManager.java:268)
      	at org.picketlink.idm.internal.ContextualIdentityManager.add(ContextualIdentityManager.java:80)
      	at com.lapis.jsf.framework.testwar.bootstrap.DataCreator.init(DataCreator.java:67)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_45]
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_45]
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_45]
      	at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_45]
      	at org.jboss.as.ee.component.ManagedReferenceLifecycleMethodInterceptor.processInvocation(ManagedReferenceLifecycleMethodInterceptor.java:96) [wildfly-ee-8.0.0.Final.jar:8.0.0.Final]
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) [jboss-invocation-1.2.1.Final.jar:1.2.1.Final]
      	at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) [jboss-invocation-1.2.1.Final.jar:1.2.1.Final]
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) [jboss-invocation-1.2.1.Final.jar:1.2.1.Final]
      	at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doLifecycleInterception(Jsr299BindingsInterceptor.java:114)
      	at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:103)
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) [jboss-invocation-1.2.1.Final.jar:1.2.1.Final]
      	at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:407) [jboss-invocation-1.2.1.Final.jar:1.2.1.Final]
      	at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:55) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]
      	at org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:83)
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) [jboss-invocation-1.2.1.Final.jar:1.2.1.Final]
      	at org.jboss.as.weld.injection.WeldInjectionInterceptor.processInvocation(WeldInjectionInterceptor.java:53)
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) [jboss-invocation-1.2.1.Final.jar:1.2.1.Final]
      	at org.jboss.as.ee.component.ManagedReferenceFieldInjectionInterceptorFactory$ManagedReferenceFieldInjectionInterceptor.processInvocation(ManagedReferenceFieldInjectionInterceptorFactory.java:109) [wildfly-ee-8.0.0.Final.jar:8.0.0.Final]
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) [jboss-invocation-1.2.1.Final.jar:1.2.1.Final]
      	at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) [jboss-invocation-1.2.1.Final.jar:1.2.1.Final]
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) [jboss-invocation-1.2.1.Final.jar:1.2.1.Final]
      	at org.jboss.as.ee.component.AroundConstructInterceptorFactory$1.processInvocation(AroundConstructInterceptorFactory.java:28) [wildfly-ee-8.0.0.Final.jar:8.0.0.Final]
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) [jboss-invocation-1.2.1.Final.jar:1.2.1.Final]
      	at org.jboss.as.weld.injection.WeldInterceptorInjectionInterceptor.processInvocation(WeldInterceptorInjectionInterceptor.java:56)
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) [jboss-invocation-1.2.1.Final.jar:1.2.1.Final]
      	at org.jboss.as.weld.ejb.Jsr299BindingsCreateInterceptor.processInvocation(Jsr299BindingsCreateInterceptor.java:94)
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) [jboss-invocation-1.2.1.Final.jar:1.2.1.Final]
      	at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50) [wildfly-ee-8.0.0.Final.jar:8.0.0.Final]
      	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309) [jboss-invocation-1.2.1.Final.jar:1.2.1.Final]
      	at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:273) [wildfly-ejb3-8.0.0.Final.jar:8.0.0.Final]
      	... 27 more
      Caused by: java.lang.NullPointerException
      	at org.picketlink.idm.jpa.internal.JPAIdentityStore.fetchQueryResults(JPAIdentityStore.java:505)
      	at org.picketlink.idm.query.internal.DefaultIdentityQuery.getResultList(DefaultIdentityQuery.java:137)
      	... 60 more
      

              psilva@redhat.com Pedro Igor Craveiro
              rdicroce Richard DiCroce (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: