property ref error on a removed property

151 views
Skip to first unread message

Raymond Camden

unread,
Mar 10, 2010, 2:55:22 PM3/10/10
to cf-or...@googlegroups.com
I love ORM in CF, but if there is one thing that bugs the crap out of
me is the sometimes overly obscure errors. I was working with an
entity today and got an error on saving. The error simply said that
the server could not cast a value of type string to a CFCBean. It
didn't tell me which property of the CFC was throwing this issue. I
decided to simply remove most of the properties (it is a large object
with something like 30 properties) and do a quick ormReload. I thought
maybe I could narrow down the property in question and see why it was
causing a problem during the save.

When I ran my ormReload, I got:


property-ref [enterprise] not found on entity [office]

Wtf? I checked, and in my office entity, the enterprise property was
commented out. So of course it can't find the property - I removed it.
The question is - why is CF/ORM trying to use it? I can certainly see
a template that tried to run getEnterprise failing, but I'm not doing
that - I'm just calling an ormReload.

Any ideas?


--
===========================================================================
Raymond Camden, ColdFusion Jedi Master

Email : r...@camdenfamily.com
Blog : www.coldfusionjedi.com
AOL IM : cfjedimaster

Keep up to date with the community: http://www.coldfusionbloggers.org

Barney Boisvert

unread,
Mar 10, 2010, 2:58:27 PM3/10/10
to cf-or...@googlegroups.com
Is 'enterprise' the 'many' side of a one-to-many relationship, where
the other side has mappedBy='enterprise' specified?

cheers,
barneyb

> --
> You received this message because you are subscribed to the Google Groups "cf-orm-dev" group.
> To post to this group, send email to cf-or...@googlegroups.com.
> To unsubscribe from this group, send email to cf-orm-dev+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/cf-orm-dev?hl=en.
>
>

--
Barney Boisvert
bboi...@gmail.com
http://www.barneyb.com/

Raymond Camden

unread,
Mar 10, 2010, 3:02:23 PM3/10/10
to cf-or...@googlegroups.com
enterprise has no link at all to office. It is a one to one. I can see
needing the link back from enterprise and I can fix that later, but
right now office should have no link at all.

Sam Farmer

unread,
Mar 10, 2010, 3:04:20 PM3/10/10
to cf-or...@googlegroups.com
I've seen this error message before as well but I can't remember exactly what for right now.  

Are you doing anything with event handling by chance?

Cheers,

Sam

Raymond Camden

unread,
Mar 10, 2010, 3:05:12 PM3/10/10
to cf-or...@googlegroups.com
Nope, no event handling at all right now.

Henry Ho

unread,
Mar 10, 2010, 3:33:53 PM3/10/10
to cf-orm-dev
Are you using hotfix 1?

Try dropping all tables in DB manually, then call ormreload().

Henry

Raymond Camden

unread,
Mar 10, 2010, 3:37:20 PM3/10/10
to cf-or...@googlegroups.com
I can't touch the DB - not using dbupdate at all. I can try the hotfix though.

Jeremy Battle

unread,
Mar 10, 2010, 3:44:17 PM3/10/10
to cf-or...@googlegroups.com
Is restarting the CF services an option? I don't think I ever found the cause of this problem, but I am pretty sure that was my solution.

Jeremy

Raymond Camden

unread,
Mar 10, 2010, 3:47:59 PM3/10/10
to cf-or...@googlegroups.com
Restarted - nogo. Added the recent path - nogo. This is insane.

Raymond Camden

unread,
Mar 10, 2010, 3:58:27 PM3/10/10
to cf-or...@googlegroups.com
FYI, here is the stack trace. Maybe it will mean something to somebody....

