Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JAXB Error  RSS feed

 
ryan bohnert
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to marshal an object and it's throwing the following error.
class com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException [Ljava.lang.StackTraceElement;@c68c3 2 counts of IllegalAnnotationExceptions null.

The line thowing the error is this
JAXBContext context = JAXBContext.newInstance(Resync.class);


I have googled this error and some post say i need an empty constructor to fix this. I have tried several things and nothing seems to work. Any help is appreciated.

thanks

Main Class Snippet




Resync Class
 
ryan bohnert
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the solution to this problem is in the Resync class

add this line of code above both get Methods for XMLGregorian Calendar fields

@XmlSchemaType(name = "dateTime")
public XMLGregorianCalendar getResyncStartDateTime().....


@XmlSchemaType(name = "dateTime")
public XMLGregorianCalendar getResyncEndDateTime()....
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!