Upgrade to Bleeding Edge - Error on Init (Criteria Queries)

Hello Guys,

I’ve got a use case for Criteria queries so this morning decided to upgrade ColdBox from 3.1 to the latest bleeding edge from development branch on GitHub.

However, during application init CF is kicking up a fuss about syntax errors in the Criteria Query restrictions CFC.

I’ve had a look at the source and it all appears fine to me, so my guess is perhaps the error is actually somewhere else? I don’t know, perhaps someone else can double check.

# Error creating validatorModel: security.securityservice
Invalid CFML construct found on line 181 at column 17.ColdFusion was looking at the following text:

for



The CFML compiler was processing:

- A script statement beginning with for on line 181, column 17.
- A script statement beginning with any on line 179, column 9.
[{TEMPLATE={/Library/tomcat/webapps/sorryapp/coldbox/system/orm/hibernate/criterion/Restrictions.cfc},LINE={181},TYPE={SYNTAX},COLUMN={17}}, {RAW_TRACE={ at cfBaseORMService2ecfc697008640$funcINIT.runFunction(/Library/tomcat/webapps/sorryapp/coldbox/system/orm/hibernate/BaseORMService.cfc:85)},ID={CF_CFPAGE},TEMPLATE={/Library/tomcat/webapps/sorryapp/coldbox/system/orm/hibernate/BaseORMService.cfc},LINE={85},TYPE={CFML},COLUMN={0}}, {RAW_TRACE={ at cfVirtualEntityService2ecfc10248887$funcINIT.runFunction(/Library/tomcat/webapps/sorryapp/coldbox/system/orm/hibernate/VirtualEntityService.cfc:58)},ID={CF_SUPERSCOPE},TEMPLATE={/Library/tomcat/webapps/sorryapp/coldbox/system/orm/hibernate/VirtualEntityService.cfc},LINE={58},TYPE={CFML},COLUMN={0}}, {RAW_TRACE={ at cfColdBoxDSL2ecfc1962553179$funcGETENTITYSERVICEDSL.runFunction(/Library/tomcat/webapps/sorryapp/coldbox/system/ioc/dsl/ColdBoxDSL.cfc:98)},ID={CF_TEMPLATEPROXY},TEMPLATE={/Library/tomcat/webapps/sorryapp/coldbox/system/ioc/dsl/ColdBoxDSL.cfc},LINE={98},TYPE={CFML},COLUMN={0}}, {RAW_TRACE={ at cfColdBoxDSL2ecfc1962553179$funcPROCESS.runFunction(/Library/tomcat/webapps/sorryapp/coldbox/system/ioc/dsl/ColdBoxDSL.cfc:41)},ID={CF_UDFMETHOD},TEMPLATE={/Library/tomcat/webapps/sorryapp/coldbox/system/ioc/dsl/ColdBoxDSL.cfc},LINE={41},TYPE={CFML},COLUMN={0}}, {RAW_TRACE={ at cfBuilder2ecfc222927404$funcBUILDDSLDEPENDENCY.runFunction(/Library/tomcat/webapps/sorryapp/coldbox/system/ioc/Builder.cfc:320)},ID={CF_TEMPLATEPROXY},TEMPLATE={/Library/tomcat/webapps/sorryapp/coldbox/system/ioc/Builder.cfc},LINE={320},TYPE={CFML},COLUMN={0}}, {RAW_TRACE={ at cfInjector2ecfc1478837735$funcPROCESSINJECTION.runFunction(/Library/tomcat/webapps/sorryapp/coldbox/system/ioc/Injector.cfc:575)},ID={CF_TEMPLATEPROXY},TEMPLATE={/Library/tomcat/webapps/sorryapp/coldbox/system/ioc/Injector.cfc},LINE={575},TYPE={CFML},COLUMN={0}}, {RAW_TRACE={ at cfInjector2ecfc1478837735$funcAUTOWIRE.runFunction(/Library/tomcat/webapps/sorryapp/coldbox/system/ioc/Injector.cfc:462)},ID={CF_UDFMETHOD},TEMPLATE={/Library/tomcat/webapps/sorryapp/coldbox/system/ioc/Injector.cfc},LINE={462},TYPE={CFML},COLUMN={0}}, {RAW_TRACE={ at cfNoScope2ecfc967429963$funcGETFROMSCOPE.runFunction(/Library/tomcat/webapps/sorryapp/coldbox/system/ioc/scopes/NoScope.cfc:33)},ID={CF_TEMPLATEPROXY},TEMPLATE={/Library/tomcat/webapps/sorryapp/coldbox/system/ioc/scopes/NoScope.cfc},LINE={33},TYPE={CFML},COLUMN={0}}, {RAW_TRACE={ at cfInjector2ecfc1478837735$funcGETINSTANCE.runFunction(/Library/tomcat/webapps/sorryapp/coldbox/system/ioc/Injector.cfc:262)},ID={CF_TEMPLATEPROXY},TEMPLATE={/Library/tomcat/webapps/sorryapp/coldbox/system/ioc/Injector.cfc},LINE={262},TYPE={CFML},COLUMN={0}}, {RAW_TRACE={ at cfFrameworkSupertype2ecfc2064018217$funcGETMODEL.runFunction(/Library/tomcat/webapps/sorryapp/coldbox/system/FrameworkSupertype.cfc:116)},ID={CF_TEMPLATEPROXY},TEMPLATE={/Library/tomcat/webapps/sorryapp/coldbox/system/FrameworkSupertype.cfc},LINE={116},TYPE={CFML},COLUMN={0}}, {RAW_TRACE={ at cfSecurity2ecfc180597083$funcAFTERASPECTSLOAD.runFunction(/Library/tomcat/webapps/sorryapp/coldbox/system/interceptors/Security.cfc:121)},ID={CF_UDFMETHOD},TEMPLATE={/Library/tomcat/webapps/sorryapp/coldbox/system/interceptors/Security.cfc},LINE={121},TYPE={CFML},COLUMN={0}}, {RAW_TRACE={ at cfInterceptorState2ecfc1849089670$funcINVOKER.runFunction(/Library/tomcat/webapps/sorryapp/coldbox/system/web/context/InterceptorState.cfc:139)},ID={CFINVOKE},TEMPLATE={/Library/tomcat/webapps/sorryapp/coldbox/system/web/context/InterceptorState.cfc},LINE={139},TYPE={CFML},COLUMN={0}}, {RAW_TRACE={ at cfInterceptorState2ecfc1849089670$funcPROCESS.runFunction(/Library/tomcat/webapps/sorryapp/coldbox/system/web/context/InterceptorState.cfc:86)},ID={CF_UDFMETHOD},TEMPLATE={/Library/tomcat/webapps/sorryapp/coldbox/system/web/context/InterceptorState.cfc},LINE={86},TYPE={CFML},COLUMN={0}}, {RAW_TRACE={ at cfInterceptorService2ecfc1295910068$funcPROCESSSTATE.runFunction(/Library/tomcat/webapps/sorryapp/coldbox/system/web/services/InterceptorService.cfc:132)},ID={CF_TEMPLATEPROXY},TEMPLATE={/Library/tomcat/webapps/sorryapp/coldbox/system/web/services/InterceptorService.cfc},LINE={132},TYPE={CFML},COLUMN={0}}, {RAW_TRACE={ at cfLoaderService2ecfc2006722157$funcLOADAPPLICATION.runFunction(/Library/tomcat/webapps/sorryapp/coldbox/system/web/services/LoaderService.cfc:93)},ID={CF_TEMPLATEPROXY},TEMPLATE={/Library/tomcat/webapps/sorryapp/coldbox/system/web/services/LoaderService.cfc},LINE={93},TYPE={CFML},COLUMN={0}}, {RAW_TRACE={ at cfColdbox2ecfc940849930$funcLOADCOLDBOX.runFunction(/Library/tomcat/webapps/sorryapp/coldbox/system/Coldbox.cfc:71)},ID={CF_TEMPLATEPROXY},TEMPLATE={/Library/tomcat/webapps/sorryapp/coldbox/system/Coldbox.cfc},LINE={71},TYPE={CFML},COLUMN={0}}, {RAW_TRACE={ at cfApplication2ecfc111743193$funcONAPPLICATIONSTART.runFunction(/Library/tomcat/webapps/sorryapp/Application.cfc:25)},ID={CF_UDFMETHOD},TEMPLATE={/Library/tomcat/webapps/sorryapp/Application.cfc},LINE={25},TYPE={CFML},COLUMN={0}}]

Inside my validator model, I inject a virtual entity service using the following DSL:

property name=“MemberService” inject=“entityService:member”;

It would seem that during the init of that virtual service we’re getring the eror.

Any suggestions?

Thanks.

Robert

I would look in your security service

Thanks for getting back to me Luis.

I can’t see anything in my SecurityService - and I have assumed that if I had a syntax error in their I’d have seen it even when working with older CB versions?

I’ve removed MemberService property from my security service, but I still get the same error albeit in a slightly different guise.

Application Execution ExceptionError Type: Template : [N/A]

Error Messages: Invalid CFML construct found on line 181 at column 17.
ColdFusion was looking at the following text:

for

The CFML compiler was processing:

  • A script statement beginning with for on line 181, column 17.
  • A script statement beginning with any on line 179, column 9.

Tag Context:
ID: ??
LINE: 181
Template: /Library/tomcat/webapps/sorryapp/coldbox/system/orm/hibernate/criterion/Restrictions.cfc
ID: CF_CFPAGE
LINE: 85
Template: /Library/tomcat/webapps/sorryapp/coldbox/system/orm/hibernate/BaseORMService.cfc
ID: CF_SUPERSCOPE
LINE: 58
Template: /Library/tomcat/webapps/sorryapp/coldbox/system/orm/hibernate/VirtualEntityService.cfc
ID: CF_TEMPLATEPROXY
LINE: 98
Template: /Library/tomcat/webapps/sorryapp/coldbox/system/ioc/dsl/ColdBoxDSL.cfc
ID: CF_UDFMETHOD
LINE: 41
Template: /Library/tomcat/webapps/sorryapp/coldbox/system/ioc/dsl/ColdBoxDSL.cfc
ID: CF_TEMPLATEPROXY
LINE: 320
Template: /Library/tomcat/webapps/sorryapp/coldbox/system/ioc/Builder.cfc
ID: CF_TEMPLATEPROXY
LINE: 575
Template: /Library/tomcat/webapps/sorryapp/coldbox/system/ioc/Injector.cfc
ID: CF_UDFMETHOD
LINE: 462
Template: /Library/tomcat/webapps/sorryapp/coldbox/system/ioc/Injector.cfc
ID: CF_TEMPLATEPROXY
LINE: 33
Template: /Library/tomcat/webapps/sorryapp/coldbox/system/ioc/scopes/NoScope.cfc
ID: CF_TEMPLATEPROXY
LINE: 262
Template: /Library/tomcat/webapps/sorryapp/coldbox/system/ioc/Injector.cfc
ID: CF_TEMPLATEPROXY
LINE: 115
Template: /Library/tomcat/webapps/sorryapp/coldbox/system/web/services/HandlerService.cfc
ID: CF_UDFMETHOD
LINE: 136
Template: /Library/tomcat/webapps/sorryapp/coldbox/system/web/services/HandlerService.cfc
ID: CF_TEMPLATEPROXY
LINE: 493
Template: /Library/tomcat/webapps/sorryapp/coldbox/system/web/Controller.cfc
ID: CF_TEMPLATEPROXY
LINE: 223
Template: /Library/tomcat/webapps/sorryapp/coldbox/system/Coldbox.cfc
ID: CF_UDFMETHOD
LINE: 39
Template: /Library/tomcat/webapps/sorryapp/Application.cfc

