Atlassian uses cookies to improve your browsing experience, perform analytics and research, and conduct advertising. Accept all cookies to indicate that you agree to our use of cookies on your device. Atlassian cookies and tracking notice, (opens new window)
java.lang.StackOverflowError
at ortus.boxlang.runtime.interop.DynamicObject.unWrap(DynamicObject.java:553)
at ortus.boxlang.runtime.dynamic.casters.StringCaster.cast(StringCaster.java:131)
at ortus.boxlang.runtime.dynamic.casters.StringCaster.cast(StringCaster.java:111)
at ortus.boxlang.runtime.dynamic.casters.StringCaster.cast(StringCaster.java:99)
at ortus.boxlang.runtime.dynamic.casters.GenericCaster.cast(GenericCaster.java:141)
at ortus.boxlang.runtime.dynamic.casters.GenericCaster.cast(GenericCaster.java:124)
at ortus.boxlang.runtime.dynamic.casters.GenericCaster.attempt(GenericCaster.java:80)
at ortus.boxlang.runtime.util.ArgumentUtil.ensureArgumentType(ArgumentUtil.java:268)
at ortus.boxlang.runtime.util.ArgumentUtil.createArgumentsScope(ArgumentUtil.java:63)
at ortus.boxlang.runtime.context.FunctionBoxContext.<init>(FunctionBoxContext.java:178)
at ortus.boxlang.runtime.types.Function.generateFunctionContext(Function.java:409)
at ortus.boxlang.runtime.runnables.BoxClassSupport.dereferenceAndInvoke(BoxClassSupport.java:330)
at ortus.boxlang.runtime.runnables.BoxClassSupport.assign(BoxClassSupport.java:248)
at boxgenerated.boxclass.src.test.java.testcases.phase3.Doubleinit$cfc.assign(DoubleInit.cfc)
Activity
Show:
Brad Wood March 3, 2025 at 12:54 AM
As noted on Slack, this is because we have invoke implicit accessors defaulting to try in boxlang. this.tabs = foo is trigger this.setTabs(). And since the setTabs method has this.tabs = … inside of it, it’s endless recursion time.
Jon Clausen March 2, 2025 at 11:20 PM
Note: Removing the declared property of the same name will allow the component to instantiate.
When calling:
createObject('component', 'DoubleInit').init()
With a double init component of:
<cfcomponent displayname="DoubleInit" namespace="DoubleInit" output="no"> <cfproperty name="tabs" default="0" type="numeric" /> <cffunction name="init" access="public" output="no" returntype="any"> <cfargument name="tabs" type="numeric" required="no" default="0" /> <cfset this.tabs = arguments.tabs /> <cfreturn this> </cffunction> <cffunction name="setTabs" access="public" output="no" returntype="any"> <cfargument name="tabs" type="numeric" required="no" default="#this.tabs#" /> <cfset this.tabs = arguments.tabs /> </cffunction> </cfcomponent>
A stack overflow error will occur:
java.lang.StackOverflowError at ortus.boxlang.runtime.interop.DynamicObject.unWrap(DynamicObject.java:553) at ortus.boxlang.runtime.dynamic.casters.StringCaster.cast(StringCaster.java:131) at ortus.boxlang.runtime.dynamic.casters.StringCaster.cast(StringCaster.java:111) at ortus.boxlang.runtime.dynamic.casters.StringCaster.cast(StringCaster.java:99) at ortus.boxlang.runtime.dynamic.casters.GenericCaster.cast(GenericCaster.java:141) at ortus.boxlang.runtime.dynamic.casters.GenericCaster.cast(GenericCaster.java:124) at ortus.boxlang.runtime.dynamic.casters.GenericCaster.attempt(GenericCaster.java:80) at ortus.boxlang.runtime.util.ArgumentUtil.ensureArgumentType(ArgumentUtil.java:268) at ortus.boxlang.runtime.util.ArgumentUtil.createArgumentsScope(ArgumentUtil.java:63) at ortus.boxlang.runtime.context.FunctionBoxContext.<init>(FunctionBoxContext.java:178) at ortus.boxlang.runtime.types.Function.generateFunctionContext(Function.java:409) at ortus.boxlang.runtime.runnables.BoxClassSupport.dereferenceAndInvoke(BoxClassSupport.java:330) at ortus.boxlang.runtime.runnables.BoxClassSupport.assign(BoxClassSupport.java:248) at boxgenerated.boxclass.src.test.java.testcases.phase3.Doubleinit$cfc.assign(DoubleInit.cfc)