9 Replies Latest reply on Apr 16, 2018 5:06 AM by Wolfgang Mayer

    Can't find persistence unit named in deployment

    Sana Korejo Newbie

      Hi all,


      I am getting this error while starting Wildfly server (version 12).  I do have a persistence.xml with persistence unit. What am i doing wrong in the below code? It was working fine with Glassfish.




      Component class my.package.services.ClassAFacade for component ClassAFacade has errors:

      WFLYJPA0033: Can't find a persistence unit named war_PU in deployment "\my.war\"




      @PersistenceContext(unitName = "war_PU" )

      private EntityManager em;




      <xml version="1.0" encoding="UTF-8"?>

      <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://java.sun.com/xml/ns/persistence  http://java.sun.com/xml/ns/persistence/persistence_2.0.xsd">

      <persistence-unit name="war_PU" transaction-type="JTA"></provider>





      <property name="eclipselink.logging.level" value="INFO"/>





      Kind Regards,