Open glassfishrobot opened 8 years ago
Hi there,
I recently recompiled some code on Java 8 and found that JAXB does not yield to the ({XmlAccessType.NONE}} anymore.
package xml.exception; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.JAXBContext; import javax.xml.bind.Marshaller; @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) public class SimpleException extends Exception { private String id; public SimpleException() { } public SimpleException(String id) { this.id = id; } public static void main(String[] args) throws Exception { JAXBContext jc = JAXBContext.newInstance(SimpleException.class); Marshaller m = jc.createMarshaller(); m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); SimpleException e = new SimpleException("12"); m.marshal(e, System.out); } @XmlAttribute public String getId() { return id; } public void setId(String id) { this.id = id; } }
On Java 7 this used to work and produced this:
<simpleException id="12"/>
but instead on JAva 8 it produces this:
<simpleException id="12"> <stackTrace/> <stackTrace/> <stackTrace/> <stackTrace/> <stackTrace/> <stackTrace/> </simpleException>
Has anyone come across this problem?
[2.2.10]
Reported by niels.bertram
This issue was imported from java.net JIRA JAX_WS-1186
Hi there,
I recently recompiled some code on Java 8 and found that JAXB does not yield to the ({XmlAccessType.NONE}} anymore.
On Java 7 this used to work and produced this:
but instead on JAva 8 it produces this:
Has anyone come across this problem?
Affected Versions
[2.2.10]