Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-4125

StackOverflowError when requesting WADL

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.4.6
    • 2.3.10, 2.4.7, 2.5.3, 2.6
    • JAX-RS
    • None
    • Unknown

    Description

      My JAX-RS service throws a StackOverflowException when requesting the WADL:

      java.lang.StackOverflowError
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:314)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1560)
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491)
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:264)
      at sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:113)
      at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:125)
      at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49)
      at sun.reflect.annotation.AnnotationParser.parseSig(AnnotationParser.java:388)
      at sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:199)
      at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:87)
      at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:70)
      at java.lang.reflect.Method.declaredAnnotations(Method.java:714)
      at java.lang.reflect.Method.getDeclaredAnnotations(Method.java:707)
      at java.lang.reflect.AccessibleObject.getAnnotations(AccessibleObject.java:193)
      at org.apache.cxf.jaxrs.utils.InjectionUtils.canPropertyBeIgnored(InjectionUtils.java:1070)
      at org.apache.cxf.jaxrs.utils.InjectionUtils.getParametersFromBeanClass(InjectionUtils.java:1059)
      at org.apache.cxf.jaxrs.model.wadl.WadlGenerator.doWriteBeanParam(WadlGenerator.java:547)
      at org.apache.cxf.jaxrs.model.wadl.WadlGenerator.doWriteBeanParam(WadlGenerator.java:558)
      at org.apache.cxf.jaxrs.model.wadl.WadlGenerator.doWriteBeanParam(WadlGenerator.java:558)
      ... (last line repeated about 990 times)

      I've tracked the problem down to a particular method signature:

      @GET @Path("/foo") FooResult doFoo(@QueryParam("") Foo foo);

      where Foo is:

      public class Foo extends com.foo.FooTO

      { ... }

      and FooTO is generated by JAXB:

      @XmlType(name = "", propOrder = {
      ...
      })
      @XmlRootElement(name = "foo")
      public class FooTO
      implements Equals, HashCode, ToString
      {
      @XmlElement(type = Long.class)
      protected List<Long> a;
      @XmlElement(required = true, type = String.class)
      @XmlJavaTypeAdapter(Adapter1 .class)
      @XmlSchemaType(name = "date")
      protected DateTime b;
      @XmlElement(required = true, type = String.class)
      @XmlJavaTypeAdapter(Adapter1 .class)
      @XmlSchemaType(name = "date")
      protected DateTime c;
      ...
      }

      I refer to the XSD in the jaxrs:schemaLocations section of my application context and I configure the WadlGenerator in the jaxrs:providers section as follows:

      <jaxrs:providers>
      <bean class="org.apache.cxf.jaxrs.model.wadl.WadlGenerator">
      <property name="applicationTitle" value="FooService"/>
      <property name="singleResourceMultipleMethods" value="false"/>
      <property name="addResourceAndMethodIds" value="true"/>
      </bean>
      </jaxrs:providers>

      Attachments

        Activity

          People

            sergey_beryozkin Sergey Beryozkin
            ceineke Chris Eineke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: