Details
-
Bug
-
Status: Closed
-
Blocker
-
Resolution: Fixed
-
2.7.2, 3.0.0-milestone1, 2.7.8
-
None
-
Unknown
Description
As I cannot reopen issue CXF-4711, created this one. If it is possible -delete this one and reopen CXF-4711.
Reproduced this bug in latest version of CXF 2.7.8 and 3.0.0-milestone1(as well as in fix version for CXF-4711 - 2.7.2). Same situation described there appears in following case:
CxfRecursiveTypeTest.java
public class CxfRecursiveTypeTest { @Test public void testRecursiveType() throws Exception { Set<Class<?>> classes = new HashSet<Class<?>>(); Collection<Object> typeReferences = new ArrayList<Object>(); JAXBContextInitializer jaxbContextInitializer = new JAXBContextInitializer(null, classes, typeReferences); Method addClassMethod = JAXBContextInitializer.class.getDeclaredMethod("addClass", Class.class); addClassMethod.setAccessible(true); addClassMethod.invoke(jaxbContextInitializer, Validation.class); System.out.println(classes); } public static class ObjectGraphProcessorItem<T extends ObjectGraphProcessorItem<T>> { protected T parentItem; protected List<T> childItems = new ArrayList<T>(); public ObjectGraphProcessorItem(Object object) { super(); } public List<T> getChildItems() { return childItems; } public void setChildItems(List<T> childItems) { this.childItems = childItems; } public T getParentItem() { return parentItem; } public void setParentItem(T parentItem) { this.parentItem = parentItem; } } public static class Validation extends ObjectGraphProcessorItem<Validation> implements Serializable { public Validation() { super(null); } public Validation(Object object) { super(object); } } }
Stacktrace
Caused by: java.lang.StackOverflowError at java.security.AccessController.doPrivileged(Native Method) [rt.jar:1.7.0_45] at org.apache.cxf.common.util.ReflectionUtil.getDeclaredConstructor(ReflectionUtil.java:83) [cxf-api-2.7.8.jar:2.7.8] at org.apache.cxf.common.jaxb.JAXBUtils.getValidClass(JAXBUtils.java:516) [cxf-api-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addClass(JAXBContextInitializer.java:280) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:223) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:213) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:226) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:213) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:263) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:213) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:229) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:213) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:263) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:213) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:229) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:213) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:263) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:213) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:229) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:213) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:263) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:213) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:229) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:213) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:263) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:213) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:229) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:213) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:263) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:213) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:229) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:213) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:263) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:213) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:229) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:213) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:263) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:213) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:229) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:213) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:263) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:213) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:229) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:213) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:263) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:213) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:229) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:213) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:263) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:213) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:229) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:213) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:263) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:213) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:229) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:213) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:263) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:213) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:229) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:213) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:263) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:213) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:229) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:213) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:263) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:213) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:229) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8] at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:213) [cxf-rt-databinding-jaxb-2.7.8.jar:2.7.8]