Status/Resolution/Reason: Closed/Fixed/
Reporter/Name(from Bugbase): Brian Ghidinelli / Brian Ghidinelli (Brian Ghidinelli)
Created: 06/22/2015
Components: General Server
Versions: 10.0
Failure Type:
Found In Build/Fixed In Build: Final /
Priority/Frequency: Normal / All users will encounter
Locale/System: English / Windows 7
Vote Count: 1
Problem Description:
Using expandPath() in OnServerStart throws an error.
Steps to Reproduce:
<cfcomponent output="false" persistent="false">
<cffunction name="OnServerStart" output="false" access="public" returntype="any">
<cflog file="application" text="#expandPath('.')#" />
</cffunction>
</cfcomponent>
Actual Result:
Throws an error. This is the dump:
Message: String index out of range: -1
StackTrace: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1955)
at coldfusion.util.Utils.expandPath(Utils.java:456)
at coldfusion.runtime.CFPage.ExpandPath(CFPage.java:3629)
at cfServer2ecfc1204757337$funcCREATEEVENTGATEWAYS.runFunction(c:\users\brian\documents\web\motorsportreg\Server.cfc:65)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472)
at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405)
at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220)
at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2655)
at cfServer2ecfc1204757337$funcONSERVERSTART.runFunction(c:\users\brian\documents\web\motorsportreg\Server.cfc:20)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472)
at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405)
at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:655)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:601)
at coldfusion.filter.ServerCFCFilter$OnSSLaunchThread.run(ServerCFCFilter.java:175)
Suppressed:
[array]
TagContext:
[array]
1) [struct]
COLUMN: 0
ID: CF_CFPAGE
LINE: 65
RAW_TRACE: at cfServer2ecfc1204757337$funcCREATEEVENTGATEWAYS.runFunction(c:\users\brian\documents\web\motorsportreg\Server.cfc:65)
TEMPLATE: c:\users\brian\documents\web\motorsportreg\Server.cfc
TYPE: CFML
2) [struct]
COLUMN: 0
ID: CF_UDFMETHOD
LINE: 20
RAW_TRACE: at cfServer2ecfc1204757337$funcONSERVERSTART.runFunction(c:\users\brian\documents\web\motorsportreg\Server.cfc:20)
TEMPLATE: c:\users\brian\documents\web\motorsportreg\Server.cfc
TYPE: CFML
Type: java.lang.StringIndexOutOfBoundsException
Expected Result:
A path name that I can work with.
Any Workarounds:
I understand that it doesn't make sense for expandPath() to be able to access mappings since applications don't exist yet, but surely we should be able to generate relatives paths to the server.cfc file?
The only possible workaround is to use getDirectoryFromPath(getCurrentTemplatePath()) and append relative paths but this is clunky.
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 4010910
External Customer Info:
External Company:
External Customer Name: Brian
External Customer Email:
External Test Config: My Hardware and Environment details:
CF10 enterprise on Windows 7. I suspect it happens elsewhere.
Attachments:
Comments: