Hi,
I cannot reproduce.
I modified the jabx sample distributed with Jersey (see attached) so
that a JAXB bean is as follows:
@XmlRootElement
public class JAXBXmlRootElement {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
public String value;
that bean is marshalled and unmarshalled by the unit tests without any
failures.
Paul.
On Apr 14, 2009, at 7:10 PM, Felipe Gaúcho wrote:
> 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 ...
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>