title: EclipseLink-93 Exception Description: The table [item] is not present in this descriptor
body: <p>I recently made some changes to a JPA application that has been running fine for a year or so.  I added a couple of new tables and I have run into a few problems.  I can not post a image of my schema as I do not have 10 posts but I have a item table and a product table. Many products can have the same item so the product table has an item_id</p>
  
  <p>The following is my item entity</p>
  
  <pre><code>@Entity
  @Table(name="item")
  public class Item implements Serializable {
  private static final long serialVersionUID = 1L;
  
  @Id
  private Integer _id;
  
  private Double carbonValue;
  
  private String description;
  
  private String name;
  
  private Integer discount;
  
  @OneToMany(mappedBy="item")
  private Collection&lt;Product&gt; products;
  
  // getters and setters etc
  </code></pre>
  
  <p>And here is my product entity</p>
  
  <pre><code>@Entity
  @Table(name="product")
  public class Product implements Serializable {
  private static final long serialVersionUID = 1L;
  
  @Id
  private Integer _id;
  
  private Integer deleted;
  
  @ManyToOne(fetch = FetchType.LAZY)
  @JoinColumn(name="ITEM_ID", referencedColumnName="_ID")
  private Item item;
  
  @ManyToOne(fetch = FetchType.LAZY)  
  @JoinColumn(name="SUPPLIER_ID", referencedColumnName="_ID")
  private Supplier supplier;
  
  @OneToMany(mappedBy = "product")
  private Collection&lt;Consumption&gt; consumptions;
  </code></pre>
  
  <p>I am using eclipselink 2.2</p>
  
  <p>when I run a query on the item table as follows:</p>
  
  <pre><code>public final static String SELECT_ALL_ENTITIES_SQL = "SELECT o FROM Item AS o";
  
  public List&lt;Item&gt; getAllEntities() {
          final EntityManager entityManager = DaoUtils.getEntityManagerFactory().createEntityManager();
          final List&lt;Item&gt; items;
          try {
              items = (List&lt;Item&gt;) entityManager.createQuery(SELECT_ALL_ENTITIES_SQL).getResultList();
          } finally {
              entityManager.close();
          }
  
          return items;
      }
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code> [EL Info]: 2012-10-24 14:16:23.798--ServerSession(1351669994)--EclipseLink, version: Eclipse Persistence Services - 2.2.0.v20110202-r8913
  [EL Severe]: 2012-10-24 14:16:24.16--ServerSession(1351669994)--Local Exception Stack: 
  Exception [EclipseLink-0] (Eclipse Persistence Services - 2.2.0.v20110202-r8913): org.eclipse.persistence.exceptions.IntegrityException
  Descriptor Exceptions: 
  ---------------------------------------------------------
  
  Exception [EclipseLink-93] (Eclipse Persistence Services - 2.2.0.v20110202-r8913): org.eclipse.persistence.exceptions.DescriptorException
  Exception Description: The table [item] is not present in this descriptor.
  Descriptor: RelationalDescriptor(database.entities.Product --&gt; [DatabaseTable(product)])
  
  Exception [EclipseLink-93] (Eclipse Persistence Services - 2.2.0.v20110202-r8913): org.eclipse.persistence.exceptions.DescriptorException
  Exception Description: The table [circle] is not present in this descriptor.
  Descriptor: RelationalDescriptor(database.entities.Refund --&gt; [DatabaseTable(refund)])
  
  Runtime Exceptions: 
  ---------------------------------------------------------
  
  java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
  
  java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
  
      at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.initializeDescriptors(DatabaseSessionImpl.java:476)
      at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.initializeDescriptors(DatabaseSessionImpl.java:407)
      at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.postConnectDatasource(DatabaseSessionImpl.java:680)
      at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:628)
      at org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:233)
      at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:394)
      at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.java:185)
      at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:242)
      at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:230)
      at database.dao.ItemDao.getAllEntities(ItemDao.java:24)
      at database.dao.ItemDao.main(ItemDao.java:19)
  
  Descriptor Exceptions: 
  ---------------------------------------------------------
  
  
  Local Exception Stack: 
  Exception [EclipseLink-93] (Eclipse Persistence Services - 2.2.0.v20110202-r8913): org.eclipse.persistence.exceptions.DescriptorException
  Exception Description: The table [item] is not present in this descriptor.
  Descriptor: RelationalDescriptor(database.entities.Product --&gt; [DatabaseTable(product)])
      at org.eclipse.persistence.exceptions.DescriptorException.tableNotPresent(DescriptorException.java:1628)
      at org.eclipse.persistence.descriptors.ClassDescriptor.getTable(ClassDescriptor.java:2478)
      at org.eclipse.persistence.descriptors.ClassDescriptor.buildField(ClassDescriptor.java:760)
      at org.eclipse.persistence.descriptors.ClassDescriptor.buildField(ClassDescriptor.java:749)
      at org.eclipse.persistence.mappings.OneToManyMapping.initializeTargetForeignKeysToSourceKeys(OneToManyMapping.java:796)
      at org.eclipse.persistence.mappings.OneToManyMapping.initializeReferenceDescriptor(OneToManyMapping.java:726)
      at org.eclipse.persistence.mappings.ForeignReferenceMapping.initialize(ForeignReferenceMapping.java:1160)
      at org.eclipse.persistence.mappings.CollectionMapping.initialize(CollectionMapping.java:1095)
      at org.eclipse.persistence.mappings.OneToManyMapping.initialize(OneToManyMapping.java:466)
      at org.eclipse.persistence.descriptors.ClassDescriptor.initialize(ClassDescriptor.java:2744)
      at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.initializeDescriptors(DatabaseSessionImpl.java:453)
      at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.initializeDescriptors(DatabaseSessionImpl.java:407)
      at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.postConnectDatasource(DatabaseSessionImpl.java:680)
      at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:628)
      at org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:233)
      at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:394)
      at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.java:185)
      at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:242)
      at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:230)
      at database.dao.ItemDao.getAllEntities(ItemDao.java:24)
      at database.dao.ItemDao.main(ItemDao.java:19)
  </code></pre>
  
  <p>What have I done wrong here?</p>
  
  <p>UPDATE: on the database I have removed the relationship between product and item.  In my code I have also deleted any reference between the two entities so now the database tables and the entities have no relationship to each other at all.  And I still get the same error?????</p>
  
  <p>SOLVED: When I was coding my entities in another unrelated entity I accendently mislabed an item a product.  I am banging my head on the table now.  </p>