JPA - Unknown entity bean class

前端 未结 5 1813
不知归路
不知归路 2020-12-19 13:59

Hopefully, I can explain this issue properly. I have 3 classes that deals with my entities.

@MappedSuperclass
public abstract class Swab implements ISwab {
         


        
5条回答
  •  离开以前
    2020-12-19 14:35

    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

提交回复
热议问题