@xmlElement
标有的对象必须是要class类型,不能是interface
[quote]
public static String marshal(Object obj) {
OutputStream os = new ByteArrayOutputStream();
String xmlStr = null;
try {
createContext(obj.getClass()).createMarshaller().marshal(obj, os);
xmlStr = os.toString();
} catch (JAXBException e) {
String errorMsg = "Failed to parse the object to xml string with error: " + e.getMessage();
LOGGER.error(errorMsg);
throw new SerializeException(errorMsg, e);
} finally {
if (os != null) {
os = null;
}
}
return xmlStr;
}
createContext(obj.getClass()).createMarshaller().marshal(obj, os);
com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions
java.io.Serializable is an interface, and JAXB can't handle interfaces.
this problem is related to the following location:
at java.io.Serializable
at private java.io.Serializable[] com.statestr.gcth.application.model.DashBoardEvent.dashboardEventParams
at com.statestr.gcth.application.model.DashBoardEvent
at private com.statestr.gcth.application.model.DashBoardEvent com.statestr.gcth.application.model.GcRemediationTask.dashBoardEvent
at com.statestr.gcth.application.model.GcRemediationTask
java.io.Serializable does not have a no-arg default constructor.
this problem is related to the following location:
at java.io.Serializable
at private java.io.Serializable[] com.statestr.gcth.application.model.DashBoardEvent.dashboardEventParams
at com.statestr.gcth.application.model.DashBoardEvent
at private com.statestr.gcth.application.model.DashBoardEvent com.statestr.gcth.application.model.GcRemediationTask.dashBoardEvent
at com.statestr.gcth.application.model.GcRemediationTask
[/quote]
标有的对象必须是要class类型,不能是interface
[quote]
public static String marshal(Object obj) {
OutputStream os = new ByteArrayOutputStream();
String xmlStr = null;
try {
createContext(obj.getClass()).createMarshaller().marshal(obj, os);
xmlStr = os.toString();
} catch (JAXBException e) {
String errorMsg = "Failed to parse the object to xml string with error: " + e.getMessage();
LOGGER.error(errorMsg);
throw new SerializeException(errorMsg, e);
} finally {
if (os != null) {
os = null;
}
}
return xmlStr;
}
createContext(obj.getClass()).createMarshaller().marshal(obj, os);
com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions
java.io.Serializable is an interface, and JAXB can't handle interfaces.
this problem is related to the following location:
at java.io.Serializable
at private java.io.Serializable[] com.statestr.gcth.application.model.DashBoardEvent.dashboardEventParams
at com.statestr.gcth.application.model.DashBoardEvent
at private com.statestr.gcth.application.model.DashBoardEvent com.statestr.gcth.application.model.GcRemediationTask.dashBoardEvent
at com.statestr.gcth.application.model.GcRemediationTask
java.io.Serializable does not have a no-arg default constructor.
this problem is related to the following location:
at java.io.Serializable
at private java.io.Serializable[] com.statestr.gcth.application.model.DashBoardEvent.dashboardEventParams
at com.statestr.gcth.application.model.DashBoardEvent
at private com.statestr.gcth.application.model.DashBoardEvent com.statestr.gcth.application.model.GcRemediationTask.dashBoardEvent
at com.statestr.gcth.application.model.GcRemediationTask
[/quote]