new criteria from ormbaseservice

Description

Code that generates exception that runs from a service that extends cborm.models.BaseORMService

var c = newCriteria(entityName="user_group_permissions", useQueryCaching=javaCast("boolean", true));
var results = c.add(c.restrictions.eq("user", user))
.add(c.restrictions.eq("group", group))
.resultTransformer( c.DISTINCT_ROOT_ENTITY ).list();

Type: Expression
Messages: Value must be initialized before use. Its possible that a method called on a Java object created by CreateObject returned null.

line 78
// Link to system event handler
variables.eventManager = arguments.ORMService.getORMEventHandler().getEventManager();

coldfusion.runtime.UninitializedValueException: Value must be initialized before use.
at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2472)
at cfBaseBuilder2ecfc1596510415$funcINIT.runFunction(C:\inetpub\wwwroot\formmanager\modules\cborm\models\BaseBuilder.cfc:78)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:487)
at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:420)
at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:383)
at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:334)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:533)
at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2810)
at coldfusion.runtime.SuperScope.invoke(SuperScope.java:18)
at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2424)
at cfCriteriaBuilder2ecfc1097686398$funcINIT.runFunction(C:\inetpub\wwwroot\formmanager\modules\cborm\models\CriteriaBuilder.cfc:65)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:487)
at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:420)
at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:383)
at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:334)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:533)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:648)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:457)
at coldfusion.runtime.CFPage.___createObjectInternal(CFPage.java:11221)
at coldfusion.runtime.CFPage._createObject(CFPage.java:11199)
at cfBaseORMService2ecfc889705314$funcNEWCRITERIA.runFunction(C:\inetpub\wwwroot\formmanager\modules\cborm\models\BaseORMService.cfc:1426)

Attachments

2

Gliffy Diagrams

Activity

Show:

Luis MajanoApril 29, 2016 at 9:29 PM

I can't reproduce this. More info needed

Brad SeveningAugust 13, 2015 at 6:06 PM

Sorry about that one and it was an init issue. My service that extends the ORMBaseService was not initializing it's super class. Added super.init() and all is well, not sure how it worked in CB 3.5 but it did.

any function init()
{
super.init(useQueryCaching=true, eventHandling=false);
return this;
}

Brad SeveningAugust 13, 2015 at 3:51 PM

Added a couple dumps, one of the actual error and a dump of the eventHandler call from line 78 of the basebuilder. Which seems to be just fine so I'm going to have to step back through the call stack as I'm beginning to think the error is not in basebuilder.

writeDump(arguments.ORMService.getORMEventHandler().getEventManager());abort;

Luis MajanoAugust 13, 2015 at 3:11 PM

This is impossible for us to replicate Brad. We need more info. Are you running this in a test? Has your service been inited?

Cannot Reproduce
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Components

Affects versions

Priority

Sentry

Created August 13, 2015 at 2:39 PM
Updated April 29, 2016 at 9:29 PM
Resolved April 29, 2016 at 9:29 PM