【发布时间】:2017-06-06 16:52:07
【问题描述】:
我的公司有一个 Web 应用程序部署到 Oracle WebLogic 服务器。我们正在努力升级到 WebLogic 12c 并将应用程序从 Java 1.5 升级到 1.7.0_15。
在启动应用服务器时,我们收到以下错误:
<Jun 6, 2017 12:09:31 PM EDT> <Error> <Deployer> <BEA-149205> <Failed to initialize the application "SIMPLeBDataSource" due to error weblogic.application.ModuleException: weblogic.common.ResourceException: weblogic.common.ResourceException: Could not create pool connection for datasource 'SIMPLeBDataSource'. The DBMS driver exception was: ORA-00604: error occurred at recursive SQL level 1
ORA-01882: timezone region not found
weblogic.application.ModuleException: weblogic.common.ResourceException: weblogic.common.ResourceException: Could not create pool connection for datasource 'SIMPLeBDataSource'. The DBMS driver exception was: ORA-00604: error occurred at recursive SQL level 1
ORA-01882: timezone region not found
at weblogic.jdbc.module.JDBCModule.prepare(JDBCModule.java:350)
at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:100)
at weblogic.application.internal.flow.ModuleStateDriver$1.next(ModuleStateDriver.java:175)
at weblogic.application.internal.flow.ModuleStateDriver$1.next(ModuleStateDriver.java:170)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:42)
Truncated. see log file for complete stacktrace
Caused By: weblogic.common.ResourceException: weblogic.common.ResourceException: Could not create pool connection for datasource 'SIMPLeBDataSource'. The DBMS driver exception was: ORA-00604: error occurred at recursive SQL level 1
ORA-01882: timezone region not found
at weblogic.jdbc.common.internal.ConnectionEnvFactory.createResource(ConnectionEnvFactory.java:360)
at weblogic.common.resourcepool.ResourcePoolImpl.makeResources(ResourcePoolImpl.java:1320)
at weblogic.common.resourcepool.ResourcePoolImpl.makeResources(ResourcePoolImpl.java:1237)
at weblogic.common.resourcepool.ResourcePoolImpl.start(ResourcePoolImpl.java:240)
at weblogic.jdbc.common.internal.ConnectionPool.doStart(ConnectionPool.java:1624)
Truncated. see log file for complete stacktrace
>
我们发现将-Duser.timezone='Canada/Eastern' 添加到服务器启动参数可以解决问题。但是,服务器日志和 log4j 日志没有记录正确的时间戳;他们落后了一个小时。
我将TimeZone localTimeZone = TimeZone.getDefault(); 添加到代码中并记录localTimeZone.toString() 并得到sun.util.calendar.ZoneInfo[id="GMT-05:00",offset=-18000000,dstSavings=0,useDaylight=false,transitions=0,lastRule=null]。
东部标准时间是 GMT-5,我们目前处于夏令时,这使它成为 GMT-4,所以它似乎使用了指定的 java 启动参数,但没有认识到它应该在 DST 中。有没有办法在启动参数中指定夏令时?
【问题讨论】: