[undefined array element] illegal access to loading collection

135 views
Skip to first unread message

ttyson

unread,
Jun 23, 2011, 12:06:37 PM6/23/11
to cf-orm-dev
I have a problem similar to one that was posted earlier but with no
resolution.

I'm working on an application that has a many-to-many relationship
between two tables that uses a registration form to populate both
tables. My tables are BootCampSessions and BootCampSessionGroups.
The form presents the data initially, but when I try to complete the
form I get the error "[undefined array element] illegal access to
loading collection".

I have an admin area where I use CRUD functions and it works there,
but in my registration form when I click Submit I get the following
error:

illegal access to loading collection

ColdFusion cannot determine the line of the template that caused this
error. This is often caused by an error in the exception handling
subsystem.
Resources:

* Check the ColdFusion documentation to verify that you are using
the correct syntax.
* Search the Knowledge Base to find a solution to your problem.

Browser Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:
1.9.1.19) Gecko/20110420 Firefox/3.5.19 GTB7.1 (.NET CLR 3.5.30729)
Remote Address 64.20.12.78
Referrer https://www.chelseapiers.com/__wip/redesign/sc/forms/boot-camp-registration/index.cfm?refreshApp
Date/Time 23-Jun-11 11:45 AM
Stack Trace
at cfdump2ecfm565982208._factor1(E:/cf9_final/cfusion/wwwroot/WEB-INF/
cftags/dump.cfm) at cfdump2ecfm565982208._factor4(E:/cf9_final/cfusion/
wwwroot/WEB-INF/cftags/dump.cfm) at cfaction2ecfm663363148.runPage(C:/
inetpub/wwwroot/__wip/redesign/sc/forms/boot-camp-registration/
action.cfm:94)

org.hibernate.LazyInitializationException: illegal access to loading
collection
at
org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:
363)
at
org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:
108)
at
org.hibernate.collection.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:
131)
at org.hibernate.collection.PersistentBag.size(PersistentBag.java:
248)
at coldfusion.runtime.Array.ArrayLen(Array.java:295)
at coldfusion.runtime.CFPage.ArrayLen(CFPage.java:553)
at cfdump2ecfm565982208$funcDUMPARRAY.runFunction(E:\cf9_final\cfusion
\wwwroot\WEB-INF\cftags\dump.cfm:1978)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472)
at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
at coldfusion.runtime.UDFMethod
$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
at
coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:
55)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:517)
at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2547)
at cfdump2ecfm565982208$funcRENDEROUTPUT.runFunction(E:\cf9_final
\cfusion\wwwroot\WEB-INF\cftags\dump.cfm:698)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472)
at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
at coldfusion.runtime.UDFMethod
$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
at
coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:
55)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:517)
at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2547)
at cfdump2ecfm565982208$funcDUMPOBJECT.runFunction(E:\cf9_final
\cfusion\wwwroot\WEB-INF\cftags\dump.cfm:1532)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472)
at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
at coldfusion.runtime.UDFMethod
$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
at
coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:
55)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:517)
at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2547)
at cfdump2ecfm565982208$funcRENDEROUTPUT.runFunction(E:\cf9_final
\cfusion\wwwroot\WEB-INF\cftags\dump.cfm:670)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472)
at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
at coldfusion.runtime.UDFMethod
$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
at
coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:
55)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:517)
at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2547)
at cfdump2ecfm565982208$funcDUMPOBJECT.runFunction(E:\cf9_final
\cfusion\wwwroot\WEB-INF\cftags\dump.cfm:1532)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472)
at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
at coldfusion.runtime.UDFMethod
$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
at
coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:
55)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:517)
at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2547)
at cfdump2ecfm565982208$funcRENDEROUTPUT.runFunction(E:\cf9_final
\cfusion\wwwroot\WEB-INF\cftags\dump.cfm:670)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472)
at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
at coldfusion.runtime.UDFMethod
$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
at
coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:
55)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220)
at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2582)
at cfdump2ecfm565982208._factor17(E:\cf9_final\cfusion\wwwroot\WEB-INF
\cftags\dump.cfm:563)
at cfdump2ecfm565982208._factor25(E:\cf9_final\cfusion\wwwroot\WEB-INF
\cftags\dump.cfm:562)
at cfdump2ecfm565982208._factor1(E:\cf9_final\cfusion\wwwroot\WEB-INF
\cftags\dump.cfm)
at cfdump2ecfm565982208._factor27(E:\cf9_final\cfusion\wwwroot\WEB-INF
\cftags\dump.cfm:548)
at cfdump2ecfm565982208._factor4(E:\cf9_final\cfusion\wwwroot\WEB-INF
\cftags\dump.cfm)
at cfdump2ecfm565982208._factor54(E:\cf9_final\cfusion\wwwroot\WEB-INF
\cftags\dump.cfm:494)
at cfdump2ecfm565982208.runPage(E:\cf9_final\cfusion\wwwroot\WEB-INF
\cftags\dump.cfm:1)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:231)
at
coldfusion.filter.CFVariablesScopeFilter.invoke(CFVariablesScopeFilter.java:
56)
at coldfusion.tagext.lang.ModuleTag.doStartTag(ModuleTag.java:271)
at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2722)
at cfaction2ecfm663363148.runPage(C:\inetpub\wwwroot\__wip\redesign\sc
\forms\boot-camp-registration\action.cfm:94)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:231)
at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:416)
at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)
at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:
342)
at
coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:
48)
at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:
40)
at coldfusion.filter.PathFilter.invoke(PathFilter.java:87)
at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70)
at
coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:
74)
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.filter.RequestThrottleFilter.invoke(RequestThrottleFilter.java:
126)
at coldfusion.CfmServlet.service(CfmServlet.java:200)
at
coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:
89)
at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)
at
com.intergral.fusionreactor.filter.FusionReactorFilter.b(FusionReactorFilter.java:
376)
at
com.intergral.fusionreactor.filter.FusionReactorFilter.c(FusionReactorFilter.java:
254)
at
com.intergral.fusionreactor.filter.FusionReactorFilter.doFilter(FusionReactorFilter.java:
164)
at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
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
$DownstreamMetrics.invokeRunnable(ThreadPool.java:320)
at jrunx.scheduler.ThreadPool
$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
at jrunx.scheduler.ThreadPool
$UpstreamMetrics.invokeRunnable(ThreadPool.java:266)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)




