|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
Possible cffile bug in ColdFusion MX
This may be a simple error on my part or a bug in CFMX:Chris Kief 10/13/02 01:26 A I should note...Chris Kief 10/13/02 01:31 A That's interesting.Lee Fuller 10/13/02 01:41 A Thanks for the response Lee. I'm glad I'm not the only one who is seeingChris Kief 10/13/02 02:00 A I figured out a way around this problem, using the JavaCast() function:Andrew Tyrone 10/13/02 12:29 P I'm seeing this as well.Michael Corbridge 10/13/02 07:46 A Michael,Chris Kief 10/13/02 04:06 P This may be a simple error on my part or a bug in CFMX: The following code simply creates a variable with the value of 2 and writes it to a file...this works fine: <cfset myVar = 2 /> <cffile action="write" file="#filePath#" output="#myVar#" addnewline="no" /> The follwing code creates the same variable, adds 1 to it, and writes the the result to a file...this DOESN'T work: <cfset myVar = 2 /> <cfset myOtherVar = myVar + 1 /> <cffile action="write" file="#filePath#" output="#myOtherVar#" addnewline="no" /> This code fails with the following error: Error casting an object of type java.lang.Double to an incompatible type. This usually indicates a programming error in Java, although it could also mean you have tried to use a foreign object in a different way than it was designed. java.lang.Double Any insights in to what this may be?? TIA, chris I should note... Including ANY additional text in output="" along with the variable will cause cffile to work as expected. (i.e. output="X#myOtherVar#") chris This may be a simple error on my part or a bug in CFMX: The following code simply creates a variable with the value of 2 and writes it to a file...this works fine: <cfset myVar = 2 /> <cffile action="write" file="#filePath#" output="#myVar#" addnewline="no" /> The follwing code creates the same variable, adds 1 to it, and writes the the result to a file...this DOESN'T work: <cfset myVar = 2 /> <cfset myOtherVar = myVar + 1 /> <cffile action="write" file="#filePath#" output="#myOtherVar#" addnewline="no" /> This code fails with the following error: Error casting an object of type java.lang.Double to an incompatible type. This usually indicates a programming error in Java, although it could also mean you have tried to use a foreign object in a different way than it was designed. java.lang.Double Any insights in to what this may be?? TIA, chris That's interesting. Almost as if it's reverse type casting. Odd. Don't have the answer. But it's truly odd. | -----Original Message----- | | Sent: Saturday, October 12, 2002 10:30 PM | To: CF-Talk | Subject: RE: Possible cffile bug in CFMX | | | I should note... | | Including ANY additional text in output="" along with the | variable will cause cffile to work as expected. (i.e. | output="X#myOtherVar#") | | chris | | | | -----Original Message----- | | Sent: Saturday, October 12, 2002 10:26 PM | To: CF-Talk | Subject: Possible cffile bug in CFMX | | This may be a simple error on my part or a bug in CFMX: | | The following code simply creates a variable with the value | of 2 and writes it to a file...this works fine: | | <cfset myVar = 2 /> | | <cffile action="write" file="#filePath#" output="#myVar#" | addnewline="no" /> | | | | The follwing code creates the same variable, adds 1 to it, | and writes the the result to a file...this DOESN'T work: | | <cfset myVar = 2 /> | | <cfset myOtherVar = myVar + 1 /> | | <cffile action="write" file="#filePath#" | output="#myOtherVar#" addnewline="no" /> | | | | This code fails with the following error: | | Error casting an object of type java.lang.Double to an | incompatible type. This usually indicates a programming error | in Java, although it could also mean you have tried to use a | foreign object in a different way than it was designed. | java.lang.Double | | Any insights in to what this may be?? | | TIA, | chris | | | | Thanks for the response Lee. I'm glad I'm not the only one who is seeing this. I tried the following as a workaround and cffile worked as expected: <cfscript> // create myVar myVar = 1; // add 1 to myVar myOtherVar = myVar + 1; // java casting error workaround // this will force CF to cast myOtherVar back into a string myOtherVar = "x#myOtherVar#"; myOtherVar = replace(myOtherVar,"x","","all"); </cfscript> chris That's interesting. Almost as if it's reverse type casting. Odd. Don't have the answer. But it's truly odd. | -----Original Message----- | | Sent: Saturday, October 12, 2002 10:30 PM | To: CF-Talk | Subject: RE: Possible cffile bug in CFMX | | | I should note... | | Including ANY additional text in output="" along with the | variable will cause cffile to work as expected. (i.e. | output="X#myOtherVar#") | | chris | | | | -----Original Message----- | | Sent: Saturday, October 12, 2002 10:26 PM | To: CF-Talk | Subject: Possible cffile bug in CFMX | | This may be a simple error on my part or a bug in CFMX: | | The following code simply creates a variable with the value | of 2 and writes it to a file...this works fine: | | <cfset myVar = 2 /> | | <cffile action="write" file="#filePath#" output="#myVar#" | addnewline="no" /> | | | | The follwing code creates the same variable, adds 1 to it, | and writes the the result to a file...this DOESN'T work: | | <cfset myVar = 2 /> | | <cfset myOtherVar = myVar + 1 /> | | <cffile action="write" file="#filePath#" | output="#myOtherVar#" addnewline="no" /> | | | | This code fails with the following error: | | Error casting an object of type java.lang.Double to an | incompatible type. This usually indicates a programming error | in Java, although it could also mean you have tried to use a | foreign object in a different way than it was designed. | java.lang.Double | | Any insights in to what this may be?? | | TIA, | chris | | | | I figured out a way around this problem, using the JavaCast() function: <cfset myVar = 2 /> <cfset myOtherVar = JavaCast("string",myVar + 1) /> <cffile action="write" file="#filePath#" output="#myOtherVar#" addnewline="no" /> andy ----- Excess quoted text cut - see Original Post for more ----- I'm seeing this as well. I'll enter a bug. Here is another workaround ... -------------------------------------------- <cfset myVar = 2> <cfset myOtherVar = toString(myVar + 1)> <cffile action="write" file="#expandPath("cffileBug.txt")#" output="#myOtherVar#" addnewline="no"> michael d corbridge macromedia 617.219.2307 mcorbridge@macromedia.com Thanks for the response Lee. I'm glad I'm not the only one who is seeing this. I tried the following as a workaround and cffile worked as expected: <cfscript> // create myVar myVar = 1; // add 1 to myVar myOtherVar = myVar + 1; // java casting error workaround // this will force CF to cast myOtherVar back into a string myOtherVar = "x#myOtherVar#"; myOtherVar = replace(myOtherVar,"x","","all"); </cfscript> chris That's interesting. Almost as if it's reverse type casting. Odd. Don't have the answer. But it's truly odd. | -----Original Message----- | | Sent: Saturday, October 12, 2002 10:30 PM | To: CF-Talk | Subject: RE: Possible cffile bug in CFMX | | | I should note... | | Including ANY additional text in output="" along with the | variable will cause cffile to work as expected. (i.e. | output="X#myOtherVar#") | | chris | | | | -----Original Message----- | | Sent: Saturday, October 12, 2002 10:26 PM | To: CF-Talk | Subject: Possible cffile bug in CFMX | | This may be a simple error on my part or a bug in CFMX: | | The following code simply creates a variable with the value | of 2 and writes it to a file...this works fine: | | <cfset myVar = 2 /> | | <cffile action="write" file="#filePath#" output="#myVar#" | addnewline="no" /> | | | | The follwing code creates the same variable, adds 1 to it, | and writes the the result to a file...this DOESN'T work: | | <cfset myVar = 2 /> | | <cfset myOtherVar = myVar + 1 /> | | <cffile action="write" file="#filePath#" | output="#myOtherVar#" addnewline="no" /> | | | | This code fails with the following error: | | Error casting an object of type java.lang.Double to an | incompatible type. This usually indicates a programming error | in Java, although it could also mean you have tried to use a | foreign object in a different way than it was designed. | java.lang.Double | | Any insights in to what this may be?? | | TIA, | chris | | | | Michael, I appreciate your quick response to this matter and thanks for pointing out the good old toString() function. :) Regards, Chris I'm seeing this as well. I'll enter a bug. Here is another workaround ... -------------------------------------------- <cfset myVar = 2> <cfset myOtherVar = toString(myVar + 1)> <cffile action="write" file="#expandPath("cffileBug.txt")#" output="#myOtherVar#" addnewline="no"> michael d corbridge macromedia 617.219.2307 mcorbridge@macromedia.com Thanks for the response Lee. I'm glad I'm not the only one who is seeing this. I tried the following as a workaround and cffile worked as expected: <cfscript> // create myVar myVar = 1; // add 1 to myVar myOtherVar = myVar + 1; // java casting error workaround // this will force CF to cast myOtherVar back into a string myOtherVar = "x#myOtherVar#"; myOtherVar = replace(myOtherVar,"x","","all"); </cfscript> chris That's interesting. Almost as if it's reverse type casting. Odd. Don't have the answer. But it's truly odd. | -----Original Message----- | | Sent: Saturday, October 12, 2002 10:30 PM | To: CF-Talk | Subject: RE: Possible cffile bug in CFMX | | | I should note... | | Including ANY additional text in output="" along with the | variable will cause cffile to work as expected. (i.e. | output="X#myOtherVar#") | | chris | | | | -----Original Message----- | | Sent: Saturday, October 12, 2002 10:26 PM | To: CF-Talk | Subject: Possible cffile bug in CFMX | | This may be a simple error on my part or a bug in CFMX: | | The following code simply creates a variable with the value | of 2 and writes it to a file...this works fine: | | <cfset myVar = 2 /> | | <cffile action="write" file="#filePath#" output="#myVar#" | addnewline="no" /> | | | | The follwing code creates the same variable, adds 1 to it, | and writes the the result to a file...this DOESN'T work: | | <cfset myVar = 2 /> | | <cfset myOtherVar = myVar + 1 /> | | <cffile action="write" file="#filePath#" | output="#myOtherVar#" addnewline="no" /> | | | | This code fails with the following error: | | Error casting an object of type java.lang.Double to an | incompatible type. This usually indicates a programming error | in Java, although it could also mean you have tried to use a | foreign object in a different way than it was designed. | java.lang.Double | | Any insights in to what this may be?? | | TIA, | chris | | | |
|
May 24, 2012
|
Latest Fusion Authority Articles
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||