我的公司已將Web應用程序部署到Oracle WebLogic服務器。我們正在升級到WebLogic 12c並將應用程序從Java 1.5升級到1.7.0_15。Java未使用正確的時區
當啓動應用程序服務器,我們得到以下錯誤:
<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]
。
東部標準時間是格林威治標準時間-5,我們目前在夏令時,這使得GMT-4,所以它似乎使用指定的Java啓動參數,但沒有認識到它應該在DST。有沒有辦法在啓動參數中指定DST?
無法使用時區更新程序工具解決此問題,因爲它需要互聯網連接,並且此框沒有互聯網連接。至於JDK更新,我對我將如何獲取更新141有點困惑,因爲它不公開。 – korshyadoo
我想下載工具,然後複製它將是一個選項,但我從來沒有嘗試過。如果您有權訪問Oracle的支持站點,則可以使用更新版本141。 – bubbly