Hi,
I'm working on my first OpenJPA app using the plugin for Intellij Idea 8.
I'm getting the error:
<openjpa-1.2.1-r752877:753278 nonfatal user error>
org.apache.openjpa.persistence.ArgumentException: Attempt to cast instance
"com.deathrayresearch.server.model.product.prod...@1c7e2da" to
PersistenceCapable failed. Ensure that it has been enhanced.
I don't know enough about the technology or the plug-in to know even
generally what's going wrong. My understanding is that the plugin performs
the enhancement during each build, but I'm not seeing any errors during the
build process to indicate that it failed.
FWIW, I have not created a table for "Product", under the assumption that it
would be generated from the entity class definition.
My entity class and persistence.xml are below.
Thanks for your help
-----------------------------------------------------
package com.deathrayresearch.server.model.product;
import javax.persistence.*;
import java.io.Serializable;
@Entity
public class Product implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private long id;
@Basic
@Column(nullable = false, length = 30)
private String name;
@Basic
@Column(nullable = true, length = 30)
private String description;
public Product() {
}
public Product(String description, String name) {
this.description = description;
this.name = name;
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
--------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0">
<persistence-unit name="worldview">
<provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
<properties>
<property name="openjpa.ConnectionURL"
value="jdbc:postgresql:worldview"/>
<property name="openjpa.ConnectionDriverName"
value="org.postgresql.Driver"/>
<property name="openjpa.ConnectionUserName" value="postgres"/>
<property name="openjpa.ConnectionPassword" value="foobar"/>
<property name="openjpa.Log" value="DefaultLevel=TRACE,
Tool=INFO"/>
</properties>
</persistence-unit>