I don't use mach-ii but does the plugin auto-wire by default? It sounds
like you are expecting something to be auto-wired and it isn't?

 

________________________________

From: [email protected]
[mailto:[EMAIL PROTECTED] On Behalf Of Bryan S
Sent: Wednesday, September 05, 2007 10:40 AM
To: [email protected]
Subject: [coldspring-dev] Problem with Coldspring Mach-ii plugin

 

O.K. I now have no init method in my listener. I do have the configure
method below. If I comment out the code inside of it I get the error
message
Element INSTANCE.SECURITYSERVICE is undefined in VARIABLES.

<cffunction name="configure" returntype="any" output="false"
hint="Constructor"> 
    <cfset variables.instance.BeanFactory =
createObject("component","coldspring.beans.DefaultXmlBeanFactory").init(
) />
    <cfset
getBeanFactory().loadBeansFromXmlFile("/actionpacks/security/config/Cold
Spring.xml",true) /> 
</cffunction>

These are my getter/setter methods. The setter is NOT getting called.
The getter is being called.

<cffunction name="setSecurityService" access="public" returntype="void"
output="false"> 
    <cfargument name="securityService" required="true" type="any" />
<!---
<cfdump var="#arguments#" label="arguments
SETSecurityServicee"><cfabort> 
 --->    
    <cfset variables.instance.securityService =
arguments.securityService />
</cffunction>
<cffunction name="getSecurityService" access="public" returntype="any"
output="false"> 
<!---
<cfdump var="#arguments#" label="arguments GETSecurityService"><cfabort>
 --->
    <cfreturn variables.instance.securityService />
</cffunction>
     
Below is my listener declaration in Mach-ii.xml. if I comment out the
invoker type I get the error.
The element at position 1 of dimension 1, of array variable
&quot;INVOKERNODES,&quot; cannot be found.

After reading the EventInvoker part of the FAQ I searched my mach-ii
directory and found that I have the EventInvoker file:
D:\Inetpub\wwwroot\MachII\framework\invokers\EventInvoker.cfc

<listener name="SecurityListener" type="
actionpacks.security.model.SecurityListener">
    <invoker type="MachII.framework.invokers.CFCInvoker_Event" />
</listener>

This is the relevant excerpt from the coldspring.xml which I believe
must be correct or the code in the configure method above would not
cause the SecurityService to become accessible in the listener. 

<bean id="SecurityService"
class="actionpacks.security.model.SecurityService">        
    <property name="SecurityConfig">
        <ref bean="SecurityConfig"/> 
    </property>                            
</bean>

<bean id="SecurityConfig"
class="ModelGlue.Bean.CommonBeans.SimpleConfig">
    <property name="config"> 
        <map>        
            <entry key="ldapServers">
                <value>12.345.6.7,12.345.6.8</value>
            </entry>                                             
        </map>      
    </property>
</bean>        

This is the function call that is failing:
<cfset local.proxyUserExists =
getSecurityService().doesUserExist(local.userName)> 
in this function
<cffunction name="ProxyUser" returntype="any" output="false">
    <cfargument name="event" type="any" required="true" />

    <cfset var local = structNew() />

    <cfset local.SecurityUser = arguments.event.getArg("SecurityUser")
/>
    <cfset local.userName = arguments.event.getArg("userName") /> 
    <cfset local.globalAppDevName =
arguments.event.getArg("globalAppDevName") />

    <cfset local.proxyUserExists =
getSecurityService().doesUserExist(local.userName)>    

    <cfif local.proxyUserExists >>        
        <!---change the user to the one entered for rights assignment
purposes--->            
        <cfset local.SecurityUser.SetUserName(local.userName)>    
        <!--- add the groups and roles to the Security Object--->
        <cfset
getSecurityService().assignGroupsAndRoles(local.SecurityUser,local.globa
lAppDevName)>
    </cfif>        
         
    <cfreturn local.SecurityUser />
</cffunction>
    
Is there any other code I could show that would be helpful?

Reply via email to