Last active
August 29, 2015 13:58
-
-
Save ldez/10012273 to your computer and use it in GitHub Desktop.
JAXB error "java.lang.StackTraceElement does not have a no-arg default constructor"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.ldez.myapp.support.exception; | |
import javax.xml.bind.annotation.XmlAccessType; | |
import javax.xml.bind.annotation.XmlAccessorType; | |
import javax.xml.bind.annotation.XmlTransient; | |
@XmlAccessorType(XmlAccessType.PROPERTY) | |
public abstract class AbstractTransientException extends Exception { | |
private static final long serialVersionUID = 1L; | |
@XmlTransient | |
@Override | |
public final StackTraceElement[] getStackTrace() { | |
// return null because StackTraceElement doesn't have no-arg contructor -> marshalling fail | |
return null; | |
} | |
@XmlTransient | |
@Override | |
public final synchronized Throwable getCause() { | |
// return null because marshalling fail | |
return null; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Dirty way but works...