Getting ORA-01882: timezone region not found with Oracle UCP, on aws ec2 instance?

Shubham Pandey picture Shubham Pandey · Mar 26, 2018 · Viewed 8.7k times · Source

I am running a springboot application (which is running fine on local machine), and getting ORA-01882: timezone region not found error on ec2 instance. Its looks like a config problem but not sure how to fix it.

Stack trace is below

Caused by: java.sql.SQLException: Unable to start the Universal Connection Pool: oracle.ucp.UniversalConnectionPoolException: Cannot get Connection from Datasource: java.sql.SQLException: ORA-00604: error occurred at recursive SQL level 1

ORA-01882: timezone region not found

I am using ojdbc8 version 12.2.0.1

Answer

Raghava Krishna picture Raghava Krishna · Aug 10, 2018

You can pass command line argument -Duser.timezone=<Database Time Zone> to start the application.

Example:

Maven Command line: mvn springboot:run -Duser.timezone=PST

Java Command line: java -Duser.timezone=PST -jar application.jar

Here are the timezones list.

https://en.wikipedia.org/wiki/List_of_tz_database_time_zones