Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » JPA error on "primitive" property with "wrapped" field
JPA error on "primitive" property with "wrapped" field [message #385754] Fri, 06 March 2009 11:53 Go to next message
Nico Rampelbergh is currently offline Nico RampelberghFriend
Messages: 2
Registered: July 2009
Junior Member
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 messageGo to next message
Doug Clarke is currently offline Doug ClarkeFriend
Messages: 155
Registered: July 2009
Senior Member
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
Re: JPA error on "primitive" property with "wrapped" field [message #385984 is a reply to message #385758] Tue, 10 March 2009 06:52 Go to previous message
Nico Rampelbergh is currently offline Nico RampelberghFriend
Messages: 2
Registered: July 2009
Junior Member
Doug,

Thanks for the reply. I've filed bug 267770
(https://bugs.eclipse.org/bugs/show_bug.cgi?id=267770)

Cheers,
Nico
Previous Topic:Exits a working RCP-Example for EclipsLink -JPA?
Next Topic:Possible Bug in Column Generation
Goto Forum:
  


Current Time: Tue Apr 23 13:42:35 GMT 2024

Powered by FUDForum. Page generated in 0.50895 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top