Ticket #34 (reopened defect)

Opened 2 years ago

Last modified 1 year ago

Partial case-sensitivity to alias names on reactorFactory.createRecord()

Reported by: jfirsenbaum@… Owned by: dhughes
Type: defect Priority: normal
Milestone: Beta Component: Reactor - Reactor Factory
Version: 1.0 Severity: normal
Keywords: alias case-sensitive Cc:

Description

Reactor is partially case-sensitive to the alias used to create a new record. It should either be stricty case-sensitive or strictly not - I'd vote for not.

The problem occurs in validation while parsing the dictionary xml in the following scenario:
<object name="CreditCard">
<hasOne name="Address">
...

Calling the child address with the wrong case:
<cfset address = getReactor().createRecord('address')>
<cfset card.setAddress(address)>

Here's where the error is thrown:
<cfset card.validate()>


Here's a stack trace:

Message An error occured while Transforming an XML document.
Detail Empty expression!
Extended Info
Tag Context /usr/local/apache-tomcat-5.5.16/webapps/cfusion/reactor/core/objectTranslator.cfc (144)
/usr/local/apache-tomcat-5.5.16/webapps/cfusion/reactor/core/objectTranslator.cfc (151)
/usr/local/apache-tomcat-5.5.16/webapps/cfusion/reactor/core/objectTranslator.cfc (151)
/usr/local/apache-tomcat-5.5.16/webapps/cfusion/reactor/core/objectTranslator.cfc (100)
/usr/local/apache-tomcat-5.5.16/webapps/cfusion/reactor/core/objectFactory.cfc (201)
/usr/local/apache-tomcat-5.5.16/webapps/cfusion/reactor/reactorFactory.cfc (80)
/usr/local/apache-tomcat-5.5.16/webapps/cfusion/reactor/base/abstractRecord.cfc (332)
/usr/local/apache-tomcat-5.5.16/webapps/cfusion/reactor/project/club/Validator/AddressValidator.cfc (10)
/usr/local/apache-tomcat-5.5.16/webapps/cfusion/reactor/base/abstractRecord.cfc (83)
/usr/local/apache-tomcat-5.5.16/webapps/cfusion/reactor/base/abstractRecord.cfc (145)
/usr/local/apache-tomcat-5.5.16/webapps/cfusion/reactor/base/abstractRecord.cfc (85)

The problem occurs because the alias passed into reactorFactory.createRecord('alias') is used by the objectFactory to configure the record:

line 145: <cfset GeneratedObject = GeneratedObject.configure(getConfig(), arguments.alias, getReactorFactory(), getConvention(), metadata) />

The objectTranslator chokes on line 144 because it does a XMLSearch() on "address", not "Address"

Here's a possible fix:
at the top of objectFactory.create()
<cfset arguments.alias = getconfig().getobjectconfig(arguments.alias).object.xmlAttributes.alias>

Change History

  Changed 2 years ago by jfirsenbaum@…

Well, it turns out that the above error was not due to case sensitivity.

It has something to do with the dictionary xml files, but I'm not sure what. I'm going back and forth between development and production modes (dev is just too slow with many objects) on OS X with Tomcat/Mysql.
One file was locked and after deleting it the error went away. It happened again with another set of objects and I simply touched the dictionary file and the error went away.

Not sure what's going on here, but if anyone else sees the objectTranslator error please document it.

  Changed 2 years ago by dhughes

  • milestone set to Beta

What DBMS are you using? Oracle? PostgreSQL? Those two DBMS are case sensitive and will probably remain that way.

On the other hand, the dictionary objects rely on CF's XML functions which (at least XmlSearch) are case sensitive. I've been considering removing all usages of Xml functions but I probably won't do that for 1.0.

Please let me know if you have any more information.

  Changed 2 years ago by bbowden

  • status changed from new to closed
  • resolution set to worksforme

Closing because we can't reproduce the problem with the info provided. Please reopen if additional information (database being used, a create table script, ... etc) can be provided.

follow-up: ↓ 5   Changed 1 year ago by djokeefe

  • status changed from closed to reopened
  • resolution deleted

I am able to reproduce this and it is driving me up the wall. I am using MG and I have objects defined in reactor.xml and scaffolding in model glue. I am adding to both docs one object and scaffold at a time, and when I get to a table called "text", I get the "Empty Expression" error. I did find that my case sensitivity was incorrect in the DB. Made the changes in the DB, deleted all files from dictionary and metadata, and still get the error. Below is the create table script for the table in MSSQL 2005 as well as the corresponding dictionary file. Let me know if you need anything else.

Over the last couple of days, I have had issues where I test in between each object addition, and when one breaks it, I take it back out and rerun the app and it is still broke. Really hard to put a finger on this one, does not make sense.

in reply to: ↑ 4   Changed 1 year ago by djokeefe

Replying to djokeefe:

To give a little more information on this issue, here is what I found the issue to be with the following code, and that is I named the object the same name as the alias for the text object.

<object name="contentPackage" alias = "ContentPackages">

<hasOne name="text">

<relate from="text_UID" to="text_UID" />

</hasOne>

</object>

<object name="text" alias = "Text">

<hasOne name="contentPackage">

<relate from="text_UID" to="text_UID" />

</hasOne>

</object>

Once I changed the alias to TextBody, the scaffolding completed successfully.

However - Why does the following code not work:

<object name="content" alias = "Content">

<hasOne name="stateExcl">

