大量のデータをフェッチするHiberanteネイティブクエリがあります。これまでのところ、問題なく動作していましたが、何らかの理由で特定のデータがある場合は、以下の例外があります。私はどうしてこの理由を見つけようとすべきですか?ネイティブクエリのHibernate例外
マイネイティブクエリの形式のものである:
Query query = entityManager.createNativeQuery(sql);
query.setParameter(1, foo);
List<Object[]> results = query.getResultList();
実際のクエリは、内側の2つは、結合で構成され、複数の左外部結合、ここで3つの列の条件によって及び順序。 SQL関数の呼び出しはありません。大きなクエリなのでインデックスを使用します。この問題は、Hibernate 4 beta 5およびMySQL 5.5を使用する4.1.1で発生しました。
他のクエリもありますが、例外はそのネイティブクエリに対してquery.getResultListが呼び出された瞬間に直接関連しています。それは、Hibernateはまた、その後、他のいくつかのクエリの実行を強制していることだろう(理由は怠惰か何か他の?)
Caused by: java.lang.NullPointerException
at org.hibernate.engine.jdbc.internal.proxy.ResultSetProxyHandler.getJdbcServices(ResultSetProxyHandler.java:57) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]
at org.hibernate.engine.jdbc.internal.proxy.AbstractResultSetProxyHandler.continueInvocation(AbstractResultSetProxyHandler.java:110) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]
at org.hibernate.engine.jdbc.internal.proxy.AbstractProxyHandler.invoke(AbstractProxyHandler.java:80) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]
at $Proxy305.wasNull(Unknown Source) at org.hibernate.type.descriptor.sql.BasicExtractor.extract(BasicExtractor.java:66) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]
at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:269) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]
at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:265) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]
at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:243) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]
at org.hibernate.loader.custom.CustomLoader$ScalarResultColumnProcessor.extract(CustomLoader.java:549) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]
at org.hibernate.loader.custom.CustomLoader$ResultRowProcessor.buildResultRow(CustomLoader.java:499) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]
at org.hibernate.loader.custom.CustomLoader$ResultRowProcessor.buildResultRow(CustomLoader.java:478) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]
at org.hibernate.loader.custom.CustomLoader.getResultColumnOrRow(CustomLoader.java:375) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]
at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:668) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]
at org.hibernate.loader.Loader.doQuery(Loader.java:860) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:289) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]
at org.hibernate.loader.Loader.doList(Loader.java:2449) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]
at org.hibernate.loader.Loader.doList(Loader.java:2435) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2276) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]
at org.hibernate.loader.Loader.list(Loader.java:2271) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]
at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:331) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]
at org.hibernate.internal.SessionImpl.listCustomQuery(SessionImpl.java:1571) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]
at org.hibernate.internal.AbstractSessionImpl.list(AbstractSessionImpl.java:224) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]
at org.hibernate.internal.SQLQueryImpl.list(SQLQueryImpl.java:156) [hibernate-core-4.0.0.Beta5.jar:4.0.0.Beta5]
at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:252) [hibernate-entitymanager-4.0.0.Beta5.jar:4.0.0.Beta5]
at com.foo.bar.getResults(MyResultHandler.java:114) [classes:]
at sun.reflect.GeneratedMethodAccessor16978.invoke(Unknown Source) [:1.7.0]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [:1.7.0]
at java.lang.reflect.Method.invoke(Method.java:601) [:1.7.0]
at org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:51)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:370) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:114) [jboss-as-weld-7.0.1.Final.jar:7.0.1.Final]
at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:122) [jboss-as-weld-7.0.1.Final.jar:7.0.1.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:45) [jboss-as-jpa-7.0.1.Final.jar:7.0.1.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
at org.jboss.as.ejb3.component.stateful.StatefulSessionSynchronizationInterceptor.processInvocation(StatefulSessionSynchronizationInterceptor.java:132)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:44)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
at org.jboss.as.ee.component.ViewDescription$ComponentDispatcherInterceptor.processInvocation(ViewDescription.java:202)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
at org.jboss.as.jpa.interceptor.SFSBInvocationInterceptor.processInvocation(SFSBInvocationInterceptor.java:58) [jboss-as-jpa-7.0.1.Final.jar:7.0.1.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
at org.jboss.as.ejb3.component.stateful.StatefulComponentInstanceInterceptor.processInvocation(StatefulComponentInstanceInterceptor.java:61)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
at org.jboss.as.ejb3.component.session.SessionInvocationContextInterceptor$CustomSessionInvocationContext.proceed(SessionInvocationContextInterceptor.java:126)
at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invokeInCallerTx(CMTTxInterceptor.java:233)
... 93 more
詳細を教えてください。これをさらにどのように調べるべきですか?私はプリミティブをどこで期待しているのか分かりません。 – egaga