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

17 comments:

  1. Hello. I have the problem posted here, tried the solution that you write, but it do not function in my project. Sorry i haven't a good english... thank you

    ReplyDelete
  2. hi thanks for posting commments can u post your Webserver log file some where and give me the link

    ReplyDelete
  3. Hi, i have the same problem:

    I have a simple adf bc application i deployed to weblogic server standalone and when i put
    the url on browser i get the error ORA-01882, the log files of the server shows this:

    [2010-03-09T13:23:45.887-03:00] [AdminServer] [WARNING] [] [oracle.adf.controller.faces.lifecycle.Utils] [tid: [ACTIVE].ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: ] [ecid: 0000IT3jGJTFw00Lvyt1iX1B_alw000009,0] [APP: FirstAppEar] ADF: Adding the following JSF error message: ORA-01882: timezone region not found[[
    java.sql.SQLDataException: ORA-01882: timezone region not found
    at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:79)
    at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)
    .......

    I have jdev 11g and WLS 10.3 on my pc with XP windows.

    In jdev i create a database connection called HR that connecto to an oracle 9.2.0 database

    The connection type of my app module is JDBC Datasource called java:comp/env/jdbc/HRDS

    On all my projects (model and viewcontroller i add on run/debug/profile virtual machine client and java options: -Duser.timezone=-03:00)

    In WLS i create a datasource called HRDS the jndi: jdbc/HRDS and the oracle driver
    is oracle thin (not XA)

    On my pc my timezone is GMT-03:00
    On the oracle database the timezone is -03:00

    i am very lost, i don't what to do.....

    if you can help me.... thank you

    ReplyDelete
  4. Try couple of things

    1) As shown in the example set the timezone in double quotes like -Duser.timezone="-03:00"

    2) I recently posted creating a simple ADF form this might help u as well
    http://baigsorcl.blogspot.com/2010/03/moving-to-jdeveloper11g-your-first-adf.html

    3) Double click application Module Configuration section and make sure the default configuration is selected as LOCAL and connection type as JDBC URL

    4) You can feel free to join OTN Forums for ADF http://forums.oracle.com/forums/forum.jspa?forumID=83

    ReplyDelete
  5. Hi Baig, i changed to -Duser.timezone="-03:00", be sure that application configuration is LOCAL and tried with JDBC URL and the same error ORA-01882, and if i changed JDBC URL for JDBC Datasource the error is:
    oracle.jbo.DMLException: JBO-26061: Error al abrir la conexión JDBC.
    ...
    Caused by: java.sql.SQLException: ORA-01005: null password given; logon denied

    When i deployed the application i always see that warning on weblogic 10.3:

    [2010-03-05T15:57:42.342-03:00] [AdminServer] [WARNING] [] [oracle.adf.share.jndi.ReferenceStoreHelper] [tid: [ACTIVE].ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: weblogic] [ecid: 0000ISjgATVFw00Lvyt1iX1B^KaU00001C,0] [APP: FirstAppEar] Incomplete connection reference object for connection:HR

    thanks a lot.

    ReplyDelete
  6. I have never experienced this kind of problem.

    Its hard to guess.

    I guess you are missing Save or Deploy Password Check box in the connection. Make sure it is checked.

    If possible send me your application to my email (link in my blogger profile) i will see what i can do with it.
    or Join OTN Forums there thousands of people can help u immediately.

    Thanks for commenting.

    ReplyDelete
  7. I faced similar problem which is on a adf based tool, and i could fix the issue by setting the below
    bin>java -Duser.timezone="Asia/Calcutta"

    Thank you!!
    Mayilvahanan .V

    ReplyDelete
  8. Hi,
    I faced the similar issue when i use a tool which is adf based. I could able to fix the issue as below
    bin>java -Duser.timezone="Asia/Calcutta"

    Thank you!!

    ReplyDelete
  9. Hi Zeeshan,

    Thanks for your post.This helped a lot.

    ReplyDelete
  10. Thanks a lot for this blog it helped me alot

    ReplyDelete
  11. Thanks, worked like charm :)

    ReplyDelete
  12. Thanks a lot Baig

    1) As shown in the example set the timezone in double quotes like

    -Duser.timezone="-03:00"

    works like a charm.

    ReplyDelete
  13. Yes Sachin you can enter any timezone using that method.

    ZB

    ReplyDelete
  14. Many thanks Baig... well explained... it worked

    ReplyDelete
  15. Thank You Baig
    Your topic is very useful to me

    ReplyDelete