I have successfully create a Rest Service using EJB and in the service project create a JAXB XML Schema with the service and a objectList class created.
I have now created another entity that as a blob as an attribute, and I already created the service and that objectList class but when I want to create the JaxB schema it returns me this error: An error was encountered while migrating jaxb
I can create the schema with the service, but when I want to add the objectList class the error appear.
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import model.Memos;
@XmlRootElement
public class MemosList {
List<Memos> listOfMemos = new ArrayList<Memos>();
public void setListOfMemos(List<Memos> listOfMemos) {
this.listOfMemos = listOfMemos;
}
@XmlElement(name = "allmemos")
public List<Memos> getListOfMemos() {
return listOfMemos;
}
}
I have already compare it with other objectList classes and besides the object itself it's the same.
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlInlineBinaryData;
import javax.xml.bind.annotation.XmlRootElement;
@Entity
@NamedQueries({
@NamedQuery(name = "Memos.findAll", query = "select o from Memos o"),
@NamedQuery(name = "Memos.findBySourceId", query = "select o from Memos o where o.sourceid = :recid"),
@NamedQuery(name = "Memos.findPhoto", query = "select o.thememo from Memos o where o.sourceid =:recid and o.memotyp = 101")
})
@XmlRootElement
public class Memos implements Serializable {
private static final long serialVersionUID = 5654986909315183287L;
@Column(nullable = false)
private BigDecimal memotyp;
@Column(length = 40)
private String name;
@Temporal(TemporalType.DATE)
private Date reccdate;
@Column(nullable = false)
private BigDecimal reccusr;
@Temporal(TemporalType.DATE)
@Column(nullable = false)
private Date recdate;
@Column(nullable = false)
private BigDecimal recgrp;
@Id
@Column(nullable = false)
private String recid;
@Column(nullable = false)
private BigDecimal recperm;
@Column(nullable = false)
private BigDecimal recusr;
@Column(nullable = false)
private String sourceid;
//@Lob
//@XmlJavaTypeAdapter(Base64Adapter.class)
@XmlInlineBinaryData
private byte[] thememo;
public Memos() { }
public Memos(BigDecimal memotyp, String name, Date reccdate, BigDecimal reccusr, Date recdate, BigDecimal recgrp, String recid,
BigDecimal recperm, BigDecimal recusr, String sourceid) {
this.memotyp = memotyp;
this.name = name;
this.reccdate = reccdate;
this.reccusr = reccusr;
this.recdate = recdate;
this.recgrp = recgrp;
this.recid = recid;
this.recperm = recperm;
this.recusr = recusr;
this.sourceid = sourceid;
}
public BigDecimal getMemotyp() {
return memotyp;
}
public void setMemotyp(BigDecimal memotyp) {
this.memotyp = memotyp;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Date getReccdate() {
return reccdate;
}
public void setReccdate(Date reccdate) {
this.reccdate = reccdate;
}
public BigDecimal getReccusr() {
return reccusr;
}
public void setReccusr(BigDecimal reccusr) {
this.reccusr = reccusr;
}
public Date getRecdate() {
return recdate;
}
public void setRecdate(Date recdate) {
this.recdate = recdate;
}
public BigDecimal getRecgrp() {
return recgrp;
}
public void setRecgrp(BigDecimal recgrp) {
this.recgrp = recgrp;
}
public String getRecid() {
return recid;
}
public void setRecid(String recid) {
this.recid = recid;
}
public BigDecimal getRecperm() {
return recperm;
}
public void setRecperm(BigDecimal recperm) {
this.recperm = recperm;
}
public BigDecimal getRecusr() {
return recusr;
}
public void setRecusr(BigDecimal recusr) {
this.recusr = recusr;
}
public String getSourceid() {
return sourceid;
}
public void setSourceid(String sourceid) {
this.sourceid = sourceid;
}
@XmlInlineBinaryData
public byte[] getThememo() {
return thememo;
}
public void setThememo(byte[] thememo) {
this.thememo = thememo;
}
}
I'm using jdev 12c and working with JAX-RS Jersey 1.x and JAX-RS Jersey(Bundled) libs