<relate from="stateExcl_UID" to="stateExcl_UID" />

</hasOne>

</object>

<object name="stateExcl" alias = "StateExclusionList">

<hasOne name="content">

<relate from="stateExcl_UID" to="stateExcl_UID" />

</hasOne>

</object>

I have ensured that my case is correct in the code to match. I also tried switching the hasMany to the alias which is "StateExclusionList". I am at a loss on this one.

Dan

  Changed 1 year ago by badya

Moped Moped Dealer Moped Scooter 275 Moped Electric Moped Moped For Sale 50cc Kreidler Mofa Moped Moto Motobecane Motorino Puch Scooter Vespa Zuendapp Honda Moped Tomos Moped Used Moped 50cc Moped Gas Moped Cheap Moped Ebay Moped Motors,powersports,scooters Puch Moped Moped Part Gas Moped Scooter Moped Scooter Mini Bike Moped Girl Moped Army Yamaha Moped Scooter Moped For Sale Moped Insurance Peugeot Moped Moped Ride Electric Moped Scooter 150cc Moped Motorcycle Moped Moped Tomas Moped Motor Scooter Rental Moped Bike Moped Motor Scooter Vespa Moped Kinetic Moped Moped Tire Suzuki Moped Honda Moped Passport Motobecane Moped Cheap Moped Scooter Fun Moped 49cc Moped Kreidler Mofa Moped Moto Motobecane Motorino Puch Scooter Vespa Zuendapp Used Scooter And Moped Wholesale Moped Moped Rental Buy Moped Sachs Moped Indian Moped 250cc Moped Mini Moped Moped Hawaii Moped Store Pink Moped 50 Cc Moped Cushman Scooter Moped Moped Riding Gas Powered Moped Moped Time Her Moped Honda Express Moped Vintage Moped Garelli Moped Old Moped Moped Tank Fast Moped Moped World Moped Helmet Honda Moped Scooter Tomos Moped Part Cheap Moped For Sale Kinetic Tfr Moped Vespa Scooter Moped Moped Sales New Moped 3 Wheel Moped Honda Moped Part 1977 Moped 150cc Moped Scooter Used Moped For Sale Cheap Gas Moped 125cc Moped Allstate Moped Cheap Used Moped Moped Engine Sears Moped Ebay Moped Cheap Moped Insurance 1970s Funkey Moped Moped Phenomenom Sports Oahu Moped Rental 49cc Moped Scooter Geely Moped Girl Kreidler Mofa Moped Moto Motobecane Motorino Puch Scooter Vespa Zuendapp 50cc Moped Scooter Moped Junk Yard Sears Allstate Moped Jawa Moped Moped Law Pedal Moped Razor Moped Yamaha Scooter Moped Cushman Moped Scooter Moped And Scooter 250cc Sears Allstate Puch Moped Junk Moped Yard Moped Scooter Ebay Moped Ebay Motor 3 Moped Wheel Moped Rental Hawaii Electric Kid Mini Moped Moped Insurance Quote Insurance Moped Motorcycle Scooter Moped Insurance Uk Scooter Insurance Moped Used Tomos Moped Lx Tomos Moped Tomos Moped Scooter Moped Tomos Used Moped Scooter Tomos E Gas Moped Scooter Ton Gas Moped Powered Scooter Bike Moped Wholesale Moped Motor Bike Puch Moped Part Moped Part Scooter Performance Moped Part Yamaha Moped Part Indian Moped Part Moped Used Part Bike Mini Moped Scooter Moped Sale Scooter Moped Motor Rental Scooter Moped Scooter Used Moped Scooter Vespa Moped Scooter Yamaha Moped Motorcycle Scooter Free Moped Scooter Shipping Ebay Moped Scooter Moped Scooter Wholesale 250cc Moped Scooter Electric Kid Moped Scooter Moped Road Scooter China Moped Scooter Dealer Moped Scooter Moped Moped Scooter Chair Moped Scooter Wheel Fast Moped Scooter Moped Pic Price Scooter Moped New Scooter Moped Scooter Uk Insurance Moped Scooter China Scooter And Moped Scooter Moped New New Moped For Sale Puch Moped For Sale 150cc Moped Sale Moped For Sale In Ohio Moped Scooter Motorcycle Moped Yamaha Aerox Moped Yamaha Moped Part Yamaha Moped Yamaha Zuma Ciao Moped Vespa Scooter Moped Uk Moped And Scooter Dealer Honda Moped Site Honda Elite Moped Road Scooter Moped Moped New Moped New Sale 50cc Girl Kreidler Mofa Moped Moto Motobecane Motorino Puch Scooter Vespa Zuendapp 50cc Free Moped Shipping 4 50cc Cables Engine Moped Stroke 50cc Cheap Moped 50cc Engine Moped Moped Pedal Buy Moped Online Moped Oahu Rental Hawaii Moped Rental Key Moped Rental West Maui Moped Rental Honolulu Moped Rental Key West Moped Rental Florida Moped Law Virginia Moped Law California Moped Law Law Moped Ohio Law Moped Virginia Moped Sale Used Death Moped Ride Cable Moped Puch Speedometer Puch Moped Manual Manual Moped Puch 50cc Moped Cheap Scooter Moped Free Shipping Moped Scooter Moped Moped Vintage Moped Wholesale Moped Razor Cheap Insurance Moped
Note: See TracTickets for help on using tickets.