Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CFMX java conflict

Status
Not open for further replies.

strantheman

Programmer
Mar 12, 2001
333
US
I just installed CFMX, and im looking for anyone else out there using this newest version from Macromedia.

I tested an older app I developed using CF 4.5. When running on CFMX server I received the following error: "You have attempted to dereference a scalar variable of type class java.lang.String as a structure with members."

The line is within a <CFSCRIPT> tag and is

maxheight.local = 400;

All im doing here is using decimals in my naming conventions for some of my variables, and I do this a lot. This is not a structure, its just a variable and Cold Fusion has never given me trouble before, but MX thinks that im trying to reference a Java variable I guess. Im looking for a way to turn off the Java parser so I don't have to change my ways.

Thanks to anyone who can offer some insight into CFMX.

strantheman
 
Yup, I used CFMX earlier this year and found that it has become basically a java app server (they have built it on top of JRun I think), so you get alot of Java type errors and constraints. The best quick advice I can offer is to use underscores (maxheight_local) or second-word caps (maxHeightLocal) instead of dot notation - it's a good (ie fairly standard) habit to get into anyway, rather than mixing conventions.

Good luck,

Jon Daniels
 
Thx for the reply

Well that's just terrible. How did Macromedia upgrade their parser and not support older syntax as well as the new? That's just a joke. It's not like this is version 2 to version 3 where Allaire made huge changes. This is just MX, their integration into the Macromedia product line. Ben, how did you let this one slip by?

Yes, I will have to alter my variable names. I don't use that type of notation often, but i'll really be frustrated in the future when I have to use underscores.

strantheman
 
Actually, MX is more like 4.6 to 6.0 (my understanding that it was in development for some time, and 5.0 was released as a sort of interim update) and is a HUGE change (as jdaniels mentioned, MX essentially changed coldfusion from an application server to a java application, and while offering the benefits of greater java integration and deployment, also inherited the constraints that come with it)

An alternative to using underscores is to keep the . notation, but prior to assigning values create a structure:

<cfscript>
maxheight = StructNew();
maxheight.local = 400;
</cfscript>

This is assuming that you also use additional maxheight. variables (eg maxheight.var1, maxheight.var2 etc) - if not then the underscore notation jdaniels mentioned is your best bet...
 
Thanks Arion.

Yea I use structs a lot. But no, if I decide to port these apps and have to edit the files anyway ill just use underscores. I feel like im in the dark ages having to open old apps and update them. Sheesh

Makes sense about versions. Yes I recall when 5.0 it was just so Macromedia could get their name on the box :p

strantheman
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top