Help! Error! Association references unmapped class

Hey Everyone,

I’m having some issues that may or may not be directly related to ColdBox, but I would appreciate any advice or assistance anyone could offer!

When migrating an application from my working local dev environment to the production server I am encountering errors with ORM that prevent the application from loading.

We’re on CF9 (not 9.0.1) on both my local dev and production environment.

When initializing the application, if I set ormenabled to false, everything else loads.

Otherwise…

There are basically two separate errors:

“Could not find the ColdFusion component or interface” for ORM entities e.g.,. I attempted to rectify this by modifying every relationship used in the relationships to have complete paths defined even though they shouldn’t be necessary for CFCs in the same folder.

Here’s an example of the changes that were tried for every
relationship:

property name=“schedule” cfc=“Schedule” fieldtype=“one-to-one”
fetch=“join” remotingfetch=“true” fkcolumn=“scheduleID”;

was changed to:

property name=“schedule” cfc=“model.commute.Schedule” fieldtype=“one-
to-one” fetch=“join” remotingfetch=“true” fkcolumn=“scheduleID”;

As I made these changes, the aforementioned error would have a different component indicated until eventually, when this change was made across the board, I finally end up with this
error:
“Association references unmapped class”

This error doesn’t indicate any particular cfc or relationship.

I have checked my application mappings, database connectivity, permissions, etc.

All without any luck…

Anyone have any suggestions?

Thanks in advance,
Ben

Could there by a typo/compile error?

I was burned by something weird like this once: http://aarongreenlee.com/share/a-cfc-with-entity-name-could-not-be-found/

It works perfectly on my dev environment and I scrutinized every line of the entities to make sure…

I spent close to 3 hours digging around, searching, etc. all to no avail…

Thanks for the response though!

What are the differences in environment?
Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Mac vs Linux…

Same MySQL version, same ColdFusion version…

Any difference in the servlet engines in those two environments? Both JRun? Settings the same? Java versions the same on both machines?

what about case sensitivity? linux is full case sensitive while mac is forgiving.

My models are in folders and all are camelcased with uppercase letters… when referencing the full class paths, I made sure to follow the same model.

e.g., models/commute/Trip -> models.commute.Trip

I double checked permissions on the database, they check out okay.

I’m pretty much sure it’s not a code issue at this point… my CF host is looking into it too, but I’m just not confident they will make any more progress than I have…

I wonder how much Adobe charges for a single support incident… grumble grumble grumble

Sounds like either a file permission issue, or a case sensitivity issue.

If you dig into the cf logs you may be able to see done extra info that may help.

Mark

Also, if you had some kind of GIT/SVN conflict, I’ve seen that trigger similar issues before. Mark is likely right though given this is a new push.

Okay, this problem has been solved, but another related issue has cropped up. I’m sure someone can help me out on this one.

On my local machine, this worked fine as-is. In my production environment, it seems as though all fully qualified names for application classes are now prefaced with coldbox.

Despite the the files being in webroot, what is model.users.User in my local environment is now coldbox.model.users.User.

The difference in class path was what was causing the hibernate errors.

What would cause this change?

Thanks!
Ben

wow, no clue there why it would do that.

A best practice I am doing now is always creating a per app mapping to the application in the Application.cfc like this:

this.mappings["/MyApp"] = getDirectoryFromPath(getCurrentTemplatePath());

Then I preface everything with /MyApp. Seems to resolve lots of mapping issues with hibernate for me on mac and linux for some reason.

Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com