JPA error on "primitive" property with "wrapped" field [message #385754] |
Fri, 06 March 2009 11:53 ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Hi,
One of our applications had a strange problem recently:
while using the entity MyEntity, we got a
java.lang.VerifyError: (class: MyEntity, method: setMyField signature:
(Z)V) Expecting to find integer on stackThe problem is this piece of code
The application is deployed on OCJ4 10.1.3.4, and uses Eclipselink as
delivered by Toplink 11.1.1.0.1.
We narrowed the problem to the following situation
@Entity
@Table(name = "MY_TABLE")
public MyEntity {
private Boolean myField;
@Column(name = "MY_FIELD")
public boolean getMyField() {
return myField;
}
public boolean setMyField(boolean myField) {
this.myField = myField;
}
As you can see, the myField is defined as Boolean object while the
getter/setter methods use primitives.
By changing myField to a primitive, the error disappeared.
Is this as specified by the spec (autoboxing not supported), or is this an
issue that should be reported in Bugzilla?
Cheers,
Nico
|
|
|
Re: JPA error on "primitive" property with "wrapped" field [message #385758 is a reply to message #385754] |
Mon, 09 March 2009 14:18 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Nico,
I would file a bug so that we can track the issue and potentially improve
the diagnostics.
I believe the problem is in our weaving. We assume the attribute is
primitive due to the return type on the get method and then weave the byte
codes based on this.
Another work-around would be to annotate the fields instead of the
property method.
@Column(name = "MY_FIELD")
private Boolean myField;
Doug
|
|
|
|
Powered by
FUDForum. Page generated in 0.02745 seconds