Hopefully, I can explain this issue properly. I have 3 classes that deals with my entities.
@MappedSuperclass
public abstract class Swab implements ISwab {
I had the same error and, complementing the information above, my case was a ClassLoader issue. My app has three files. A ejb-module.jar which depends on app-lib.jar (library that contains pojo and database entities) and a web-module.war which depends on app-lib.jar.
In the deployment, the app-lib.jar was loaded twice by the glassfish. Googling, I found out that I should copy the app-lib.jar to a "shared" lib in the glassfish domain. I've copied the postgresql.jar to "domain-dir/lib" and my app-lib.jar to "domain-dir/lib/applibs". Have it done, the app worked like a charm.
The used explanation can be found here: http://docs.oracle.com/cd/E19798-01/821-1752/beade/index.html