Saturday, November 28, 2009

How to set JDeveloper Timezone / ORA-01882: timezone region not found error

Problem:
If you in Run Oracle ADF Fusion application based on ADFBC in countries other than USA you might face this problem. While running Application Module or JSF page with different regional settings in control panel e.g (Russian or Kazakh settings).

 I got the same issue when I started ADF and yesterday I was in ADF seminar the instructor got the same problem as well. I experienced the error in 2 different cases.

If you run right click and Choose Run on your Application Module error appears similar to this

oracle.jbo.JboException: JBO-29000: Unexpected exception caught: java.sql.SQLDataException, 
msg=ORA-01882: timezone region  not found

While running JSF page in the browser only Loading.. logo appears rest is blank the log file which would contains lines similar to this

oracle.jbo.JboException: JBO-29000: Unexpected exception caught: java.sql.SQLDataException, 
msg=ORA-01882: timezone region  not found
Seems like common problem if you are on different Time zone other than America.

Solution:
1. In the Project properties of (Model and ViewController) go by double clicking on them.
2.Go to Run/Debug/Profile on the Left Pane.
3.If you are using Project Settings Click on Edit by selecting your Profile most of the cases it is Default.
4.Select Launch Settings on the left pane and in Java option enter this value Note: you can change according to your Timezone.
-Duser.timezone="+06:00" 
5.Click OK and OK again Save your project exit JDeveloper and open again.
6. Run your application again.

You can avoid this by setting Time zone in java options in the default Project properties of Jdeveloper so any new project you add it will automatically contain the Time zone settings.

Hope it helps,
Baig