Return-Path: Delivered-To: apmail-openjpa-users-archive@minotaur.apache.org Received: (qmail 42557 invoked from network); 27 Oct 2009 23:10:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 27 Oct 2009 23:10:43 -0000 Received: (qmail 12751 invoked by uid 500); 27 Oct 2009 20:24:03 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 12718 invoked by uid 500); 27 Oct 2009 20:24:03 -0000 Mailing-List: contact users-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@openjpa.apache.org Delivered-To: mailing list users@openjpa.apache.org Received: (qmail 12708 invoked by uid 99); 27 Oct 2009 20:24:03 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Oct 2009 20:24:03 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of ljw1001@gmail.com designates 209.85.223.201 as permitted sender) Received: from [209.85.223.201] (HELO mail-iw0-f201.google.com) (209.85.223.201) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Oct 2009 20:23:55 +0000 Received: by iwn39 with SMTP id 39so80943iwn.25 for ; Tue, 27 Oct 2009 13:23:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=Z315sfrJjicSJT88EqbUAdeBmbIM1iH+pREPQQ7MEaY=; b=HQfRc9ComDk8cfXLNVwmcLbdE28UzJSKE2W0OoYGVfF1xuR8gvuSOr2IjZ4VzZ9YxV SXW0GmZyKLNdqgA/Yx80hCLRsI/csEnVHtf8hpI8//eE3DGDp+qrKwcnRykrfGoMQt74 yFPhs9r5nR7yRUZsj15npXcDcW9yqed/LOlCU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=ppCrxZO4F0NfX1m5Qf10aoz24DDb+4qSCeHPnM73cdU8ebEFTdv17ZTMR8c7Rlf7mx umavv9s8SduCCysMDqEVjwaB9dcj1Wt8Bi2FOCJTVaZYUKswIjLfsKZg9G63rLC3JP9K eO5YNHjjAWTDFHb/ByJZgXOyxPgcBPAXnyDY4= MIME-Version: 1.0 Received: by 10.231.121.69 with SMTP id g5mr1113572ibr.44.1256675014533; Tue, 27 Oct 2009 13:23:34 -0700 (PDT) In-Reply-To: References: Date: Tue, 27 Oct 2009 16:23:34 -0400 Message-ID: Subject: Re: newbie problem with "enhancement" using Idea 8 and OpenJPA From: Larry White To: users@openjpa.apache.org Content-Type: multipart/alternative; boundary=0016e644cd96d6e3a70476f07362 X-Virus-Checked: Checked by ClamAV on apache.org --0016e644cd96d6e3a70476f07362 Content-Type: text/plain; charset=ISO-8859-1 On Tue, Oct 27, 2009 at 4:02 PM, Rick Curtis wrote: > Larry - > > I haven't used Intellij before so please excuse me if it seems that I'm > fumbling through the dark here... > > Do you see any information logged during the build process or prior to > running your application that has the following key "openjpa.Enhance"? Is > there any text that our enhancer ran, but didn't do any work (Search for > "enhance") ? I'm not seeing any reference to "enhance" in the build stage. The only JPA reference I've seen is text that says "Validating Persistence Module" or something to that effect. > What JPA operation were you invoking when you encounter the > exception above (ie : em.persist() ) ? Hopefully this gets us going in the > right direction. > > Yes, em.persist(); > Since you are new to OpenJPA, take a look at a blog post [1] I wrote a > while > back which talks about the enhancement process. > > [1] > http://webspherepersistence.blogspot.com/2009/02/openjpa-enhancement.html > > Thanks, > Rick > > On Tue, Oct 27, 2009 at 2:40 PM, Larry White wrote: > > > Hi, > > > > I'm working on my first OpenJPA app using the plugin for Intellij Idea 8. > > I'm getting the error: > > > > > > org.apache.openjpa.persistence.ArgumentException: Attempt to cast > instance > > "com.deathrayresearch.server.model.product.Product@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; > > } > > } > > > > -------------------------------------------------- > > > > > > version="1.0"> > > > > > > > > > > > org.apache.openjpa.persistence.PersistenceProviderImpl > > > > > value="jdbc:postgresql:worldview"/> > > > value="org.postgresql.Driver"/> > > > > > > > > > > > > > --0016e644cd96d6e3a70476f07362--