Recent Posts

Documents in this folder are not available – folder name causes error with webDAV access

This may be one of those things where I am the real cause of this error is totally unrealted to how I perceive the problem, but right now it seems like the folder name ‘bin’ causes problems with webDAV folders.

With a virtual folder on an IIS server that uses webdav, if you create a folder called ‘bin’ you get the following error when trying to access the folder or modify.

'Documents in this folder are not available. The folder may have been moved or deleted, or network problems may be preventing a connection to the server. There is a problem with the webserver. Please try again later or contact the server administrator.'

Many other folder names worked fine. May be related to the following issue:

http://kbalertz.com/895248/receive-folder-error-message-folder-hosted-Internet-Information-Services.aspx

Throw errors in a cfscript and try catch in cfscript

You CAN’T throw an error or errors from a cfscript without defining your own throw function. But this is pretty easy to do. Somewhere else in your code, just write a <cfunction name=”throw” etc. and in this function just put a <cfthrow tag that throws the error you want to be thrown. A good practice would be to include a throw function in a utility cfc that you could invoke wherever you needed to throw an error in a cfscript.

See the example code below. Note the interesting syntax for catching in a cfscript where you do catch(ERRORTYPE CFCATCHVARIABLE). So catch(database e), catch(any e) would be some common ones. And then you could access e.Message, e.Detail, etc.

try
{
//nothing below the throw would execute in this example.
//But I left the rest for syntax reference.
somethingWrong=true;
if(somethingWrong){
throw("ExampleErrorType","Example Error message.");
}
//save the reactor record without interfering with custom transaction
template1.save(useTransaction=false);
}
catch (database err)
{
//if the save fails and the error is a database error, return the error detail.
//otherwise this error will need to be caught by the code calling this code.
return err.Detail;
}

If you want to do a rethrow, the following article has a great example.
http://www.coldfusionjedi.com/index.cfm?mode=entry&entry=3089633C-9FA0-606B-3F540AE9642A795F

Coldspring init error – An error occured while Parsing an XML document.:Content is not allowed in prolog.

An error occured while Parsing an XML document.:Content is not allowed in prolog.

This mean coldspring cannot find the xml of an expandPath(), or a config argument. On the init of a bean, the line in the init of the cfc was

the arguemtns.environmentXML came from the xml coldspring config,


/environment/thecompany/settings.xml

My mappings on the server to the path were wrong.

C:\HOMEDEV\RESOURCES\localEnvironment\heritagemakers
should have been
C:\HOMEDEV\RESOURCES\localEnvironment

Coldspring error – Error Loading: bean_, The cause of this exception was: java.io.FileNotFoundException

Error Loading: bean_C15CD3571617EEF37B66D49B00F832B8, The cause of this exception was: java.io.FileNotFoundException: D:\HM\Branches\RanaRana\Coldspring\aop\framework\tmp\bean_C15CD3571617EEF37B66D49B00F832B8.cfc (The system cannot find the path specified).

Weird. You have to manually create the tmp folder under yourColspringInstall\aop\framework

Flex error 1105: Target of assignment must be a reference value.

From Adobe “You can assign a value to a variable, but you cannot assign a value to another value”. For me this happened when the ObjectProxy was not editable, but the object property on it was.

What does this mean? What is the difference between a value and a variable?

So it is pretty intuitive that a variable is a dynamic property that can change. But a value – what is that? Apparently a value is something that CANNOT CHANGE. So a read-only property, or something. So this error happens when you try and say something equivalent to 2=3. Make sure the thing on the left side of your assignment is allowed to change.

See http://curtismorley.com/2008/02/15/flex-2-flash-cs3-actionscript-error-1105 for a good theoretical example. The problem is that this error is triggered in situations where it wouldn’t seem like things you are assigning values to are read-only or un-changeable. But I think the bottom line is, if you get an 1105 error, you can assume that the thing on the left side of your assignment DOESN’T allow you to change it.

For me this happened because I wrapped an object in an object proxy, and then tried to set the value of the object proxy to the CreditVO (a custom Value Object based on a Remote class), instead of setting the object contained in the ObjectProxy (a variable) to the CreditVO. So the ObjectProxy itself was not editable, but the object property on it was.

“1105 Target of assignment must be a reference value. Description – You can assign a value to a variable, but you cannot assign a value to another value.”


//Simplified
myObjectProxy = theCredit;
//Mine 
model.creditSearchResult.getItemAt(opener.creditSearchResultGrid.selectedIndex) = theCredit;

Should be:


//Simplified
myObjectProxy.<span style="color:red">object</span> = theCredit;
//Mine
model.creditSearchResult.getItemAt(opener.creditSearchResultGrid.selectedIndex).<span style="color:red">object</span>= theCredit;

Coldfusion database error resolutions log

“Unable to invoke CFC – [Macromedia][SQLServer JDBC Driver][SQLServer]The multi-part identifier “yourvariable” could not be bound.”
Your not putting pound signs around a variable name

<!--- WRONG --->
SET @newOtherID = arguments.newUserID;
<!--- RIGHT--->
SET @newOtherID = #arguments.newUserID#;

faultString “Unable to invoke CFC – [Macromedia][SQLServer JDBC Driver][SQLServer]Incorrect syntax near ‘yourfirstfewcharactersofaguid’.
Your not putting your GUID in quotes

<!--- WRONG --->
SET @userguid = #arguments.newUserID#;
<!--- RIGHT--->
SET @userguid = '#arguments.newUserID#';

Get the domain entered from the request. Coldfusion CGI.HTTP_HOST

Use CGI.HTTP_HOST

Issue: mydomain.com gets load-balanced and uses multiple servers. CGI.SERVER_NAME will not return ‘mydomain’ but will return ‘sever1’ or ‘server2’ etc.

I want to check the request URL, and if it does not include www, re-locate to www.mydomain/pagerequested?event=eventrequested

<!--- Redirect to the site that corresponds to the securehost --->
<cfset secureurl="xmlParse(expandPath("/mydevenvironment/settings.xml"))." settings.securehost.xmltext="">
<cfloop collection="#CGI#" item="field">
<cfoutput>#field#: #CGI[field]#
</cfoutput>
</cfloop>
<cfif not="" refind("www\.",="" cgi.http_host)="">
<!--- If a secure request, keep the https, otherwise just go to http--->
<cfif cgi.https="" eq="" "on"="">
<cfset theurlbase="secureurl">
<cfelse>
<cfset theurlbase="REREplace(secureurl,"https:","http:")/">
</cfset></cfelse></cfset></cfif>
<cfoutput>#theURLBase#</cfoutput>
<cflocation url="#theURLBase##CGI.SCRIPT_NAME#?#CGI.QUERY_STRING#" addtoken="false">
</cflocation></cfif>
</cfset>

Line break in Flex or Actionscript 3 text

Displaying a newline in a UI component in flex was a bit tricky.

The following would not work:

somevar:String = “Here is line 1 text \n followed by line 2 text”;

 

The following worked in my situation.

somevar:String = ‘Here is line 1 text’ + ‘\n’ + ‘followed by line 2 text’;

If all else fails you can use a more explicit directive, i.e. use {‘\n’} intead of \n

http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&productId=2&postId=9223