The Dev Pages

A knowledge base for web applications development (and beyond)

Archive for June, 2008




ALTER TABLE Project DROP FOREIGN KEY FK_Project_Template;
GO

SHOULD BE

ALTER TABLE Project DROP CONSTRAINT FK_Project_Template;
GO




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




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




You’re trying to get the substring of a number, or something else, maybe undefined.

trimAll(document.getElementById(“email”).value.length)

should be

trimAll(document.getElementById(“email”)).value.length




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.”

Should be:

Coldfusion database error resolutions log


Posted on June - 19 - 2008



“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


SET @newOtherID = arguments.newUserID;

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


SET @userguid = #arguments.newUserID#;

SET @userguid = '#arguments.newUserID#';




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




#field#: #CGI[field]#









#theURLBase#


Line break in Flex or Actionscript 3 text


Posted on June - 12 - 2008



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

dynamic variable names


Posted on June - 11 - 2008



//note, in cf documentation – You can combine text and variable names to construct a variable name on the left side of an =
//To construct a variable name this way, all the text on the left side of the equal sign must be in quotation marks.
//The left side of an assignment can’t be a function (So Evaluate wouldn’t work’)

“local.criteria.#local.keysToStruct[local.i]#”=Evaluate(“arguments.criteria.” & #local.keysToStruct[local.i]#);
break;




Note: To set up webDAV, here is a good article (If your using IIS 5.0 it is most likely already up and running):
http://www.windowsnetworking.com/articles_tutorials/WebDAV-IIS.html

The following article was good, but I thought it would be better to just use multiple virtual directories rather than multiple IIS sites.

http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_19095

What I did:
1)make a virtual directory imagesUploads that requires SSL and windows authentication and points to the uploads/images folder on the server. Allow write/modify/etc. in IIS.
2)make a virtual directory images, which points to the same uploads/images folder, but does not require SSL or windows login, just anonymous user read access in IIS.
3)On the uploads/images physical folder, give the upload users all the write/modify access they may need. Give the IUSR anonymous internet user account read only rights.
4)Users upload using webDAV and the URL yourdomain.com/imagesUploads, but your stuff will all point yourdomain.com/images

The retarded thing is, that is a user tries to access the non-ssl upload site, windows will still prompt for a login, and will deny them no-matter what, because it is not SSL. but I wonder if the uname/pw text is being sent, because that would make network sniffers pickup the credentials.