-
Bug
-
Resolution: Fixed
-
P3
-
7u75, 9
-
b113
-
Not verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8156294 | 8u111 | Aleksej Efimov | P3 | Resolved | Fixed | b01 |
JDK-8152943 | 8u102 | Aleksej Efimov | P3 | Resolved | Fixed | b02 |
JDK-8162138 | emb-8u111 | Aleksej Efimov | P3 | Resolved | Fixed | b01 |
JDK-8153024 | 7u111 | Aleksej Efimov | P3 | Resolved | Fixed | b02 |
Consider the following java class:
import java.util.*;
import javax.xml.bind.annotation.*;
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"fooObject"
})
@XmlRootElement(name = "Foo")
public class Foo {
protected List<Foo> fooObject;
public List<Foo> getFooObject() {
if (fooObject == null) {
fooObject = new ArrayList<Foo>();
}
return this.fooObject;
}
}
schemagen invocation for this class fails on latest JDK9/8/7 builds with:
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:502)
at com.sun.tools.internal.jxc.SchemaGenerator.run(SchemaGenerator.java:151)
at com.sun.tools.internal.jxc.SchemaGenerator.run(SchemaGenerator.java:76)
at com.sun.tools.internal.jxc.SchemaGenerator.main(SchemaGenerator.java:67)
Caused by: java.lang.RuntimeException: java.lang.StackOverflowError
at com.sun.tools.javac.api.JavacTaskImpl.handleExceptions(JavacTaskImpl.java:144)
at com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:93)
at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:87)
at com.sun.tools.internal.jxc.SchemaGenerator$Runner.compile(SchemaGenerator.java:251)
... 7 more
Caused by: java.lang.StackOverflowError
at java.lang.ref.Reference.<init>(Reference.java:304)
at java.lang.ref.WeakReference.<init>(WeakReference.java:57)
at java.lang.reflect.Proxy$Key1.<init>(Proxy.java:439)
at java.lang.reflect.Proxy$KeyFactory.apply(Proxy.java:545)
at java.lang.reflect.Proxy$KeyFactory.apply(Proxy.java:539)
at java.lang.reflect.WeakCache.get(WeakCache.java:120)
at java.lang.reflect.Proxy.getProxyClass0(Proxy.java:419)
at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:719)
at com.sun.xml.internal.txw2.ContainerElement._cast(ContainerElement.java:353)
at com.sun.xml.internal.txw2.ContainerElement._element(ContainerElement.java:374)
at com.sun.xml.internal.txw2.ContainerElement.addElement(ContainerElement.java:218)
at com.sun.xml.internal.txw2.ContainerElement.invoke(ContainerElement.java:145)
at com.sun.proxy.$Proxy15.element(Unknown Source)
at com.sun.xml.internal.bind.v2.schemagen.XmlSchemaGenerator$Namespace$2.write(XmlSchemaGenerator.java:1054)
at com.sun.xml.internal.bind.v2.schemagen.Tree$Optional.write(Tree.java:170)
at com.sun.xml.internal.bind.v2.schemagen.Tree$Repeated.write(Tree.java:196)
at com.sun.xml.internal.bind.v2.schemagen.Tree$Group.write(Tree.java:240)
at com.sun.xml.internal.bind.v2.schemagen.Tree.write(Tree.java:123)
at com.sun.xml.internal.bind.v2.schemagen.Tree.write(Tree.java:126)
at com.sun.xml.internal.bind.v2.schemagen.XmlSchemaGenerator$Namespace.writeClass(XmlSchemaGenerator.java:969)
at com.sun.xml.internal.bind.v2.schemagen.XmlSchemaGenerator$Namespace.writeTypeRef(XmlSchemaGenerator.java:794)
at com.sun.xml.internal.bind.v2.schemagen.XmlSchemaGenerator$Namespace.writeTypeRef(XmlSchemaGenerator.java:765)
at com.sun.xml.internal.bind.v2.schemagen.XmlSchemaGenerator$Namespace.access$1800(XmlSchemaGenerator.java:491)
at com.sun.xml.internal.bind.v2.schemagen.XmlSchemaGenerator$Namespace$2.write(XmlSchemaGenerator.java:1092)
import java.util.*;
import javax.xml.bind.annotation.*;
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"fooObject"
})
@XmlRootElement(name = "Foo")
public class Foo {
protected List<Foo> fooObject;
public List<Foo> getFooObject() {
if (fooObject == null) {
fooObject = new ArrayList<Foo>();
}
return this.fooObject;
}
}
schemagen invocation for this class fails on latest JDK9/8/7 builds with:
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:502)
at com.sun.tools.internal.jxc.SchemaGenerator.run(SchemaGenerator.java:151)
at com.sun.tools.internal.jxc.SchemaGenerator.run(SchemaGenerator.java:76)
at com.sun.tools.internal.jxc.SchemaGenerator.main(SchemaGenerator.java:67)
Caused by: java.lang.RuntimeException: java.lang.StackOverflowError
at com.sun.tools.javac.api.JavacTaskImpl.handleExceptions(JavacTaskImpl.java:144)
at com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:93)
at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:87)
at com.sun.tools.internal.jxc.SchemaGenerator$Runner.compile(SchemaGenerator.java:251)
... 7 more
Caused by: java.lang.StackOverflowError
at java.lang.ref.Reference.<init>(Reference.java:304)
at java.lang.ref.WeakReference.<init>(WeakReference.java:57)
at java.lang.reflect.Proxy$Key1.<init>(Proxy.java:439)
at java.lang.reflect.Proxy$KeyFactory.apply(Proxy.java:545)
at java.lang.reflect.Proxy$KeyFactory.apply(Proxy.java:539)
at java.lang.reflect.WeakCache.get(WeakCache.java:120)
at java.lang.reflect.Proxy.getProxyClass0(Proxy.java:419)
at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:719)
at com.sun.xml.internal.txw2.ContainerElement._cast(ContainerElement.java:353)
at com.sun.xml.internal.txw2.ContainerElement._element(ContainerElement.java:374)
at com.sun.xml.internal.txw2.ContainerElement.addElement(ContainerElement.java:218)
at com.sun.xml.internal.txw2.ContainerElement.invoke(ContainerElement.java:145)
at com.sun.proxy.$Proxy15.element(Unknown Source)
at com.sun.xml.internal.bind.v2.schemagen.XmlSchemaGenerator$Namespace$2.write(XmlSchemaGenerator.java:1054)
at com.sun.xml.internal.bind.v2.schemagen.Tree$Optional.write(Tree.java:170)
at com.sun.xml.internal.bind.v2.schemagen.Tree$Repeated.write(Tree.java:196)
at com.sun.xml.internal.bind.v2.schemagen.Tree$Group.write(Tree.java:240)
at com.sun.xml.internal.bind.v2.schemagen.Tree.write(Tree.java:123)
at com.sun.xml.internal.bind.v2.schemagen.Tree.write(Tree.java:126)
at com.sun.xml.internal.bind.v2.schemagen.XmlSchemaGenerator$Namespace.writeClass(XmlSchemaGenerator.java:969)
at com.sun.xml.internal.bind.v2.schemagen.XmlSchemaGenerator$Namespace.writeTypeRef(XmlSchemaGenerator.java:794)
at com.sun.xml.internal.bind.v2.schemagen.XmlSchemaGenerator$Namespace.writeTypeRef(XmlSchemaGenerator.java:765)
at com.sun.xml.internal.bind.v2.schemagen.XmlSchemaGenerator$Namespace.access$1800(XmlSchemaGenerator.java:491)
at com.sun.xml.internal.bind.v2.schemagen.XmlSchemaGenerator$Namespace$2.write(XmlSchemaGenerator.java:1092)
- backported by
-
JDK-8152943 Schemagen fails with StackOverflowError if element references containing class
- Resolved
-
JDK-8153024 Schemagen fails with StackOverflowError if element references containing class
- Resolved
-
JDK-8156294 Schemagen fails with StackOverflowError if element references containing class
- Resolved
-
JDK-8162138 Schemagen fails with StackOverflowError if element references containing class
- Resolved
- relates to
-
JDK-8150174 Update JAX-WS RI integration to latest version (2.3.0-SNAPSHOT)
- Resolved