aspose file tools*
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
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: This mapped class does not contain in any persistent unit