users@jersey.java.net

Re: [Jersey] Absent Code attribute in method that is not native

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Wed, 15 Apr 2009 10:19:04 +0200

Hi,

Does any JPA annotation cause the same issue?

What jar are you using for the JPA annotations?

The class loading error is very low-level.

I do not know enough about JAXB with JPA to be of much help :-( i know
that there are frameworks like HyperJAXB that work with both.

Paul.

On Apr 14, 2009, at 7:16 PM, Felipe Gaúcho wrote:

> also the @Temporal causes problems:
>
> @XmlElement
> @Column(nullable = true)
> @Temporal(TemporalType.DATE)
> private Date expireDate;
>
> if I remove this @Temporal, jaxb marshall the type without problems..
>
> may I use an adapter or something like that to fix the problem or JAXB
> and JPA annotations are incompatibles ?
>
>
>
> 2009/4/14 Felipe Gaúcho <fgaucho_at_gmail.com>:
>> unfortunately not ... but I mapped the problem symptom :
>>
>> the JPA annotation @GeneratedValue
>> causes problems with JAXB ..
>>
>> If I remove this annotation, everything works... but if I include I
>> have the following exception:
>>
>> java.lang.ClassFormatError: Absent Code attribute in method that is
>> not native or abstract in class file javax/persistence/GenerationType
>> at java.lang.ClassLoader.defineClass1(Native Method)
>> at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
>> ....
>>
>> This is a sample of class where the problem happens:
>>
>> @XmlType(namespace = "http://footprint.dev.java.net/service/entity")
>> @XmlAccessorOrder(XmlAccessOrder.ALPHABETICAL)
>> @XmlAccessorType(XmlAccessType.FIELD)
>> @MappedSuperclass
>> public abstract class AbstractFootprintEntity implements
>> Serializable {
>> @XmlElement
>> @Id
>> @GeneratedValue(strategy = GenerationType.AUTO) // here :(
>> private long id;
>>
>> ......
>> }
>>
>> apparently the annotation GenerationType is not serializable by the
>> JAXB framework....
>>
>> if one of you know a trick or workaround, please ...
>>
>
>
>
> --
>
> Please help to test this application:
> http://fgaucho.dyndns.org:8080/cejug-classifieds-richfaces
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_metro.dev.java.net
> For additional commands, e-mail: users-help_at_metro.dev.java.net
>