• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

This mapped class does not contain in any persistent unit

 
Abhijith Prabhakar
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I am reading Oreilly's EJB 3 book and trying to execute cruise example given in it. I have defined an entity class and a persistence.xml file. But, my entity class is giving complier error stating "This mapped class does not contain in any persistent unit". Entity bean class and persistence.xml code is given below

Cabin.java:

package com.titan.domain;
import javax.persistence.*;



@Entity
@Table(name="CABIN")
public class Cabin implements java.io.Serializable {
//Getters and Setters

}

Persistence.xml:

<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0">
<persistence-unit name="titan">
<jta-data-source>java: /TitanDB</jta-data-source>
<class>com.titan.domain.Cabin</class>
<properties>

</properties>
</persistence-unit>

</persistence>


can anyone please help me out in this?
 
Shailesh Kini
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Abhijith,

How are you deploying this application? Where is the persistence.xml located in the archive?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic