Details
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)