To marshal a long primitive type using JAXB, I have used @XmlJavaTypeAdapter annotation, which will adapt non-String type to a String. Even though it throw erro
XmlJavaTypeAdapter
Specify the primitive class in the annotation:
@XmlJavaTypeAdapter(type=long.class, value=WSLongAdapter.class)