Thanks for your continued help bud.

Robert

do you have coldfusion 9.0.1 or 9?

Luis F. Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

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

Social: twitter.com/lmajano facebook.com/lmajano

I was only running 9 Luis, I’m looking at the 9.0.1 change log and see they added support for ‘for’ loops on arrays, I guess that’s what you need?

I’ve just upgraded to 9.0.1 but this however has introduced another issue (I’m not having much luck.)

# Parameter validation error for cacheGetAllIds function.
The function allows 1 parameters, but found 2.

The error occurred in**/Library/tomcat/webapps/sorryapp/coldbox/system/cache/providers/RailoProvider.cfc: line 221**
|


<br>219 : }<br>220 : <br>**221 : return cacheGetAllIds("",getConfiguration().cacheName);**<br>222 : }<br>223 : <br><br>

|

I really appreciate you taking the time to help me through this.

Thanks.

Robert

Yes, 9.0.1 is needed. Also, the error you see is because ORM scans all CFCs for entities and finds some Railo compatible CFCs which are not ACF compatible and blows up. To change this I would do the orm settings in your app to use a cfclocation to find the entities, which in all reality is a much better practice as it only scans the folders you want and not the entire directory structure.

Luis F. Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

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

Social: twitter.com/lmajano facebook.com/lmajano

Ah ok, that makes sense about the ORM.

I did used to have the cfclocation defined, I must have removed it at some point. I have put it back in place and I’m no longer getting the error:

However, I’m now getting yet another error (this is killing me haha)

This one looks a little more serious, certainly nothing I’ve ever seen before.

Robert

Never seen that one for sure/

Luis F. Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

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

Social: twitter.com/lmajano facebook.com/lmajano

Hi Luis,

I took a look at this with fresh eyes this morning and remembered that I have seen this error before.

It’s basically a GOTCHA when running CF9 on TomCat - It’s missing some of the required Hibernate libraries. I had fixed this on my initial install of CF9 but this was obviously overwritten when I upgraded to 9.0.1.

http://blog.alagad.com/2009/09/18/coldfusion-9-orm-on-tomcat-gotcha/

I dropped the jta.jar into my WEB-INF/Lib folder, restarted the context and we’re now alive and kicking again, on bleeding edge ColdBox :smiley:

Thanks for your help.

Robert