title: org.apache.jasper.JasperException: java.lang.IllegalArgumentException: Object: emp.Customer[ id=100 ] is not a known entity type
body: <p>Error is coming like whwne project is start
  "org.apache.jasper.JasperException: java.lang.IllegalArgumentException: Object: emp.Customer[ id=100 ] is not a known entity type."
  How to solve this error plz tell me</p>
  
  <p>1)newjsp.jsp</p>
  
  <pre><code>&lt;%-- 
      Document   : newjsp
      Created on : Oct 10, 2015, 1:10:21 PM
      Author     : Niral
  --%&gt;`enter code here`
  
  &lt;%@page import="emp.*"%&gt;
  &lt;%@page import="javax.persistence.Persistence"%&gt;
  &lt;%@page import="javax.persistence.EntityManager"%&gt;
  &lt;%@page import="javax.persistence.EntityManagerFactory"%&gt;
  &lt;%@page contentType="text/html" pageEncoding="UTF-8"%&gt;
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
          &lt;title&gt;JSP Page&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;%
               EntityManagerFactory emf = Persistence.createEntityManagerFactory("WebApplicationJPAPU");
                  EntityManager em = emf.createEntityManager();
                  //javax.transaction.UserTransaction utx;
  
                  Customer c1 = new Customer();
                  em.getTransaction().begin();
                  c1.setId(100l);
                  c1.setBalance(10000);
  
                  em.persist(c1);
                  em.getTransaction().commit();
          %&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  
  2)
  
  /*
   * To change this license header, choose License Headers in Project Properties.
   * To change this template file, choose Tools | Templates
   * and open the template in the editor.
   */
  
  package emp;
  
  import java.io.Serializable;
  import javax.persistence.Entity;
  import javax.persistence.GeneratedValue;
  import javax.persistence.GenerationType;
  import javax.persistence.*;
  import javax.persistence.Id;
  
  /**
   *
   * @author Niral
   */
  @Entity
  @Table(name = "CustMaster")
  public class Customer implements Serializable {
      private static final long serialVersionUID = 1L;
      @Id
      @GeneratedValue(strategy = GenerationType.AUTO)
      @Column(name = "CustId")
      private Long id;
      @Column(name = "CustBalance")
      private double Balance;
  
      public double getBalance() {
          return Balance;
      }
  
      public void setBalance(double Balance) {
          this.Balance = Balance;
      }
  
      public Long getId() {
          return id;
      }
  
      public void setId(Long id) {
          this.id = id;
      }
  
      @Override
      public int hashCode() {
          int hash = 0;
          hash += (id != null ? id.hashCode() : 0);
          return hash;
      }
  
  
  
      @Override
      public String toString() {
           return "emp.Customer[ id=" + id + " ]";
      }
  
  
  }
  
  3)persistence.xml
  
  
  &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;provider&gt;org.eclipse.persistence.jpa.PersistenceProvider&lt;/provider&gt;   
      &lt;persistence-unit name="WebApplicationJPAPU" transaction-type="JTA"&gt;
      &lt;jta-data-source&gt;jdbc/e4&lt;/jta-data-source&gt;
      &lt;exclude-unlisted-classes&gt;false&lt;/exclude-unlisted-classes&gt;
      &lt;properties&gt;
        &lt;property name="javax.persistence.schema-generation.database.action" value="drop-and-create"/&gt;
      &lt;/properties&gt;`enter code here`
    &lt;/persistence-unit&gt;
  &lt;/persistence&gt;
  </code></pre>