In my case the database was Oracle XE. So mine is a bit different case but may be helpful to someone.
The best way to find the problem with this is to check the logs of workspace present at $workspace_location/.metadata/.log file. In my case I found that there were 3 problems:
1) Caused by: java.io.FileNotFoundException: $MiddlewarePath\oracle_common\modules\oracle.adf.share_11.1.1\adfsharembean.jar (Access is denied)
2) Caused by: java.io.FileNotFoundException: $MiddlewarePath\oracle_common\modules\oracle.ldap_11.1.1\jremtool.jar (Access is denied)
3) !MESSAGE Unable to find JPA entities generation templates in pluginorg.eclipse.jpt.jpa.gen !STACK 1 Java Model Exception: Core Exception [code 275] A resource exists with a different case: '/TestJPAProjectFacetsEJB/src/main/java/com/domainname/ejb/TestJPAProjectFacets'.
Hence I did the following:
1) Provided access permission for the jar files 2) While I was generating entities I was giving the package name as com/domainname/ejb/testjpaprojectfacets/model. But I was already having a package com/domainname/ejb/TestJPAProjectFacets hence the error. I then renamed my existing package to all lowercase (com/domainname/ejb/testjpaprojectfacets) and it worked.
Thanks, Sanjay