英文:
Spring App is getting "Connection has already been closed" getting the length of a Blob
问题
以下是翻译好的内容:
我有一个使用Spring的应用程序,在其中将Weblogic从12.2.1.0.0升级到12.2.1.4.0,升级后在获取Blob长度时开始收到错误消息“Connection has already been closed”。在这个应用程序中,我正在运行Spring 4.2.6和Hibernate 5.0.1,以及Java 1.8。我尝试使用流(Stream),但在尝试更改Blob的getter和setter时遇到Introspection异常。非常感谢任何帮助。
try {
usageList.addAll(dailyUsageUtils.convertEDMSBlobToUsageArray(interval.getUsageBlob(), interval.getIntervalCount(), interval.getSpi().longValue(), intervalStart.getTimeInMillis()));
} catch (SQLException e) {
throw new ProcessException("EDMS Interval data not valid");
}
方法:在blob.length出错的地方
public List<DailyUsgBase> convertEDMSBlobToUsageArray(Blob blob, int totalIntervals, long spi, long start) throws SQLException {
List<DailyUsgBase> usageList = new ArrayList<DailyUsgBase>();
final String timerId = "ConvertBlob";
StopWatch stopWatch = new StopWatch();
stopWatch.start(timerId);
if (null != blob) {
int blobLength = (int) blob.length();
byte[] blobBytes = blob.getBytes(1, blobLength);
blob.free();
for (int x = 0; x < totalIntervals; x++) {
// ...
}
}
// ...
return usageList;
}
在日志中看到的异常消息:
java.sql.SQLException: Connection has already been closed. EDMS Interval data not valid
英文:
I have a Spring app where Weblogic was upgraded from 12.2.1.0.0 to 12.2.1.4.0 and I started receiving the error "Connection has already been closed" on getting the Blob length after the upgrade. I am running Spring 4.2.6 and Hibernate 5.0.1 in this app and Java 1.8. I tried using a Stream but I was getting an Introspection Exception with the getter and setter for the blob when I try to change it. Any help would be greatly appreciated.
try {
usageList.addAll(dailyUsageUtils.convertEDMSBlobToUsageArray(interval
.getUsageBlob(), interval
.getIntervalCount(), interval.getSpi()
.longValue(), intervalStart.getTimeInMillis()));
} catch (SQLException e) {
throw new ProcessException("EDMS Interval data not valid");
}
Method: App is failing on blob.length
public List<DailyUsgBase> convertEDMSBlobToUsageArray(Blob blob, int totalIntervals, long spi, long start)
throws SQLException
{
List<DailyUsgBase> usageList = new ArrayList<DailyUsgBase>();
final String timerId = "ConvertBlob";
StopWatch stopWatch = new StopWatch();
stopWatch.start(timerId);
if (null != blob) {
int blobLength = (int) blob.length();
// double[] reads = new double[totalIntervals];
byte[] blobBytes = blob.getBytes(1, blobLength);
blob.free();
for (int x = 0; x < totalIntervals; x++)
{
10:09:42.516 [[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG org.hibernate.loader.Loader - Result set row: 0
10:09:42.517 [[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG org.hibernate.loader.Loader - Result row: EntityKey[com.dukeenergy.sg.dailyusage.model.EdmsIntervalElectric#AABbRuAAAAAAKFBAAA]
10:09:42.526 [[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG org.hibernate.loader.Loader - Result set row: 1
10:09:42.526 [[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG org.hibernate.loader.Loader - Result row: EntityKey[com.dukeenergy.sg.dailyusage.model.EdmsIntervalElectric#AABbRuAAAAAASPLAAE]
10:09:42.526 [[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG org.hibernate.loader.Loader - Result set row: 2
10:09:42.526 [[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG org.hibernate.loader.Loader - Result row: EntityKey[com.dukeenergy.sg.dailyusage.model.EdmsIntervalElectric#AABbRuAAAAAAkZ7AAB]
10:09:42.526 [[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG org.hibernate.loader.Loader - Result set row: 3
10:09:42.526 [[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG org.hibernate.loader.Loader - Result row: EntityKey[com.dukeenergy.sg.dailyusage.model.EdmsIntervalElectric#AABbRuAAAAAAqXaAAF]
10:09:42.526 [[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG org.hibernate.loader.Loader - Result set row: 4
10:09:42.526 [[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG org.hibernate.loader.Loader - Result row: EntityKey[com.dukeenergy.sg.dailyusage.model.EdmsIntervalElectric#AABbRuAAAAAA418AAJ]
10:09:42.526 [[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG org.hibernate.loader.Loader - Result set row: 5
10:09:42.526 [[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG org.hibernate.loader.Loader - Result row: EntityKey[com.dukeenergy.sg.dailyusage.model.EdmsIntervalElectric#AABbRuAAAAABA2IAAA]
10:09:42.527 [[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG org.hibernate.loader.Loader - Result set row: 6
10:09:42.527 [[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG org.hibernate.loader.Loader - Result row: EntityKey[com.dukeenergy.sg.dailyusage.model.EdmsIntervalElectric#AABbRuAAAAABK/NAAB]
10:09:42.527 [[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG org.hibernate.loader.Loader - Result set row: 7
10:09:42.527 [[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG org.hibernate.loader.Loader - Result row: EntityKey[com.dukeenergy.sg.dailyusage.model.EdmsIntervalElectric#AABbRuAAAAABTLeAAH]
10:09:42.527 [[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG org.hibernate.loader.Loader - Result set row: 8
10:09:42.527 [[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG org.hibernate.loader.Loader - Result row: EntityKey[com.dukeenergy.sg.dailyusage.model.EdmsIntervalElectric#AABbRuAAAAABld7AAH]
10:09:42.527 [[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG org.hibernate.loader.Loader - Result set row: 9
10:09:42.527 [[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG org.hibernate.loader.Loader - Result row: EntityKey[com.dukeenergy.sg.dailyusage.model.EdmsIntervalElectric#AABbRuAAAAABxUPAAC]
10:09:42.528 [[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG org.hibernate.engine.internal.TwoPhaseLoad - Resolving associations for [com.dukeenergy.sg.dailyusage.model.EdmsIntervalElectric#AABbRuAAAAAAKFBAAA]
10:09:42.529 [[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG org.hibernate.engine.internal.TwoPhaseLoad - Done materializing entity [com.dukeenergy.sg.dailyusage.model.EdmsIntervalElectric#AABbRuAAAAAAKFBAAA]
10:09:42.529 [[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG org.hibernate.engine.internal.TwoPhaseLoad - Resolving associations for [com.dukeenergy.sg.dailyusage.model.EdmsIntervalElectric#AABbRuAAAAAASPLAAE]
10:09:42.529 [[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG org.hibernate.engine.internal.TwoPhaseLoad - Done materializing entity [com.dukeenergy.sg.dailyusage.model.EdmsIntervalElectric#AABbRuAAAAAASPLAAE]
10:09:42.529 [[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG org.hibernate.engine.internal.TwoPhaseLoad - Resolving associations for [com.dukeenergy.sg.dailyusage.model.EdmsIntervalElectric#AABbRuAAAAAAkZ7AAB]
10:09:42.529 [[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG org.hibernate.engine.internal.TwoPhaseLoad - Done materializing entity [com.dukeenergy.sg.dailyusage.model.EdmsIntervalElectric#AABbRuAAAAAAkZ7AAB]
10:09:42.529 [[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG org.hibernate.engine.internal.TwoPhaseLoad - Resolving associations for [com.dukeenergy.sg.dailyusage.model.EdmsIntervalElectric#AABbRuAAAAAAqXaAAF]
10:09:42.529 [[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG org.hibernate.engine.internal.TwoPhaseLoad - Done materializing entity [com.dukeenergy.sg.dailyusage.model.EdmsIntervalElectric#AABbRuAAAAAAqXaAAF]
10:09:42.529 [[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG org.hibernate.engine.internal.TwoPhaseLoad - Resolving associations for [com.dukeenergy.sg.dailyusage.model.EdmsIntervalElectric#AABbRuAAAAAA418AAJ]
10:09:42.529 [[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG org.hibernate.engine.internal.TwoPhaseLoad - Done materializing entity [com.dukeenergy.sg.dailyusage.model.EdmsIntervalElectric#AABbRuAAAAAA418AAJ]
10:09:42.529 [[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG org.hibernate.engine.internal.TwoPhaseLoad - Resolving associations for [com.dukeenergy.sg.dailyusage.model.EdmsIntervalElectric#AABbRuAAAAABA2IAAA]
10:09:42.529 [[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG org.hibernate.engine.internal.TwoPhaseLoad - Done materializing entity [com.dukeenergy.sg.dailyusage.model.EdmsIntervalElectric#AABbRuAAAAABA2IAAA]
10:09:42.529 [[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG org.hibernate.engine.internal.TwoPhaseLoad - Resolving associations for [com.dukeenergy.sg.dailyusage.model.EdmsIntervalElectric#AABbRuAAAAABK/NAAB]
10:09:42.529 [[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG org.hibernate.engine.internal.TwoPhaseLoad - Done materializing entity [com.dukeenergy.sg.dailyusage.model.EdmsIntervalElectric#AABbRuAAAAABK/NAAB]
10:09:42.529 [[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG org.hibernate.engine.internal.TwoPhaseLoad - Resolving associations for [com.dukeenergy.sg.dailyusage.model.EdmsIntervalElectric#AABbRuAAAAABTLeAAH]
10:09:42.529 [[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG org.hibernate.engine.internal.TwoPhaseLoad - Done materializing entity [com.dukeenergy.sg.dailyusage.model.EdmsIntervalElectric#AABbRuAAAAABTLeAAH]
10:09:42.529 [[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG org.hibernate.engine.internal.TwoPhaseLoad - Resolving associations for [com.dukeenergy.sg.dailyusage.model.EdmsIntervalElectric#AABbRuAAAAABld7AAH]
10:09:42.529 [[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG org.hibernate.engine.internal.TwoPhaseLoad - Done materializing entity [com.dukeenergy.sg.dailyusage.model.EdmsIntervalElectric#AABbRuAAAAABld7AAH]
10:09:42.529 [[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG org.hibernate.engine.internal.TwoPhaseLoad - Resolving associations for [com.dukeenergy.sg.dailyusage.model.EdmsIntervalElectric#AABbRuAAAAABxUPAAC]
10:09:42.529 [[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG org.hibernate.engine.internal.TwoPhaseLoad - Done materializing entity [com.dukeenergy.sg.dailyusage.model.EdmsIntervalElectric#AABbRuAAAAABxUPAAC]
10:09:42.532 [[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl - Initiating JDBC connection release from afterTransaction
10:09:42.532 [[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG com.dukeenergy.itoa.common.dao.GenericDaoImpl - Cannot write hibernate statistics because statistics are not enabled.
Please 'set hibernate.generate_statistics=true' and
optionally set 'hibernate.cache.use_structured_entries=true'
10:09:42.532 [[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'] INFO com.dukeenergy.sg.dailyusage.service.impl.EdmsIntervalElectricServiceImpl - StopWatch: Edms Interval Retrieval : Edms Interval Retrieval : milliseconds to execute : 00:00:00.427
10:09:42.532 [[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG org.hibernate.internal.SessionImpl - Disconnecting session
10:09:42.532 [[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG org.springframework.jdbc.datasource.DataSourceTransactionManager - Initiating transaction commit
10:09:42.532 [[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG org.springframework.jdbc.datasource.DataSourceTransactionManager - Committing JDBC transaction on Connection [weblogic.jdbc.wrapper.PoolConnection_oracle_jdbc_driver_T4CConnection@e4]
10:09:42.533 [[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG org.springframework.jdbc.datasource.DataSourceUtils - Resetting read-only flag of JDBC Connection [weblogic.jdbc.wrapper.PoolConnection_oracle_jdbc_driver_T4CConnection@e4]
10:09:42.533 [[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG org.springframework.jdbc.datasource.DataSourceTransactionManager - Releasing JDBC Connection [weblogic.jdbc.wrapper.PoolConnection_oracle_jdbc_driver_T4CConnection@e4] after transaction
10:09:42.533 [[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG org.springframework.jdbc.datasource.DataSourceUtils - Returning JDBC Connection to DataSource
10:09:42.534 [[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG com.dukeenergy.sg.dailyusage.service.impl.DailyUsageServiceImpl - Start java.util.GregorianCalendar[time=1577854800000,areFieldsSet=true,areAllFieldsSet=true,lenient=true,zone=sun.util.calendar.ZoneInfo[id="America/New_York",offset=-18000000,dstSavings=3600000,useDaylight=true,transitions=235,lastRule=java.util.SimpleTimeZone[id=America/New_York,offset=-18000000,dstSavings=3600000,useDaylight=true,startYear=0,startMode=3,startMonth=2,startDay=8,startDayOfWeek=1,startTime=7200000,startTimeMode=0,endMode=3,endMonth=10,endDay=1,endDayOfWeek=1,endTime=7200000,endTimeMode=0]],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=2020,MONTH=0,WEEK_OF_YEAR=1,WEEK_OF_MONTH=1,DAY_OF_MONTH=1,DAY_OF_YEAR=1,DAY_OF_WEEK=4,DAY_OF_WEEK_IN_MONTH=1,AM_PM=0,HOUR=0,HOUR_OF_DAY=0,MINUTE=0,SECOND=0,MILLISECOND=0,ZONE_OFFSET=-18000000,DST_OFFSET=0]
10:09:42.534 [[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG com.dukeenergy.sg.dailyusage.util.impl.DailyUsageUtilsImpl - Inside convertEDMSBlobToUsageArray Method
Oct 06, 2020 10:09:42 AM com.sun.xml.ws.server.sei.TieHandler createResponse
SEVERE: java.sql.SQLException: Connection has already been closed. EDMS Interval data not valid
com.dukeenergy.itoa.common.exceptions.ProcessException: java.sql.SQLException: Connection has already been closed. EDMS Interval data not valid
at com.dukeenergy.sg.dailyusage.service.impl.DailyUsageServiceImpl.getEdmsElectricUsage(DailyUsageServiceImpl.java:361)
at com.dukeenergy.sg.dailyusage.service.impl.DailyUsageServiceImpl.getUsage(DailyUsageServiceImpl.java:168)
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.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:69)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)
at com.sun.proxy.$Proxy379.getUsage(Unknown Source)
at com.dukeenergy.sg.dailyusage.endpoint.DailyUsageServiceEndpoint.getUsage(DailyUsageServiceEndpoint.java:26)
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 weblogic.wsee.jaxws.WLSInstanceResolver$WLSInvoker.invoke(WLSInstanceResolver.java:120)
at weblogic.wsee.jaxws.WLSInstanceResolver$WLSInvoker.invoke(WLSInstanceResolver.java:93)
at com.sun.xml.ws.server.InvokerTube$2.invoke(InvokerTube.java:149)
at com.sun.xml.ws.server.sei.SEIInvokerTube.processRequest(SEIInvokerTube.java:88)
at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:1136)
at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:1050)
at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:1019)
at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:877)
at com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:419)
at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:868)
at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:422)
at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:169)
at weblogic.wsee.jaxws.WLSServletAdapter.handle(WLSServletAdapter.java:246)
at weblogic.wsee.jaxws.HttpServletAdapter$AuthorizedInvoke.run(HttpServletAdapter.java:667)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:386)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:163)
at weblogic.wsee.util.ServerSecurityHelper.authenticatedInvoke(ServerSecurityHelper.java:108)
at weblogic.wsee.jaxws.HttpServletAdapter$3.run(HttpServletAdapter.java:286)
at weblogic.wsee.jaxws.HttpServletAdapter.post(HttpServletAdapter.java:295)
at weblogic.wsee.jaxws.JAXWSServlet.doRequest(JAXWSServlet.java:128)
at weblogic.servlet.http.AbstractAsyncServlet.service(AbstractAsyncServlet.java:103)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:295)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:260)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:137)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:353)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:250)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3793)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3763)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:344)
at weblogic.security.service.SecurityManager.runAsForUserCode(SecurityManager.java:197)
at weblogic.servlet.provider.WlsSecurityProvider.runAsForUserCode(WlsSecurityProvider.java:203)
at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:71)
at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2451)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2299)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2277)
at weblogic.servlet.internal.ServletRequestImpl.runInternal(ServletRequestImpl.java:1720)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1680)
at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:272)
at weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:352)
at weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:337)
at weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:57)
at weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41)
at weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:655)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:420)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:360)
<Oct 6, 2020 10:09:42,534 AM EDT> <Error> <com.sun.xml.ws.server.sei.TieHandler> <BEA-000000> <java.sql.SQLException: Connection has already been closed. EDMS Interval data not valid
com.dukeenergy.itoa.common.exceptions.ProcessException: java.sql.SQLException: Connection has already been closed. EDMS Interval data not valid
at com.dukeenergy.sg.dailyusage.service.impl.DailyUsageServiceImpl.getEdmsElectricUsage(DailyUsageServiceImpl.java:361)
at com.dukeenergy.sg.dailyusage.service.impl.DailyUsageServiceImpl.getUsage(DailyUsageServiceImpl.java:168)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
Truncated. see log file for complete stacktrace
答案1
得分: 1
禁用Weblogic服务器配置中数据源的“Wrap Data Types”选项可以解决这个错误。
来自Oracle的说明:
禁用数据类型对象的封装
默认情况下,针对Array、Blob、Clob、NClob、Ref、SQLXML和Struct,以及ParameterMetaData和ResultSetMetaData对象的数据类型对象会被WebLogic封装。您可以禁用封装,这可以提高性能并允许应用程序直接使用本机驱动程序对象。请参阅使用未封装的数据类型对象。
要禁用对JDBC数据类型对象的封装:
如果尚未执行,请在管理控制台的更改中心中单击“锁定并编辑”(请参阅使用更改中心)。
在域结构树中,展开“Services”,然后选择“Data Sources”。
在“数据源摘要”页面上,单击数据源名称。
选择“配置:连接池”选项卡。
向下滚动并单击“高级”以显示高级连接池选项。
在“Wrap Data Types”中,取消选中复选框以禁用封装。
单击“保存”。
要激活这些更改,请在管理控制台的更改中心中单击“激活更改”。
并非所有更改会立即生效—一些更改需要重新启动(请参阅使用更改中心)。
英文:
Disabling "Wrap Data Types" for the datasource in the Weblogic server configuration fixed the error.
From Oracle:
Disable wrapping of data type objects
By default, data type objects for Array, Blob, Clob, NClob, Ref, SQLXML, and Struct, plus ParameterMetaData and ResultSetMetaData objects are wrapped with a WebLogic wrapper. You can disable wrapping which can improve performance and allow applications to use native driver objects directly. See Using Unwrapped Data Type Objects.
To disable wrapping of JDBC data type objects:
If you have not already done so, in the Change Center of the Administration Console, click Lock & Edit (see Use the Change Center).
In the Domain Structure tree, expand Services, then select Data Sources.
On the Summary of Data Sources page, click the data source name.
Select the Configuration: Connection Pool tab.
Scroll down and click Advanced to show the advanced connection pool options.
In Wrap Data Types, deselect the checkbox to disable wrapping.
Click Save.
To activate these changes, in the Change Center of the Administration Console, click Activate Changes.
Not all changes take effect immediately—some require a restart (see Use the Change Center).
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论