users@jersey.java.net

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

From: Felipe Gaúcho <fgaucho_at_gmail.com>
Date: Tue, 14 Apr 2009 19:16:51 +0200

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