org.hibernate.MappingException: property-ref [enterprise] not found on
entity [office]
at org.hibernate.mapping.PersistentClass.getReferencedProperty(PersistentClass.java:362)
at org.hibernate.mapping.ManyToOne.createPropertyRefConstraints(ManyToOne.java:70)
at org.hibernate.cfg.HbmBinder$ManyToOneSecondPass.doSecondPass(HbmBinder.java:2733)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1163)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1319)
at coldfusion.orm.hibernate.HibernateConfiguration.buildSessionFactory(HibernateConfiguration.java:458)
at coldfusion.orm.hibernate.HibernateProvider.InitializeORMForApplication(HibernateProvider.java:188)
at coldfusion.orm.hibernate.HibernateProvider.beforeApplicationStart(HibernateProvider.java:85)
at coldfusion.filter.ApplicationFilter.fireBeforeAppStartEvent(ApplicationFilter.java:475)
at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:221)
at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
at coldfusion.filter.PathFilter.invoke(PathFilter.java:87)
at coldfusion.filter.LicenseFilter.invoke(LicenseFilter.java:27)
at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70)
at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46)
at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:53)
at coldfusion.CfmServlet.service(CfmServlet.java:200)
at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)
at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)
at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
at jrun.servlet.FilterChain.service(FilterChain.java:101)
at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:286)
at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543)
at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203)
at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
Caused by: org.hibernate.MappingException: property [enterprise] not
found on entity [office]
at org.hibernate.mapping.PersistentClass.getRecursiveProperty(PersistentClass.java:419)
at org.hibernate.mapping.PersistentClass.getReferencedProperty(PersistentClass.java:359)
... 33 more

--

Devin Holloway

unread,
Mar 10, 2010, 3:58:25 PM3/10/10
to cf-or...@googlegroups.com
You don't happen to have "saveMappings" turned on, do ya?




