House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  ColdFusion Talk (CF-Talk)

Possible cffile bug in ColdFusion MX

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
I should note...
Chris Kief
10/13/02 01:31 A
That's interesting.
Lee Fuller
10/13/02 01:41 A
I'm seeing this as well.
Michael Corbridge
10/13/02 07:46 A
Michael,
Chris Kief
10/13/02 04:06 P
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Chris Kief
10/13/2002 01:26 AM

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

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Chris Kief
10/13/2002 01:31 AM

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

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Lee Fuller
10/13/2002 01:41 AM

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

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Chris Kief
10/13/2002 02:00 AM

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

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Andrew Tyrone
10/13/2002 12:29 PM

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

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Michael Corbridge
10/13/2002 07:46 AM

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

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Chris Kief
10/13/2002 04:06 PM

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


<< Previous Thread Today's Threads Next Thread >>

Search cf-talk

May 24, 2012

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
     1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31     

Designer, Developer and mobile workflow conference