Topics

java.lang.NullPointerException at org.eclipse.persistence.internal.jpa.metamodel.proxy.AttributeProxyImpl.getPersistentAttributeType(AttributeProxyImpl.java:78)


Trond Arild Lode Tobiassen Heidelberg
 

 java.lang.NullPointerException
at org.eclipse.persistence.internal.jpa.metamodel.proxy.AttributeProxyImpl.getPersistentAttributeType(AttributeProxyImpl.java:78)
at org.eclipse.persistence.internal.jpa.querydef.FromImpl.get(FromImpl.java:274)
at no.tobiassenit.sip.registrar.session.ExpiredContactSessionHolder.inactivateExpireds(ExpiredContactSessionHolder.java:27)
at no.tobiassenit.sip.registrar.session.DeregisterBatchBean.myJob(DeregisterBatchBean.java:35)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1081)
at org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1153)
at com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:4820)
at com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:656)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:824)
at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:608)
at org.jboss.weld.module.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:81)
at org.jboss.weld.module.ejb.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:52)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:883)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:823)
at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:608)
at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doCall(SystemInterceptorProxy.java:163)
at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.aroundTimeout(SystemInterceptorProxy.java:145)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:883)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:823)
at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:369)
at com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:4792)
at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:4780)
at com.sun.ejb.containers.BaseContainer.callEJBTimeout(BaseContainer.java:4085)
... 8 more



public class ExpiredContactSessionHolder { public static void inactivateExpireds(EntityManager em) throws SipException{ CriteriaQuery<ContactSession> criteriaQuery = em.getCriteriaBuilder().createQuery(ContactSession.class); Root<ContactSession> contactSessionRoot = criteriaQuery.from(ContactSession.class); Predicate isRegisterExpired =
 
Predicate isRegisterExpired = em.getCriteriaBuilder().lessThan(contactSessionRoot.get(ContactSession_.registerExpire), new Date());  //line 27

This works in 4.1


Trond Arild Lode Tobiassen Heidelberg
 
Edited

Turns out it did not work on 4.1 either. But the error message was a lot more descriptive. I removedan accidental comment of annotations and the metamodel and code matched again. The code now runs under 5.0 as well.

Please make 5.1 as descriptive as 4.1.