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

wsdl2java RandomValueProvider gives StackOverflowException on bidirectional reference

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.1.2, 2.2
    • 2.1.8, 2.2.5
    • Tooling
    • None
    • Windows XP, Sun JDK 1.5, CXF 2.1.2 or 2.2-SNAPSHOT

    Description

      ValueObject A has getB() and ValueObject B has getA(). This is a very common pattern in ORM. Running wsdl2java with -defaultValues=org.apache.cxf.tools.wsdlto.core.RandomValueProvider causes a StackOverflowException in both current release 2.1.2 and 2.2-SNAPSHOT as of 9/23/08. Attached sample project (wsdl and wsdl2java with parameters) reproduces this.

      org.apache.cxf.tools.common.ToolException: Velocity engine write errors
      at org.apache.cxf.tools.common.VelocityGenerator.doWrite(VelocityGenerator.java:107)
      at org.apache.cxf.tools.wsdlto.core.AbstractGenerator.doWrite(AbstractGenerator.java:51)
      at org.apache.cxf.tools.wsdlto.frontend.jaxws.generators.ImplGenerator.generate(ImplGenerator.java:104)
      at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:209)
      at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:238)
      at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:83)
      at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:103)
      at org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:173)
      Caused by: org.apache.velocity.exception.MethodInvocationException: Invocation of method 'writeDefaultValue' in class org.apache.cxf.tools.common.model.JavaReturn threw exception java.lang.StackOverflowError @ org/apache/cxf/tools/wsdlto/frontend/jaxws/template/impl.vm[82,29]
      at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:300)
      Caused by: java.lang.StackOverflowError
      at java.util.regex.Pattern.atom(Unknown Source)
      at java.util.regex.Pattern.sequence(Unknown Source)
      at java.util.regex.Pattern.expr(Unknown Source)
      at java.util.regex.Pattern.compile(Unknown Source)
      at java.util.regex.Pattern.<init>(Unknown Source)
      at java.util.regex.Pattern.compile(Unknown Source)
      at java.lang.String.replaceAll(Unknown Source)
      at org.apache.cxf.tools.common.VelocityWriter.write(VelocityWriter.java:60)
      at org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBDataBinding$JAXBDefaultValueWriter.fillInFields(JAXBDataBinding.java:630)
      at org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBDataBinding$JAXBDefaultValueWriter.writeDefaultValue(JAXBDataBinding.java:548)
      at org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBDataBinding$JAXBDefaultValueWriter.fillInFields(JAXBDataBinding.java:616)
      at org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBDataBinding$JAXBDefaultValueWriter.writeDefaultValue(JAXBDataBinding.java:548)

      Attachments

        1. CXFWsdl2StackOverflow.zip
          8 kB
          Bob Fields

        Activity

          People

            dkulp Daniel Kulp
            bob fields Bob Fields
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: