The method injectPropertyMixin was not found in component
model.managers.security.
This seems internal to ColdBox, as it's not in any of my code (a
search for 'mixin' only brings results in the coldbox folder). Could
this be a bug in the beta version of ColdBox? My IOC stuff? Could I be
using something in my methods that relies on this that I could remove/
change?
Any direction to what I could look at or how I could solve this would
be awesome.
Thanks,
Thomas
------------------------------------------------------------------------------------------
Message: ERROR 10:01:20.369 AM ColdBox Skeleton Application
Application Execution Exception
Extra Information:
CFErrorType=Application CFDetails=Ensure that the method is defined,
and that it is spelled correctly. CFMessage=The method
injectPropertyMixin was not found in component
model.managers.security. CFStackTrace=coldfusion.runtime.TemplateProxy
$InvalidMethodNameException: The method injectPropertyMixin was not
found in component model.managers.security. at
coldfusion.runtime.TemplateProxy.throwInvalidMethodNameException
(TemplateProxy.java:748) at coldfusion.runtime.TemplateProxy.invoke
(TemplateProxy.java:477) at coldfusion.runtime.TemplateProxy.invoke
(TemplateProxy.java:354) at coldfusion.runtime.CfJspPage._invoke
(CfJspPage.java:2301) at coldfusion.tagext.lang.InvokeTag.doEndTag
(InvokeTag.java:382) at
cfBeanFactory2ecfc367130135$funcINJECTBEAN.runFunction(C:\inetpub
\wwwroot\ColdBox-Skeleton\coldbox\system\plugins\BeanFactory.cfc:1084)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472) at
coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47) at
coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:
405) 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
cfBeanFactory2ecfc367130135$funcAUTOWIRE.runFunction(C:\inetpub\wwwroot
\ColdBox-Skeleton\coldbox\system\plugins\BeanFactory.cfc:609) at
coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472) at
coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47) at
coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:
405) 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.TemplateProxy.invoke(TemplateProxy.java:495) at
coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:354) at
coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2301) at
cfIOC2ecfc1397727544$funcGETBEAN.runFunction(C:\inetpub\wwwroot
\ColdBox-Skeleton\coldbox\system\plugins\IOC.cfc:128) at
coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472) at
coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47) at
coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:
405) 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.TemplateProxy.invoke(TemplateProxy.java:490) at
coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:336) at
coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2360) at
cfMain2ecfc1146489057$funcONREQUESTSTART.runFunction(C:\inetpub\wwwroot
\ColdBox-Skeleton\handlers\Main.cfc:58) at
coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472) at
coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47) at
coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:
405) 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.TemplateProxy.invoke(TemplateProxy.java:495) at
coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:354) at
coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2301) at
coldfusion.tagext.lang.InvokeTag.doEndTag(InvokeTag.java:382) at
cfController2ecfc1564096369$funcRUNEVENT.runFunction(C:\inetpub\wwwroot
\ColdBox-Skeleton\coldbox\system\web\Controller.cfc:548) at
coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472) at
coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:
405) 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.TemplateProxy.invoke(TemplateProxy.java:490) at
coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:336) at
coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2360) at
cfColdbox2ecfc2017236257$funcPROCESSCOLDBOXREQUEST.runFunction(C:
\inetpub\wwwroot\ColdBox-Skeleton\coldbox\system\Coldbox.cfc:177) at
coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472) at
coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:
405) 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
cfApplication2ecfc1981312922$funcONREQUESTSTART.runFunction(C:\inetpub
\wwwroot\ColdBox-Skeleton\Application.cfc:52) at
coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472) at
coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:
405) 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.TemplateProxy.invoke(TemplateProxy.java:490) at
coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:336) at
coldfusion.runtime.AppEventInvoker.invoke(AppEventInvoker.java:88) at
coldfusion.runtime.AppEventInvoker.onRequestStart(AppEventInvoker.java:
258) at coldfusion.filter.ApplicationFilter.invoke
(ApplicationFilter.java:331) 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.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
$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)
CFTagContext=ID: CFINVOKE; LINE: 1084; TEMPLATE: C:\inetpub\wwwroot
\ColdBox-Skeleton\coldbox\system\plugins\BeanFactory.cfc ID:
CF_UDFMETHOD; LINE: 609; TEMPLATE: C:\inetpub\wwwroot\ColdBox-Skeleton
\coldbox\system\plugins\BeanFactory.cfc ID: CF_TEMPLATEPROXY; LINE:
128; TEMPLATE: C:\inetpub\wwwroot\ColdBox-Skeleton\coldbox\system
\plugins\IOC.cfc ID: CF_TEMPLATEPROXY; LINE: 58; TEMPLATE: C:\inetpub
\wwwroot\ColdBox-Skeleton\handlers\Main.cfc ID: CFINVOKE; LINE: 548;
TEMPLATE: C:\inetpub\wwwroot\ColdBox-Skeleton\coldbox\system\web
\Controller.cfc ID: CF_TEMPLATEPROXY; LINE: 177; TEMPLATE: C:\inetpub
\wwwroot\ColdBox-Skeleton\coldbox\system\Coldbox.cfc ID: CF_UDFMETHOD;
LINE: 52; TEMPLATE: C:\inetpub\wwwroot\ColdBox-Skeleton\Application.cfc
I'm guessing this is somehow related to autowiring? The security.cfc
uses cfproperty to inject the userManager. Here are the first two
lines of the model.managers.secuirty"
<cfcomponent output="false" extends="Base" autowire="true">
<cfproperty name="userManager" type="ioc" scope="variables">
It's also intermittent (or perhaps related to the calling page).
Sometimes it throws the error and other times it takes me to record
editor screen.
I do have a few last questiona that I hope someone would be kind
enough to answer:
In the security sample app the model.security.cfc has a isUserVerified
method, and within that method, is the following:
<cfset var user = getManager("user").getUserByPropertyMap(arguments)>
The getManager method is a part of the base.cfc model, and uses:
<cfset var manager = CreateObject
("component",arguments.componentName).init(getTransfer(),getColdBox
()) />
So my questions are... Is it necessary to do it this way? Or, maybe I
should ask why is it done this way. Is it because the sample app uses
LightWire, or would it be the same for ColdSpring?
If I setup my dependencies correctly in ColdSpring, what is the best
method to use/call the model.UserManager bean in the model.security
cfc? I can't use getPlugin, and I can't use cfproperty right?
Thanks again and merry Christmas!
Thomas
You can put whatever code you like inside the userValidator method,
it's up to you how you check that the user is authorised.
Here is an simplified example that I've used in the past with Transfer
(using ColdBox 3 but the principle is the same)
<cfcomponent hint="I am the facade for the security package"
extends="model.abstract.AbstractService" output="false">
<cfproperty name="Transfer" inject="ocm" scope="instance" />
<cfproperty name="SessionStorage"
inject="coldbox:plugin:SessionStorage" scope="instance" />
--->
<cffunction name="getCurrentUser" returntype="component" output="false">
<cfscript>
var User = "";
if ( instance.SessionStorage.exists( 'userid') )
{
User = instance.Transfer.get( 'security.User',
instance.SessionStorage.getVar( 'userid' ) );
}
else
{
User = newUser();
}
return User;
</cfscript>
</cffunction>
<cffunction name="userValidator" returntype="boolean" output="false"
hint="Mandatory method for ColdBox security interceptor"
description="This method is only called if an event matching the
securelist in securityrules.xml.cfm is called">
<cfargument name="rule" type="struct" required="true" />
<cfargument name="messagebox" type="component" required="true" />
<cfargument name="controller" type="component" required="true" />
<cfscript>
var User = getCurrentUser();
var authorised = false;
// list of allowed roles
var allowedRoles = arguments.rule.roles;
var userRoles = "";
var userRolesList = "";
var i = 0;
if ( User.hasRole() )
{
// get assigned role
userRoles = User.getRole();
/*
if we have an array of roles loop
*/
if ( IsArray( userRoles ) )
{
for( i = 1; i lte ArrayLen( userRoles ); i++ )
{
if ( ListFindNoCase( allowedRoles, userRoles[ i ].getName() ) != 0 )
{
authorised = true;
break;
}
}
}
}
return authorised;
</cfscript>
</cffunction>
</cfcomponent>
HTH
- John
In the end I wasn't injecting the UserManager correctly into the
SecurtyManager because of base.cfc, but my first assumption was that
it worked differently within ColdBox than in a normal application. Bad
assumption. After changing the code all works as expected.
Thomas
Anybody else experiencing this? Would love to get rid of these error
messages clogging up my logs.
Thanks,
Craig
--
You received this message because you are subscribed to the Google Groups "ColdBox: A ColdFusion Framework" group.
To post to this group, send email to col...@googlegroups.com
To unsubscribe from this group, send email to coldbox-u...@googlegroups.com
For more options, visit this group at http://groups-beta.google.com/group/coldbox
For more information, visit http://www.luismajano.com/projects/coldbox
For Documentation, visit http://ortus.svnrepository.com/coldbox/trac.cgi
> ...
>
> read more »
Thanks again for the great work Luis! Is there a way to contribute a
patch/diff to the assembla svn? I found a bug in the JSON that I
reported a few months ago but seems it's still lurking in the latest
SVN releases and would like to get it contributed.
Cheers,
Craig
> ...
>
> read more »