Here is the BootCampSessions object:

component persistent="true" table="BootCampSessions" schema="dbo"
output="false" {
property name="bootCampSessionID" column="bootCampSessionID"
type="numeric" ormtype="int" fieldtype="id" generator="identity" ;
property name="dayOfWeekNum" column="dayOfWeekNum" type="numeric"
ormtype="int" ;
property name="startTime" column="startTime" type="date"
ormtype="timestamp" ;
property name="endTime" column="endTime" type="date"
ormtype="timestamp" ;
property name="BootCampSessionGroups"
type="array"
cfc="BootCampSessionGroups"
fieldtype="many-to-many"
fkcolumn="bootCampSessionID"
linktable="BootCampSessions_SessionGroups"
inversejoincolumn="bootCampSessionID"
lazy= true
inverse= true;
}

and here is the BootCampSessionGroups object:

component persistent="true" table="BootCampSessionGroups"
schema="dbo" output="true" {
property name="BootCampSessionGroupID"
column="BootCampSessionGroupID" type="numeric" ormtype="int"
fieldtype="id" generator="identity" ;
property name="SessionName" column="SessionGroupName" type="string"
ormtype="string" ;
property name="SessionOption" column="SessionGroupOption"
type="string" ormtype="string" ;
property name="MemberPrice" column="MemberPrice" type="numeric"
ormtype="double" ;
property name="NonMemberPrice" column="NonMemberPrice" type="numeric"
ormtype="double" ;
property name="BootCampSessions" type="array" fieldtype="many-to-
many" cfc="BootCampSessions"
linktable="BootCampSessions_SessionGroups"
fkcolumn="bootCampSessionGroupID inversejoincolumn="bootCampSessionID"
lazy= true ;

Is there something the in the component definition that is causing the
error, or is this a CF bug? Any help would be greatly appreciated.
Thank you.

Gavin Baumanis

unread,
Jun 23, 2011, 7:14:22 PM6/23/11
to cf-orm-dev
Hi there,
I doubt it is a bug, otherwise everyone would be screaming about their
may-to-many's not working.
I have had a very similar message to this previously.

I tried a few things and so am unsure which actually fixed it (it was
a while ago)

the things that I always check for;
* Case sensitive CFC names (we're on Linux and so that bites us in the
butt occasionally)

We have ORM settings create the hibernate mapping file for us.
We have some "tweaks" that we need to do to the XML that we couldn't
work out how to do with a CFPROPERTY tag.
So as a rule of thumb when we get any ORM weirdness (during
development) we;

* Delete the HBMXML files and let the CF-ORM recreate them all for
us.
(post making any required tweaks).

Lastly, we have a template that we call that does the following for
us;
* Delete the template cache (via the CF adminAPI)
* Delete the CFC cache - again (via the CF adminAPI)
* Delete any WSDL definitions - so that they get recreated from
scratch (via the CF adminAPI)
and finally the template calls the
* applicationStop() method and provides a link back to the main menu.

We also have the ability just to call the applicationStop() method on
its own.

We had real problenms early on with CFProperty chamges not taking
effect and other really bizarre weirdness that no one else seemed to
be getting.
The default advice was have you done an ormReload() ?
It hardly ever seemed to work for us - and we resorted to actually
restarting the CF server to ensure that we got the ORM changes into
effect.

Since swapping from using ormReload() to applicationStop() - we have
not had to restart the CF server to get the results we need.
If you do have CF create the HBMXML files for you, make sure you
delete them and have them recreated.
If the XML files exist, they are considered the "authoritative"
source, not the CFPROPERTY tags - so changes to the CFCs are ignored
(with respect to ORM mappings.)

Let us know how you go.

Gavin.


On Jun 24, 2:06 am, ttyson <tsqw...@gmail.com> wrote:
> I have a problem similar to one that was posted earlier but with no
> resolution.
>
> I'm working on an application that has a many-to-many relationship
> between two tables that uses a registration form to populate both
> tables. My tables are BootCampSessions and BootCampSessionGroups.
> The form presents the data initially, but when I try to complete the
> form I get the error "[undefined array element] illegal access to
> loading collection".
>
>  I have an admin area where I use CRUD functions and it works there,
> but in my registration form when I click Submit I get the following
> error:
>
>  illegal access to loading collection
>
> ColdFusion cannot determine the line of the template that caused this
> error. This is often caused by an error in the exception handling
> subsystem.
> Resources:
>
>     * Check the ColdFusion documentation to verify that you are using
> the correct syntax.
>     * Search the Knowledge Base to find a solution to your problem.
>
> Browser         Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:
> 1.9.1.19) Gecko/20110420 Firefox/3.5.19 GTB7.1 (.NET CLR 3.5.30729)
> Remote Address          64.20.12.78
> Referrer        https://www.chelseapiers.com/__wip/redesign/sc/forms/boot-camp-regist...
Reply all
Reply to author
Forward
0 new messages