These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: component property not found: id
PostPosted: Wed May 19, 2010 8:21 pm 
Newbie

Joined: Wed Sep 12, 2007 12:40 am
Posts: 2
I'm getting this error when deploying to Glassfish. This is the first time deploying on Glassfish v3 and the first time using hibernate 3.5.0.

The error did not happen prior to the 3.5.0 upgrade. The OrderLineItem has an id property in it's MappedSuperClass. Any thoughts on what would be causing this error?


Code:
#|2010-05-19T17:59:02.301-0600|INFO|glassfishv3.0|org.hibernate.cfg.annotations.EntityBinder|_ThreadID=30;_ThreadName=Thread-1;|Bind entity com.gaiam.gcsi.enti
ties.order.OrderLineItem on table order_line_item|#]

[#|2010-05-19T17:59:02.320-0600|SEVERE|glassfishv3.0|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=30;_ThreadName=Thread-1;|Exception while invoking class org.glassfish.persistence.jpa.JPADeployer prepare method
org.hibernate.MappingException: component property not found: id
        at org.hibernate.mapping.Component.getProperty(Component.java:291)
        at org.hibernate.cfg.AnnotationBinder.fillComponent(AnnotationBinder.java:2355)
        at org.hibernate.cfg.AnnotationBinder.fillComponent(AnnotationBinder.java:2240)
        at org.hibernate.cfg.AnnotationBinder.bindComponent(AnnotationBinder.java:2192)


Top
 Profile  
 
 Post subject: Re: component property not found: id
PostPosted: Thu May 20, 2010 7:33 pm 
Newbie

Joined: Wed Sep 12, 2007 12:40 am
Posts: 2
My specific error was caused by using a Embeddable class that contained an 'id' property as a sub class and an entity which extended a class that also had an 'id' property defined (see below for an example). This was a refactoring mistake amd I'm assuming this is not really legal because it doesn't make sense.

I have also opened a Jira ticket to asked that Component.java add a little bit more information to the MappingException for help finding the context of the property.

http://opensource.atlassian.com/project ... e/HHH-5249



Code:
@MappedSuperclass
public abstract BaseEntity {
   private Long id;
}

@Embeddable
public Item extends BaseEntity {
}

/** Mistakenly extends BaseEntity but also has BaseEntity via Embeddable */
@Entity
public ConcreteItem extends BaseEntity {
  private Item item;
}



Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.