This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes This mapped class does not contain in any persistent unit Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "This mapped class does not contain in any persistent unit" Watch "This mapped class does not contain in any persistent unit" New topic
Author

This mapped class does not contain in any persistent unit

Abhijith Prabhakar
Ranch Hand

Joined: Dec 29, 2006
Posts: 56
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

Joined: Oct 17, 2001
Posts: 153
Hello Abhijith,

How are you deploying this application? Where is the persistence.xml located in the archive?


Shailesh Kini.
 
wood burning stoves
 
subject: This mapped class does not contain in any persistent unit
 
Similar Threads
org. postgresql. util. PSQLException: ERROR: relation does not exist
Problem javax.persistence.NoResultException: No entity found for query
EJB3 persistence unit setup in JBoss
JPA using Hibernate - Entity Manager doubts
How to use JTA with JPA