I just got the solution to above issue and decided to put it here as an answer. maybe it can help someone suffering from the same issue.
In my case, issue is related to JDK compliance level. On development machine, it was configured as 1.6 in eclipse IDE. And OC4J is using 1.5. So I did the following to get it working:
- changed the compiler compliance level of project is 1.5 in eclipse.
- configured the same version of JRE in my IDE which is used in my server machine by OC4J.