title: JPA exception: Object: is not a known entity type
body: <p>I'm new to JPA and I'm having problems. I read that the problem maybe with the persistence.xml .</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"&gt;
  &lt;persistence-unit name="GreekTravelPU" transaction-type="RESOURCE_LOCAL"&gt;
  &lt;provider&gt;org.eclipse.persistence.jpa.PersistenceProvider&lt;/provider&gt;
  &lt;class&gt;entities.Room&lt;/class&gt;
  &lt;class&gt;entities.Country&lt;/class&gt;
  &lt;class&gt;entities.User&lt;/class&gt;
  &lt;class&gt;entities.RoomType&lt;/class&gt;
  &lt;class&gt;entities.Role&lt;/class&gt;
  &lt;class&gt;entities.Photo&lt;/class&gt;
  &lt;class&gt;entities.Availability&lt;/class&gt;
  &lt;class&gt;entities.Message&lt;/class&gt;
  &lt;class&gt;entities.Location&lt;/class&gt;
  &lt;class&gt;entities.Booking&lt;/class&gt;
  &lt;exclude-unlisted-classes&gt;false&lt;/exclude-unlisted-classes&gt;
  &lt;properties&gt;
    &lt;property name="javax.persistence.jdbc.url"     value="jdbc:mysql://localhost:3306/greektraveldb?zeroDateTimeBehavior=convertToNull"/&gt;
    &lt;property name="javax.persistence.jdbc.user" value="psilos"/&gt;
    &lt;property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver"/&gt;
    &lt;property name="javax.persistence.jdbc.password" value="psilos"/&gt;
    &lt;property name="javax.persistence.schema-generation.database.action" value="create"/&gt;
  &lt;/properties&gt;
  &lt;/persistence-unit&gt;
  &lt;/persistence&gt;
  </code></pre>
  
  <p>My Exeption:</p>
  
  <pre><code>java.lang.IllegalArgumentException: Object: org.eclipse.persistence.internal.jpa.EntityManagerImpl@665ba601 is not a known entity type.
  at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.mergeCloneWithReferences(UnitOfWorkImpl.java:3510)
  at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.mergeCloneWithReferences(RepeatableWriteUnitOfWork.java:384)
  at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.mergeCloneWithReferences(UnitOfWorkImpl.java:3481)
  at org.eclipse.persistence.internal.jpa.EntityManagerImpl.mergeInternal(EntityManagerImpl.java:542)
  at org.eclipse.persistence.internal.jpa.EntityManagerImpl.merge(EntityManagerImpl.java:519)
  </code></pre>
  
  <p>The actual code is</p>
  
  <pre><code>@Override public void update(User user) { 
      EntityManager em = EntityManagerHelper.getEntityManager(); 
      try { 
          EntityTransaction entityTrasacrion = em.getTransaction(); 
          entityTrasacrion.begin(); 
          em.merge(em); 
          entityTrasacrion.commit(); 
      } catch (RuntimeException e) { 
          throw e; 
      } finally { 
          EntityManagerHelper.closeEntityManager(); 
      } 
  }
  </code></pre>