mitreid-connect / OpenID-Connect-Java-Spring-Server

An OpenID Connect reference implementation in Java on the Spring platform.
Other
1.47k stars 767 forks source link

NPE from eclipselink #1477

Open rrsln opened 5 years ago

rrsln commented 5 years ago

I have noticed NPE below in our logs:

2019-02-14 12:23:55.864 ERROR 1 --- [nio-8080-exec-4] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is Exception [EclipseLink-6168] (Eclipse Persistence Services - 2.5.1.v20130918-f2b9fc5): org.eclipse.persistence.exceptions.QueryException
Exception Description: Query failed to prepare, unexpected error occurred: [java.lang.NullPointerException].
Internal Exception: java.lang.NullPointerException
 Query: ReadAllQuery(name="BlacklistedSite.getAll" referenceClass=BlacklistedSite sql="SELECT id, uri FROM blacklisted_site")] with root cause 
 java.lang.NullPointerException: null
    at org.eclipse.persistence.queries.ReadAllQuery.checkForCustomQuery(ReadAllQuery.java:216) ~[org.eclipse.persistence.core-2.5.1.jar!/:na]
    at org.eclipse.persistence.queries.DatabaseQuery.checkPrepare(DatabaseQuery.java:636) ~[org.eclipse.persistence.core-2.5.1.jar!/:na]
    at org.eclipse.persistence.queries.ObjectLevelReadQuery.checkPrepare(ObjectLevelReadQuery.java:901) ~[org.eclipse.persistence.core-2.5.1.jar!/:na]
    at org.eclipse.persistence.queries.DatabaseQuery.checkPrepare(DatabaseQuery.java:613) ~[org.eclipse.persistence.core-2.5.1.jar!/:na]
    at org.eclipse.persistence.internal.jpa.QueryImpl.getDatabaseQueryInternal(QueryImpl.java:341) ~[org.eclipse.persistence.jpa-2.5.1.jar!/:na]
    at org.eclipse.persistence.internal.jpa.EntityManagerImpl.createNamedQuery(EntityManagerImpl.java:1124) ~[org.eclipse.persistence.jpa-2.5.1.jar!/:na]
    at org.eclipse.persistence.internal.jpa.EntityManagerImpl.createNamedQuery(EntityManagerImpl.java:1144) ~[org.eclipse.persistence.jpa-2.5.1.jar!/:na]
    at sun.reflect.GeneratedMethodAccessor230.invoke(Unknown Source) ~[na:na]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_172]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_172]
    at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:304) ~[spring-orm-5.0.6.RELEASE.jar!/:5.0.6.RELEASE]
    at com.sun.proxy.$Proxy90.createNamedQuery(Unknown Source) ~[na:na]
    at org.mitre.openid.connect.repository.impl.JpaBlacklistedSiteRepository.getAll(JpaBlacklistedSiteRepository.java:52) ~[openid-connect-server-1.3.2.jar!/:na]
    at org.mitre.openid.connect.repository.impl.JpaBlacklistedSiteRepository$$FastClassBySpringCGLIB$$20ea65fc.invoke(<generated>) ~[openid-connect-server-1.3.2.jar!/:na]
    at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) ~[spring-core-5.0.6.RELEASE.jar!/:5.0.6.RELEASE]
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:746) ~[spring-aop-5.0.6.RELEASE.jar!/:5.0.6.RELEASE]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.0.6.RELEASE.jar!/:5.0.6.RELEASE]
    at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:139) ~[spring-tx-5.0.6.RELEASE.jar!/:5.0.6.RELEASE]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185) ~[spring-aop-5.0.6.RELEASE.jar!/:5.0.6.RELEASE]
    at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:294) ~[spring-tx-5.0.6.RELEASE.jar!/:5.0.6.RELEASE]
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98) ~[spring-tx-5.0.6.RELEASE.jar!/:5.0.6.RELEASE]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185) ~[spring-aop-5.0.6.RELEASE.jar!/:5.0.6.RELEASE]
    at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688) ~[spring-aop-5.0.6.RELEASE.jar!/:5.0.6.RELEASE]
    at org.mitre.openid.connect.repository.impl.JpaBlacklistedSiteRepository$$EnhancerBySpringCGLIB$$9568f6ab.getAll(<generated>) ~[openid-connect-server-1.3.2.jar!/:na]
    at org.mitre.openid.connect.service.impl.DefaultBlacklistedSiteService.getAll(DefaultBlacklistedSiteService.java:50) ~[openid-connect-server-1.3.2.jar!/:na]

It is caused by issue in eclipselink which was fixed long time ago: https://github.com/eclipse-ee4j/eclipselink/pull/4 . So to fix this issue you need to upgrade eclipselink.