Hello,
I have a sample app that I'm having problem with.
Here is the SQL statement that creates the database:
CREATE DATABASE IF NOT EXISTS `wedding`;
CREATE TABLE IF NOT EXISTS `wedding`.`users` (
`Username` VARCHAR(30) NOT NULL DEFAULT '',
`Password` VARCHAR(30) NOT NULL DEFAULT '',
`Email` VARCHAR(60) NOT NULL DEFAULT '',
PRIMARY KEY(`username`)
) ENGINE = InnoDB;
CREATE TABLE IF NOT EXISTS `wedding`.`brides` (
`Id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
`FirstName` VARCHAR(20) NOT NULL DEFAULT '',
`MiddleName` VARCHAR(20) DEFAULT '',
`LastName` VARCHAR(20) NOT NULL DEFAULT '',
`Address` VARCHAR(60) NOT NULL DEFAULT '',
`City` VARCHAR(30) NOT NULL DEFAULT '',
`State` VARCHAR(2) NOT NULL DEFAULT '',
`Postal` VARCHAR(10) NOT NULL DEFAULT '',
`HomePhone` VARCHAR(10) DEFAULT '',
`WorkPhone` VARCHAR(10) DEFAULT '',
`CellPhone` VARCHAR(10) DEFAULT '',
`Email` VARCHAR(60) NOT NULL DEFAULT '',
`Username` VARCHAR(30) NOT NULL DEFAULT '',
PRIMARY KEY(`Id`),
UNIQUE `IDX_NAME`(`FirstName`, `MiddleName`, `LastName`),
INDEX `IDX_POSTAL`(`Postal`),
CONSTRAINT `FK_BRIDES_USERNAME` FOREIGN KEY `FK_BRIDES_USERNAME`
(`Username`)
REFERENCES `users` (`Username`)
ON DELETE CASCADE
ON UPDATE CASCADE
) ENGINE = InnoDB;
CREATE TABLE IF NOT EXISTS `wedding`.`grooms` (
`Id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
`FirstName` VARCHAR(20) NOT NULL DEFAULT '',
`MiddleName` VARCHAR(20) DEFAULT '',
`LastName` VARCHAR(20) NOT NULL DEFAULT '',
`Address` VARCHAR(60) NOT NULL DEFAULT '',
`City` VARCHAR(30) NOT NULL DEFAULT '',
`State` VARCHAR(2) NOT NULL DEFAULT '',
`Postal` VARCHAR(10) NOT NULL DEFAULT '',
`HomePhone` VARCHAR(10) DEFAULT '',
`WorkPhone` VARCHAR(10) DEFAULT '',
`CellPhone` VARCHAR(10) DEFAULT '',
`Email` VARCHAR(60) NOT NULL DEFAULT '',
`Username` VARCHAR(30) NOT NULL DEFAULT '',
PRIMARY KEY(`Id`),
UNIQUE `IDX_NAME`(`FirstName`, `MiddleName`, `LastName`),
INDEX `IDX_POSTAL`(`Postal`),
CONSTRAINT `FK_GROOMS_USERNAME` FOREIGN KEY `FK_GROOMS_USERNAME`
(`Username`)
REFERENCES `users` (`Username`)
ON DELETE CASCADE
ON UPDATE CASCADE
) ENGINE = InnoDB;
Then, I created these entity classes:
@Entity()
@Table(name = "users")
public class User implements Serializable {
@Id()
@Column(name = "Username", nullable = false)
private String username;
@Column(name = "Password", nullable = false)
private String password;
@Column(name = "Email", nullable = false)
private String email;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "username")
private Collection<Bride> brideCollection;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "username")
private Collection<Groom> groomCollection;
//
**********************************************************************
// Constructors
//
**********************************************************************
public User() { }
public User(String username) { ... }
public User(String username, String password, String email) { .... }
//
**********************************************************************
// Getter/Setter methods
//
**********************************************************************
...
//
**********************************************************************
// Entity methods
//
**********************************************************************
public int hashCode() { ... }
public boolean equals(Object object) { ... }
}
@MappedSuperclass()
public class BrideGroom implements Serializable {
@Id()
@Column(name = "Id", nullable = false)
protected Integer id;
@Column(name = "FirstName", nullable = false)
protected String firstName;
@Column(name = "MiddleName")
protected String middleName;
@Column(name = "LastName", nullable = false)
protected String lastName;
@Column(name = "Address", nullable = false)
protected String address;
@Column(name = "City", nullable = false)
protected String city;
@Column(name = "State", nullable = false)
protected String state;
@Column(name = "Postal", nullable = false)
protected String postal;
@Column(name = "HomePhone")
protected String homePhone;
@Column(name = "WorkPhone")
protected String workPhone;
@Column(name = "CellPhone")
protected String cellPhone;
@Column(name = "Email", nullable = false)
protected String email;
@JoinColumn(name = "Username", referencedColumnName = "Username")
@ManyToOne()
protected User username;
//
**********************************************************************
// Getter/Setter methods
//
**********************************************************************
...
}
@Entity()
@Table(name = "brides")
public class Bride extends BrideGroom {
//
**********************************************************************
// Constructors
//
**********************************************************************
public Bride() { }
public Bride(Integer id) { ... }
public Bride(Integer id, String firstName, ...) { ... }
//
**********************************************************************
// Entity methods
//
**********************************************************************
public int hashCode() { ... }
public boolean equals(Object object) { ... }
}
@Entity()
@Table(name = "brides")
public class Bride extends BrideGroom {
//
**********************************************************************
// Constructors
//
**********************************************************************
public Bride() { }
public Bride(Integer id) { ... }
public Bride(Integer id, String firstName, ...) { ... }
//
**********************************************************************
// Entity methods
//
**********************************************************************
public int hashCode() { ... }
public boolean equals(Object object) { ... }
}
I have a persistence.xml file for them:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="
http://java.sun.com/xml/ns/persistence"
xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
<persistence-unit name="wedding-planner-persistence"
transaction-type="RESOURCE_LOCAL">
<provider>
oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider</provider>
<class>com.wp.core.persistence.User</class>
<class>com.wp.core.persistence.Groom</class>
<class>com.wp.core.persistence.Bride</class>
<properties>
<property name="toplink.jdbc.url"
value="jdbc:mysql://arara.isxinc.com:3306/wedding"/>
<property name="toplink.jdbc.user" value="root"/>
<property name="toplink.jdbc.driver" value="
com.mysql.jdbc.Driver"/>
<property name="toplink.jdbc.password" value="..."/>
</properties>
</persistence-unit>
</persistence>
Finally, I have a little test class:
public class Test {
public static void main(String[] args) {
EntityManagerFactory factory =
Persistence.createEntityManagerFactory("wedding-planner-persistence");
EntityManager manager = factory.createEntityManager();
EntityTransaction transaction = manager.getTransaction();
User user = new User("dhcavalcanti","123456","danielhc_at_ufl.edu");
try {
transaction.begin();
manager.persist(user);
transaction.commit();
} catch (Exception ex1) {
try { transaction.rollback(); } catch (Exception ex2) {}
}
manager.close();
}
}
When I run this class, I get the following output showing the error:
[TopLink Info]: 2006.09.12 10:21:48.887--ServerSession(26657200)--TopLink,
version: Oracle TopLink Essentials - 2006.4 (Build 060412)
[TopLink Severe]: 2006.09.12 10:21:49.456--ServerSession(26657200)--Local
Exception Stack:
Exception [TOPLINK-0] (Oracle TopLink Essentials - 2006.4 (Build 060412)):
oracle.toplink.essentials.exceptions.IntegrityException
Descriptor Exceptions:
---------------------------------------------------------
Exception [TOPLINK-73] (Oracle TopLink Essentials - 2006.4 (Build 060412)):
oracle.toplink.essentials.exceptions.DescriptorException
Exception Description: Cannot find descriptor for parent class [
java.lang.Object].
Descriptor: RelationalDescriptor(com.wp.core.persistence.Bride -->
[DatabaseTable(brides)])
Exception [TOPLINK-94] (Oracle TopLink Essentials - 2006.4 (Build 060412)):
oracle.toplink.essentials.exceptions.DescriptorException
Exception Description: Descriptors must have a table name defined.
Descriptor: RelationalDescriptor(com.wp.core.persistence.BrideGroom --> [])
Exception [TOPLINK-74] (Oracle TopLink Essentials - 2006.4 (Build 060412)):
oracle.toplink.essentials.exceptions.DescriptorException
Exception Description: The primary key fields are not set for this
descriptor.
Descriptor: RelationalDescriptor(com.wp.core.persistence.BrideGroom --> [])
Exception [TOPLINK-73] (Oracle TopLink Essentials - 2006.4 (Build 060412)):
oracle.toplink.essentials.exceptions.DescriptorException
Exception in thread "main" javax.persistence.PersistenceException: Exception
[TOPLINK-0] (Oracle TopLink Essentials - 2006.4 (Build 060412)):
oracle.toplink.essentials.exceptions.IntegrityException
Descriptor Exceptions:
---------------------------------------------------------
Exception [TOPLINK-73] (Oracle TopLink Essentials - 2006.4 (Build 060412)):
oracle.toplink.essentials.exceptions.DescriptorException
Exception Description: Cannot find descriptor for parent class [
java.lang.Object].
Descriptor: RelationalDescriptor(com.wp.core.persistence.Bride -->
[DatabaseTable(brides)])
Exception [TOPLINK-94] (Oracle TopLink Essentials - 2006.4 (Build 060412)):
oracle.toplink.essentials.exceptions.DescriptorException
Exception Description: Descriptors must have a table name defined.
Descriptor: RelationalDescriptor(com.wp.core.persistence.BrideGroom --> [])
Exception [TOPLINK-74] (Oracle TopLink Essentials - 2006.4 (Build 060412)):
oracle.toplink.essentials.exceptions.DescriptorException
Exception Description: The primary key fields are not set for this
descriptor.
Descriptor: RelationalDescriptor(com.wp.core.persistence.BrideGroom --> [])
Exception [TOPLINK-73] (Oracle TopLink Essentials - 2006.4 (Build 060412)):
oracle.toplink.essentials.exceptions.DescriptorException
Exception Description: Cannot find descriptor for parent class [
java.lang.Object].
Descriptor: RelationalDescriptor(com.wp.core.persistence.Groom -->
[DatabaseTable(grooms)])
Runtime Exceptions:
---------------------------------------------------------
java.lang.NullPointerException
java.lang.NullPointerException
java.lang.NullPointerException
java.lang.NullPointerException
java.lang.NullPointerException
at
oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.createEntityManagerFactory
(EntityManagerFactoryProvider.java:133)
Exception Description: Cannot find descriptor for parent class [
java.lang.Object].
at javax.persistence.Persistence.createEntityManagerFactory(
Persistence.java:83)
Descriptor: RelationalDescriptor(com.wp.core.persistence.Groom -->
[DatabaseTable(grooms)])
at javax.persistence.Persistence.createEntityManagerFactory(
Persistence.java:60)
at com.wp.core.persistence.Test.main(Test.java:19)
Caused by: Exception [TOPLINK-0] (Oracle TopLink Essentials - 2006.4 (Build
060412)): oracle.toplink.essentials.exceptions.IntegrityException
Descriptor Exceptions:
---------------------------------------------------------
Exception [TOPLINK-73] (Oracle TopLink Essentials - 2006.4 (Build 060412)):
oracle.toplink.essentials.exceptions.DescriptorException
Exception Description: Cannot find descriptor for parent class [
java.lang.Object].
Descriptor: RelationalDescriptor(com.wp.core.persistence.Bride -->
[DatabaseTable(brides)])
Exception [TOPLINK-94] (Oracle TopLink Essentials - 2006.4 (Build 060412)):
oracle.toplink.essentials.exceptions.DescriptorException
Exception Description: Descriptors must have a table name defined.
Descriptor: RelationalDescriptor(com.wp.core.persistence.BrideGroom --> [])
Exception [TOPLINK-74] (Oracle TopLink Essentials - 2006.4 (Build 060412)):
oracle.toplink.essentials.exceptions.DescriptorException
Exception Description: The primary key fields are not set for this
descriptor.
Descriptor: RelationalDescriptor(com.wp.core.persistence.BrideGroom --> [])
Exception [TOPLINK-73] (Oracle TopLink Essentials - 2006.4 (Build 060412)):
oracle.toplink.essentials.exceptions.DescriptorException
Exception Description: Cannot find descriptor for parent class [
java.lang.Object].
Descriptor: RelationalDescriptor(com.wp.core.persistence.Groom -->
[DatabaseTable(grooms)])
Runtime Exceptions:
---------------------------------------------------------
java.lang.NullPointerException
java.lang.NullPointerException
java.lang.NullPointerException
java.lang.NullPointerException
java.lang.NullPointerException
at
oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.initializeDescriptors
(DatabaseSessionImpl.java:428)
at
oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.initializeDescriptors
(DatabaseSessionImpl.java:360)
at
oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.postConnectDatasource
(DatabaseSessionImpl.java:677)
at
oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource
(DatabaseSessionImpl.java:559)
at
oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.login(
EntityManagerFactoryProvider.java:193)
at
oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.createEntityManagerFactory
(EntityManagerFactoryProvider.java:129)
... 3 more
Runtime Exceptions:
---------------------------------------------------------
java.lang.NullPointerException
java.lang.NullPointerException
java.lang.NullPointerException
java.lang.NullPointerException
java.lang.NullPointerException
at
oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.initializeDescriptors
(DatabaseSessionImpl.java:428)
at
oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.initializeDescriptors
(DatabaseSessionImpl.java:360)
at
oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.postConnectDatasource
(DatabaseSessionImpl.java:677)
at
oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource
(DatabaseSessionImpl.java:559)
at
oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.login(
EntityManagerFactoryProvider.java:193)
at
oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.createEntityManagerFactory
(EntityManagerFactoryProvider.java:129)
at javax.persistence.Persistence.createEntityManagerFactory(
Persistence.java:83)
at javax.persistence.Persistence.createEntityManagerFactory(
Persistence.java:60)
at com.wp.core.persistence.Test.main(Test.java:19)
Descriptor Exceptions:
---------------------------------------------------------
Local Exception Stack:
Exception [TOPLINK-73] (Oracle TopLink Essentials - 2006.4 (Build 060412)):
oracle.toplink.essentials.exceptions.DescriptorException
Exception Description: Cannot find descriptor for parent class [
java.lang.Object].
Descriptor: RelationalDescriptor(com.wp.core.persistence.Bride -->
[DatabaseTable(brides)])
at
oracle.toplink.essentials.exceptions.DescriptorException.parentDescriptorNotSpecified
(DescriptorException.java:1263)
at
oracle.toplink.essentials.descriptors.ClassDescriptor.selfValidationBeforeInitialization
(ClassDescriptor.java:2304)
at
oracle.toplink.essentials.descriptors.ClassDescriptor.validateBeforeInitialization
(ClassDescriptor.java:3470)
at
oracle.toplink.essentials.descriptors.ClassDescriptor.preInitialize(
ClassDescriptor.java:2165)
at
oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.initializeDescriptors
(DatabaseSessionImpl.java:380)
at
oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.initializeDescriptors
(DatabaseSessionImpl.java:360)
at
oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.postConnectDatasource
(DatabaseSessionImpl.java:677)
at
oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource
(DatabaseSessionImpl.java:559)
at
oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.login(
EntityManagerFactoryProvider.java:193)
at
oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.createEntityManagerFactory
(EntityManagerFactoryProvider.java:129)
at javax.persistence.Persistence.createEntityManagerFactory(
Persistence.java:83)
at javax.persistence.Persistence.createEntityManagerFactory(
Persistence.java:60)
at com.wp.core.persistence.Test.main(Test.java:19)
Local Exception Stack:
Exception [TOPLINK-94] (Oracle TopLink Essentials - 2006.4 (Build 060412)):
oracle.toplink.essentials.exceptions.DescriptorException
Exception Description: Descriptors must have a table name defined.
Descriptor: RelationalDescriptor(com.wp.core.persistence.BrideGroom --> [])
at
oracle.toplink.essentials.exceptions.DescriptorException.tableNotSpecified(
DescriptorException.java:1534)
at
oracle.toplink.essentials.descriptors.ClassDescriptor.selfValidationBeforeInitialization
(ClassDescriptor.java:2308)
at
oracle.toplink.essentials.descriptors.ClassDescriptor.validateBeforeInitialization
(ClassDescriptor.java:3470)
at
oracle.toplink.essentials.descriptors.ClassDescriptor.preInitialize(
ClassDescriptor.java:2165)
at
oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.initializeDescriptors
(DatabaseSessionImpl.java:380)
at
oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.initializeDescriptors
(DatabaseSessionImpl.java:360)
at
oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.postConnectDatasource
(DatabaseSessionImpl.java:677)
at
oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource
(DatabaseSessionImpl.java:559)
at
oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.login(
EntityManagerFactoryProvider.java:193)
at
oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.createEntityManagerFactory
(EntityManagerFactoryProvider.java:129)
at javax.persistence.Persistence.createEntityManagerFactory(
Persistence.java:83)
at javax.persistence.Persistence.createEntityManagerFactory(
Persistence.java:60)
at com.wp.core.persistence.Test.main(Test.java:19)
Local Exception Stack:
Exception [TOPLINK-74] (Oracle TopLink Essentials - 2006.4 (Build 060412)):
oracle.toplink.essentials.exceptions.DescriptorException
Exception Description: The primary key fields are not set for this
descriptor.
Descriptor: RelationalDescriptor(com.wp.core.persistence.BrideGroom --> [])
at
oracle.toplink.essentials.exceptions.DescriptorException.primaryKeyFieldsNotSepcified
(DescriptorException.java:1271)
at
oracle.toplink.essentials.descriptors.ClassDescriptor.selfValidationBeforeInitialization
(ClassDescriptor.java:2314)
at
oracle.toplink.essentials.descriptors.ClassDescriptor.validateBeforeInitialization
(ClassDescriptor.java:3470)
at
oracle.toplink.essentials.descriptors.ClassDescriptor.preInitialize(
ClassDescriptor.java:2165)
at
oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.initializeDescriptors
(DatabaseSessionImpl.java:380)
at
oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.initializeDescriptors
(DatabaseSessionImpl.java:360)
at
oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.postConnectDatasource
(DatabaseSessionImpl.java:677)
at
oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource
(DatabaseSessionImpl.java:559)
at
oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.login(
EntityManagerFactoryProvider.java:193)
at
oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.createEntityManagerFactory
(EntityManagerFactoryProvider.java:129)
at javax.persistence.Persistence.createEntityManagerFactory(
Persistence.java:83)
at javax.persistence.Persistence.createEntityManagerFactory(
Persistence.java:60)
at com.wp.core.persistence.Test.main(Test.java:19)
Local Exception Stack:
Exception [TOPLINK-73] (Oracle TopLink Essentials - 2006.4 (Build 060412)):
oracle.toplink.essentials.exceptions.DescriptorException
Exception Description: Cannot find descriptor for parent class [
java.lang.Object].
Descriptor: RelationalDescriptor(com.wp.core.persistence.Groom -->
[DatabaseTable(grooms)])
at
oracle.toplink.essentials.exceptions.DescriptorException.parentDescriptorNotSpecified
(DescriptorException.java:1263)
at
oracle.toplink.essentials.descriptors.ClassDescriptor.selfValidationBeforeInitialization
(ClassDescriptor.java:2304)
at
oracle.toplink.essentials.descriptors.ClassDescriptor.validateBeforeInitialization
(ClassDescriptor.java:3470)
at
oracle.toplink.essentials.descriptors.ClassDescriptor.preInitialize(
ClassDescriptor.java:2165)
at
oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.initializeDescriptors
(DatabaseSessionImpl.java:380)
at
oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.initializeDescriptors
(DatabaseSessionImpl.java:360)
at
oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.postConnectDatasource
(DatabaseSessionImpl.java:677)
at
oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource
(DatabaseSessionImpl.java:559)
at
oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.login(
EntityManagerFactoryProvider.java:193)
at
oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.createEntityManagerFactory
(EntityManagerFactoryProvider.java:129)
at javax.persistence.Persistence.createEntityManagerFactory(
Persistence.java:83)
at javax.persistence.Persistence.createEntityManagerFactory(
Persistence.java:60)
at com.wp.core.persistence.Test.main(Test.java:19)
Runtime Exceptions:
---------------------------------------------------------
java.lang.NullPointerException
at
oracle.toplink.essentials.descriptors.ClassDescriptor.preInitializeInheritancePolicy
(ClassDescriptor.java:2221)
at
oracle.toplink.essentials.descriptors.ClassDescriptor.preInitialize(
ClassDescriptor.java:2167)
at
oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.initializeDescriptors
(DatabaseSessionImpl.java:380)
at
oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.initializeDescriptors
(DatabaseSessionImpl.java:360)
at
oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.postConnectDatasource
(DatabaseSessionImpl.java:677)
at
oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource
(DatabaseSessionImpl.java:559)
at
oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.login(
EntityManagerFactoryProvider.java:193)
at
oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.createEntityManagerFactory
(EntityManagerFactoryProvider.java:129)
at javax.persistence.Persistence.createEntityManagerFactory(
Persistence.java:83)
at javax.persistence.Persistence.createEntityManagerFactory(
Persistence.java:60)
at com.wp.core.persistence.Test.main(Test.java:19)
java.lang.NullPointerException
at
oracle.toplink.essentials.descriptors.ClassDescriptor.extractDefaultTable(
ClassDescriptor.java:1002)
at
oracle.toplink.essentials.descriptors.ClassDescriptor.preInitialize(
ClassDescriptor.java:2171)
at
oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.initializeDescriptors
(DatabaseSessionImpl.java:380)
at
oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.initializeDescriptors
(DatabaseSessionImpl.java:360)
at
oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.postConnectDatasource
(DatabaseSessionImpl.java:677)
at
oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource
(DatabaseSessionImpl.java:559)
at
oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.login(
EntityManagerFactoryProvider.java:193)
at
oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.createEntityManagerFactory
(EntityManagerFactoryProvider.java:129)
at javax.persistence.Persistence.createEntityManagerFactory(
Persistence.java:83)
at javax.persistence.Persistence.createEntityManagerFactory(
Persistence.java:60)
at com.wp.core.persistence.Test.main(Test.java:19)
java.lang.NullPointerException
at
oracle.toplink.essentials.descriptors.ClassDescriptor.preInitializeInheritancePolicy
(ClassDescriptor.java:2221)
at
oracle.toplink.essentials.descriptors.ClassDescriptor.preInitialize(
ClassDescriptor.java:2167)
at
oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.initializeDescriptors
(DatabaseSessionImpl.java:380)
at
oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.initializeDescriptors
(DatabaseSessionImpl.java:360)
at
oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.postConnectDatasource
(DatabaseSessionImpl.java:677)
at
oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource
(DatabaseSessionImpl.java:559)
at
oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.login(
EntityManagerFactoryProvider.java:193)
at
oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.createEntityManagerFactory
(EntityManagerFactoryProvider.java:129)
at javax.persistence.Persistence.createEntityManagerFactory(
Persistence.java:83)
at javax.persistence.Persistence.createEntityManagerFactory(
Persistence.java:60)
at com.wp.core.persistence.Test.main(Test.java:19)
java.lang.NullPointerException
at oracle.toplink.essentials.descriptors.ClassDescriptor.initialize(
ClassDescriptor.java:1697)
at
oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.initializeDescriptors
(DatabaseSessionImpl.java:399)
at
oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.initializeDescriptors
(DatabaseSessionImpl.java:360)
at
oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.postConnectDatasource
(DatabaseSessionImpl.java:677)
at
oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource
(DatabaseSessionImpl.java:559)
at
oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.login(
EntityManagerFactoryProvider.java:193)
at
oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.createEntityManagerFactory
(EntityManagerFactoryProvider.java:129)
at javax.persistence.Persistence.createEntityManagerFactory(
Persistence.java:83)
at javax.persistence.Persistence.createEntityManagerFactory(
Persistence.java:60)
at com.wp.core.persistence.Test.main(Test.java:19)
java.lang.NullPointerException
at oracle.toplink.essentials.descriptors.ClassDescriptor.initialize(
ClassDescriptor.java:1697)
at
oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.initializeDescriptors
(DatabaseSessionImpl.java:399)
at
oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.initializeDescriptors
(DatabaseSessionImpl.java:360)
at
oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.postConnectDatasource
(DatabaseSessionImpl.java:677)
at
oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource
(DatabaseSessionImpl.java:559)
at
oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.login(
EntityManagerFactoryProvider.java:193)
at
oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.createEntityManagerFactory
(EntityManagerFactoryProvider.java:129)
at javax.persistence.Persistence.createEntityManagerFactory(
Persistence.java:83)
at javax.persistence.Persistence.createEntityManagerFactory(
Persistence.java:60)
at com.wp.core.persistence.Test.main(Test.java:19)
I looked at the Java Persistence API specs, section 2.1.9 and can't find
what I'm doing wrong (or is this a bug?)...
Could someone point it out for me?
Thanks,
Daniel.