Return-Path: <3ggwyswcjcmsaljvmnwpvjru.lx...@groups.bounces.google.com>
Received: from mail-yx0-f170.google.com (mail-yx0-f170.google.com [209.85.210.170]) by maila3.webcontrolcenter.com with SMTP;
Wed, 10 Mar 2010 13:48:02 -0700
Received: by yxe42 with SMTP id 42sf6080742yxe.25
for <de...@shinynet.com>; Wed, 10 Mar 2010 12:48:02 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=googlegroups.com; s=beta;
h=domainkey-signature:received:x-beenthere:received:received:received
:received:received-spf:received:mime-version:received:reply-to
:in-reply-to:references:date:message-id:subject:from:to
:x-original-authentication-results:x-original-sender:precedence
:mailing-list:list-id:list-post:list-help:list-archive:x-thread-url
:x-message-url:sender:list-subscribe:list-unsubscribe:content-type;
bh=U3nN6tjuqI33mzPbCG8r7tXENRPQ3h014NSvFBiW/S0=;
b=3CM2g4bKcC4BuiF7O2Nu3qrb5qV2uOtATQpZO9Og0ZVSs+sj98ZBoyDIHDRX/bCHq5
d3aa/pHRpxouDk1rAdbXUOCX+Fk7bqVecClkvrjBi6Hvht33jwfZdul2JDGfS1mJqlu5
HUiGY2pHGLX5qY7xEFF/rvsN5E2u3wOrOAqMA=
DomainKey-Signature: a=rsa-sha1; c=nofws;
d=googlegroups.com; s=beta;
h=x-beenthere:received-spf:mime-version:reply-to:in-reply-to
:references:date:message-id:subject:from:to
:x-original-authentication-results:x-original-sender:precedence
:mailing-list:list-id:list-post:list-help:list-archive:x-thread-url
:x-message-url:sender:list-subscribe:list-unsubscribe:content-type;
b=xvAjlVKUb8QfLGOliK3sIQVJxXucKY78bixYneRO/wjtr9b2VWMhy43kJP5zqRlIbx
b772bA56O+pKUJAwKRJcRsvpnTTwhcjK/Ms3Rw11XNnAfTbrW7B2Tlhbpq1cs+MD2d2k
WRtLJkZSprQ/p4sSFZ9rtl8q+rjbgvAa48lwg=
Received: by 10.100.230.17 with SMTP id c17mr65184anh.61.1268254082157;
Wed, 10 Mar 2010 12:48:02 -0800 (PST)
X-BeenThere: cf-or...@googlegroups.com
Received: by 10.90.41.34 with SMTP id o34ls1378201ago.2.p; Wed, 10 Mar 2010
12:48:01 -0800 (PST)
Received: by 10.90.37.22 with SMTP id k22mr2256085agk.0.1268254081501;
Wed, 10 Mar 2010 12:48:01 -0800 (PST)
Received: by 10.90.37.22 with SMTP id k22mr2256080agk.0.1268254081292;
Wed, 10 Mar 2010 12:48:01 -0800 (PST)
Return-Path: <rca...@gmail.com>
Received: from mail-gy0-f180.google.com (mail-gy0-f180.google.com [209.85.160.180])
by gmr-mx.google.com with ESMTP id 19si419060yxe.3.2010.03.10.12.48.00;
Wed, 10 Mar 2010 12:48:00 -0800 (PST)
Received-SPF: pass (google.com: domain of rca...@gmail.com designates 209.85.160.180 as permitted sender) client-ip=209.85.160.180;
Received: by mail-gy0-f180.google.com with SMTP id 8so93011gyg.11
for <cf-or...@googlegroups.com>; Wed, 10 Mar 2010 12:48:00 -0800 (PST)
MIME-Version: 1.0
Received: by 10.90.16.33 with SMTP id 33mr2173070agp.91.1268254079772; Wed, 10
Mar 2010 12:47:59 -0800 (PST)
Reply-To: cf-or...@googlegroups.com
In-Reply-To: <b07427e91003101244p6f5...@mail.gmail.com>
References: <46600ac11003101155w296...@mail.gmail.com>
<e132d2f41003101204s2d1...@mail.gmail.com>
<46600ac11003101205u7b3...@mail.gmail.com>
<9f2a1dd6-6d1b-404a...@l12g2000prg.googlegroups.com>
<46600ac11003101237j26b...@mail.gmail.com>
<b07427e91003101244p6f5...@mail.gmail.com>
Date: Wed, 10 Mar 2010 14:47:59 -0600
Message-ID: <46600ac11003101247s760...@mail.gmail.com>
Subject: Re: [cf-orm-dev] Re: property ref error on a removed property
From: Raymond Camden <rca...@gmail.com>
To: cf-or...@googlegroups.com
X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com:
domain of rca...@gmail.com designates 209.85.160.180 as permitted sender)
smtp.mail=rca...@gmail.com; dkim=pass (test mode) header.i=@gmail.com
X-Original-Sender: rca...@gmail.com
Precedence: list
Mailing-list: list cf-or...@googlegroups.com; contact cf-orm-d...@googlegroups.com
List-ID: <cf-orm-dev.googlegroups.com>
List-Post: <http://groups.google.com/group/cf-orm-dev/post?hl=en_US>,
<mailto:cf-or...@googlegroups.com>
List-Help: <http://groups.google.com/support/?hl=en_US>, <mailto:cf-orm-...@googlegroups.com>
List-Archive: <http://groups.google.com/group/cf-orm-dev?hl=en_US>
X-Thread-Url: http://groups.google.com/group/cf-orm-dev/t/8ac12e6a942b8c9d
X-Message-Url: http://groups.google.com/group/cf-orm-dev/msg/e0216beb96ac4242
Sender: cf-or...@googlegroups.com
List-Subscribe: <http://groups.google.com/group/cf-orm-dev/subscribe?hl=en_US>,
<mailto:cf-orm-dev...@googlegroups.com>
List-Unsubscribe: <http://groups.google.com/group/cf-orm-dev/subscribe?hl=en_US>,
<mailto:cf-orm-dev+...@googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1
X-Rcpt-To: <de...@shinynet.com>
X-SmarterMail-Spam: Commtouch 0 [value: Unknown], SPF_Pass, DK_Pass, DKIM_Pass
X-CTCH-RefId: str=0001.0A090205.4B9805A6.01FD,ss=1,fgs=0
X-SmarterMail-TotalSpamWeight: -20


Restarted - nogo. Added the recent path - nogo. This is insane.

On Wed, Mar 10, 2010 at 2:44 PM, Jeremy Battle <batt...@gmail.com> wrote:
> Is restarting the CF services an option? I don't think I ever found the
> cause of this problem, but I am pretty sure that was my solution.
> Jeremy
>
> On Wed, Mar 10, 2010 at 3:37 PM, Raymond Camden <rca...@gmail.com> wrote:
>>
>> I can't touch the DB - not using dbupdate at all. I can try the hotfix
>> though.
>>

--

Raymond Camden

unread,
Mar 10, 2010, 3:59:52 PM3/10/10
to cf-or...@googlegroups.com
On Wed, Mar 10, 2010 at 2:58 PM, Devin Holloway <de...@shinynet.com> wrote:
> You don't happen to have "saveMappings" turned on, do ya?

Nope.

This is all I've got:

<cfset this.ormSettings = {
logsql="true",
cfclocation="model"
}>

Barney Boisvert

