It's not a secret anymore!*
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 Android Security Essentials Live Lessons this week in the Android 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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: This mapped class does not contain in any persistent unit
 
Similar Threads
Problem javax.persistence.NoResultException: No entity found for query
How to use JTA with JPA
org. postgresql. util. PSQLException: ERROR: relation does not exist
EJB3 persistence unit setup in JBoss
JPA using Hibernate - Entity Manager doubts