Skip to main content

Error injecting persistence unit into CDI managed bean. Can't find a persistence unit named

I experienced this error while adding an EJB jar to a war. The EJB jar had a bean.xml file. Removing this file or turning the discovery mode to 'none' fix this error.

Some few research showed that there is a bug and it was logged but it was closed without the issue being resolved.

Comments

  1. Sometimes it's also problem with location of persistance.xml file, I had it in wrong location - webapp/META-INF instead of resources/META-INF

    ReplyDelete

Post a Comment