unread,
Mar 10, 2010, 4:11:59 PM3/10/10
to cf-or...@googlegroups.com
You're REALLY sure you don't have something somewhere with
mappedBy="enterprise"? Because that stack trace corroborates my
original suspicion.

cheers,
barneyb

> --
> You received this message because you are subscribed to the Google Groups "cf-orm-dev" group.
> To post to this group, send email to cf-or...@googlegroups.com.
> To unsubscribe from this group, send email to cf-orm-dev+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/cf-orm-dev?hl=en.
>
>

--

Raymond Camden

unread,
Mar 10, 2010, 4:16:38 PM3/10/10
to cf-or...@googlegroups.com
Bam - just found it - and you were right. There was another entity
using the mapped by.

-sigh-

Sorry for the wild goose case all.

Of course, and maybe this is crazy talk, but, wouldn't it have been
nice if the error aid, "Hey, the file, x.cfc, is trying to reference
enterprise within office." I mean seriously, why not just say the
CFC/entity that is trying to use the bad relationship?

--

Jeremy Battle

unread,
Mar 10, 2010, 4:26:12 PM3/10/10
to cf-or...@googlegroups.com
I think we would all agree that more descriptive error messages in ORM would be great. I am going to start keeping a log of issues like these so I can just have an error reference when I come across a lovely ambiguous ORM error. Great call on this one Barney!

Jeremy 

Raymond Camden

unread,
Mar 10, 2010, 4:30:29 PM3/10/10
to cf-or...@googlegroups.com
Well, if you want more, don't forget my original error, the String
can't be cast to CFCBeanProxy.

Obviously one property is wrong.

Which one? I have no idea.

Peter Bell

unread,
Mar 10, 2010, 4:31:40 PM3/10/10
to cf-or...@googlegroups.com
Hi All,

Apologies if this it OT, although it relates to ORM on a type of CF, and I'm hoping it'll be of value to the community . . . I was wondering if anyone has got any cf9 ORM apps you'd like to try out on Railo? We're looking for some sample code that's working on CF9 so we can make sure we're covering all of the core use cases.

If you've got any interest, please drop me a line and we'll put together a beta testing group for anyone interested.

Best Wishes,
Peter

Jeremy Battle

unread,
Mar 10, 2010, 4:37:43 PM3/10/10
to cf-or...@googlegroups.com
I got that error the other day, I believe I was doing something like this:

<cfset listing.setRentalType(1) />

when I was supposed to be doing:

<cfset listing.setRentalType(EntityLoadByPK("RentalType",1) />

Nando

unread,
Mar 11, 2010, 3:20:54 AM3/11/10
to cf-or...@googlegroups.com
Ray,

I completely agree that the error messages can be obtuse. I just submitted the following enhancement request on Adobe.com. I can never find the URL easily, so here it is in case anyone else wants to do the same:


"More descriptive, precise error messages when attempting to use the ORM features would be very helpful to debug mistakes made, especially when defining properties of an entity that is persisted using hibernate. Something else that would be very helpful in this regard would be a tool that helps the developer properly define the relationships between entities, something similar to the tools that write SQL and SQL joins from a visual interface."

Nando

--
You received this message because you are subscribed to the Google Groups "cf-orm-dev" group.
To post to this group, send email to cf-or...@googlegroups.com.
To unsubscribe from this group, send email to cf-orm-dev+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cf-orm-dev?hl=en.




--
Nando M. Breiter
The CarbonZero Project
CP 234
6934 Bioggio
Switzerland

+41 91 606 6372

na...@carbonzero.ch
www.carbonzero.ch

Raymond Camden

unread,
Mar 11, 2010, 9:17:11 AM3/11/10
to cf-or...@googlegroups.com
Actually, that isn't the best place now. Why didn't you use the public
bug tracker?

http://cfbugs.adobe.com/cfbugreport/flexbugui/cfbugtracker/main.html#

Nando

unread,
Mar 11, 2010, 10:57:14 AM3/11/10
to cf-or...@googlegroups.com
Cuz I didn't know about it? Submitted as 82409 in a bit more thoughtful form. Please vote for it if you have trouble defining properties or relationships properly and would like better documentation and more precise error messages in this regard.

Raymond Camden

unread,
Mar 11, 2010, 2:03:18 PM3/11/10
to cf-or...@googlegroups.com
Voted - thanks for writing it up!
Reply all
Reply to author
Forward
0 new messages