1

我收到以下警告,然后是导致不加载记录的异常。

我不这么认为,这是代码的问题,因为相同的构建在所有环境中都没有问题。它仅在更高的环境中失败。

它与任何 Hibernate 属性或 dbcp2 有关吗?

2803716 [qtp1835244107-215] WARN  org.hibernate.engine.loading.internal.LoadContexts  - HHH000100: Fail-safe cleanup (collections) : org.hibernate.engine.loading.internal.CollectionLoadContext@3405d05b<rs=org.apache.commons.dbcp2.DelegatingResultSet@5da1f5a3>
2803717 [qtp1835244107-215] WARN  org.hibernate.engine.loading.internal.CollectionLoadContext  - HHH000160: On CollectionLoadContext#cleanup, localLoadingCollectionKeys contained [1] entries

这导致错误堆栈跟踪

com.gwtplatform.dispatch.rpc.server.AbstractDispatchServiceImpl execute
WARNING: Service exception while executing abc.xyz.LookOrder: Service exception executing action "LookOrder", org.hibernate.InstantiationException: Cannot instantiate abstract class or interface: abc.xyz.DConfig
com.gwtplatform.dispatch.rpc.shared.ServiceException: Service exception executing action "LookOrder", org.hibernate.InstantiationException: Cannot instantiate abstract class or interface: abc.xyz.DConfig
        at com.gwtplatform.dispatch.rpc.server.AbstractDispatchImpl.doExecute(AbstractDispatchImpl.java:164)
        at com.gwtplatform.dispatch.rpc.server.AbstractDispatchImpl.execute(AbstractDispatchImpl.java:110)
        at com.gwtplatform.dispatch.rpc.server.AbstractDispatchServiceImpl.execute(AbstractDispatchServiceImpl.java:87)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:561)
        at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:265)
        at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:305)
        at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
        at com.gwtplatform.dispatch.rpc.server.spring.DispatchServiceImpl.handleRequest(DispatchServiceImpl.java:63)
        at org.springframework.web.context.support.HttpRequestHandlerServlet.service(HttpRequestHandlerServlet.java:68)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:711)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1644)
        at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1632)
        at org.springframework.web.filter.AbstractRequestLoggingFilter.doFilterInternal(AbstractRequestLoggingFilter.java:213)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1632)
        at com.gwtplatform.dispatch.rpc.server.AbstractHttpSessionSecurityCookieFilter.doFilter(AbstractHttpSessionSecurityCookieFilter.java:67)
        at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343)
        at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1624)
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:550)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:568)
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:221)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1112)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:479)
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:183)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1046)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
        at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:199)
        at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:109)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
        at org.eclipse.jetty.server.Server.handle(Server.java:462)
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:281)
        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:232)
        at org.eclipse.jetty.io.AbstractConnection$1.run(AbstractConnection.java:505)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:607)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:536)
        at java.lang.Thread.run(Thread.java:745)
Caused by: org.hibernate.InstantiationException: Cannot instantiate abstract class or interface: abc.xyz.DConfig
        at org.hibernate.tuple.PojoInstantiator.instantiate(PojoInstantiator.java:114)
        at org.hibernate.tuple.PojoInstantiator.instantiate(PojoInstantiator.java:136)
        at org.hibernate.tuple.entity.AbstractEntityTuplizer.instantiate(AbstractEntityTuplizer.java:730)
        at org.hibernate.persister.entity.AbstractEntityPersister.instantiate(AbstractEntityPersister.java:4565)
        at org.hibernate.internal.SessionImpl.instantiate(SessionImpl.java:1313)
        at org.hibernate.internal.SessionImpl.instantiate(SessionImpl.java:1302)
        at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1618)
        at org.hibernate.loader.Loader.getRow(Loader.java:1509)
        at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:719)
        at org.hibernate.loader.Loader.processResultSet(Loader.java:949)
        at org.hibernate.loader.Loader.doQuery(Loader.java:917)
        at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:348)
        at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:318)
        at org.hibernate.loader.Loader.loadCollection(Loader.java:2262)
        at org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:65)
        at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:674)
        at org.hibernate.event.internal.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:86)
        at org.hibernate.internal.SessionImpl.initializeCollection(SessionImpl.java:1774)
        at org.hibernate.collection.internal.AbstractPersistentCollection.forceInitialization(AbstractPersistentCollection.java:694)
        at org.hibernate.engine.internal.StatefulPersistenceContext.initializeNonLazyCollections(StatefulPersistenceContext.java:1028)
        at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:353)
        at org.hibernate.loader.Loader.doList(Loader.java:2550)
        at org.hibernate.loader.Loader.doList(Loader.java:2536)
        at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2366)
        at org.hibernate.loader.Loader.list(Loader.java:2361)
        at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:495)
        at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:357)
        at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:198)
        at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1194)
        at org.hibernate.internal.QueryImpl.list(QueryImpl.java:101)
        at abc.xyz.dao.impl.OrderDaoImpl.searchOrders(OrderDaoImpl.java:39)
        at abc.xyz,service.impl.OrderServiceImpl.search(OrderServiceImpl.java:28)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
        at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:96)
        at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
        at com.sun.proxy.$Proxy117.search(Unknown Source)
        at abc.xyz.admin.server.handler.OrderLookOrderHandler.doExecute(OrderLookOrderHandler.java:49)
        at abc.xyz.admin.server.handler.OrderLookOrderHandler.doExecute(OrderLookOrderHandler.java:18)
        at abc.xyz.web.server.handler.AbstractActionHandler.execute(AbstractActionHandler.java:83)
        at com.gwtplatform.dispatch.rpc.server.AbstractDispatchImpl.doExecute(AbstractDispatchImpl.java:154)
        ... 44 more

我检查了 Hibernate 属性,发现的唯一区别是 hibernate.hbm2ddl.auto=none。在成功环境中,它被设置为默认值。

4

0 回答 0