我在Java EE中有一個項目。當我從訪問數據庫中的表返回的錯誤,這裏的HQL查詢:java.lang.NullPointerException因爲我沒有訪問表的權限
select b from Blacklist b inner join fetch b.users u where b.type ilike :type order by b.date desc
與此錯誤消息:
18:18:10,694 ERROR [STDERR] java.lang.NullPointerException
18:18:10,694 ERROR [STDERR] at org.hibernate.engine.query.QueryPlanCache$HQLQueryPlanKey.<init>(QueryPlanCache.java:193)
18:18:10,694 ERROR [STDERR] at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:87)
18:18:10,694 ERROR [STDERR] at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:156)
18:18:10,694 ERROR [STDERR] at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:135)
18:18:10,694 ERROR [STDERR] at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1650)
18:18:10,694 ERROR [STDERR] at org.hibernate.ejb.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:93)
18:18:10,694 ERROR [STDERR] at org.jboss.jpa.tx.TransactionScopedEntityManager.createQuery(TransactionScopedEntityManager.java:139)
18:18:10,694 ERROR [STDERR] at doku.edp.trasactions.Eds2UtilityBean.getFieldDataFromBlacklist(Eds2UtilityBean.java:325)
18:18:10,694 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
18:18:10,695 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
18:18:10,695 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
18:18:10,695 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)
18:18:10,695 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeTarget(MethodInvocation.java:122)
18:18:10,695 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111)
18:18:10,695 ERROR [STDERR] at org.jboss.ejb3.EJBContainerInvocationWrapper.invokeNext(EJBContainerInvocationWrapper.java:69)
18:18:10,695 ERROR [STDERR] at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.invoke(InterceptorSequencer.java:73)
18:18:10,695 ERROR [STDERR] at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.aroundInvoke(InterceptorSequencer.java:59)
18:18:10,695 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor522.invoke(Unknown Source)
18:18:10,695 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
18:18:10,695 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)
18:18:10,695 ERROR [STDERR] at org.jboss.aop.advice.PerJoinpointAdvice.invoke(PerJoinpointAdvice.java:174)
18:18:10,695 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
18:18:10,695 ERROR [STDERR] at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.fillMethod(InvocationContextInterceptor.java:72)
18:18:10,695 ERROR [STDERR] at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_fillMethod_405857447.invoke(InvocationContextInterceptor_z_fillMethod_405857447.java)
18:18:10,695 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
18:18:10,695 ERROR [STDERR] at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.setup(InvocationContextInterceptor.java:88)
18:18:10,695 ERROR [STDERR] at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_setup_405857447.invoke(InvocationContextInterceptor_z_setup_405857447.java)
18:18:10,695 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
18:18:10,695 ERROR [STDERR] at org.jboss.ejb3.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:62)
我看到我的Postgres數據庫,當我在做SELECT
查詢該表,然後我得到一個警告:
permision否認關係白名單。
Postgres上的警告是否是此錯誤的原因?
我們可以看到導致錯誤的代碼嗎? – 2012-02-01 11:21:18
你的問題太含糊。請確切地說 - 你正在執行的代碼是什麼,你如何執行它,粘貼你的堆棧跟蹤等。在這一點上,我們甚至不知道你的問題。 – 2012-02-01 11:29:45
即時通訊對不起,傢伙..,這裏的錯誤,我已經編輯問題 – 2012-02-01 11:57:42