I'm fairly new to transfer, have been evaluating it for a project at
work... and ran into this error while trying to create a ManyToMany
relationship. Any help would be appreciated! :)

--
Jim Rising
Serial Entrepreneur
Software Engineer
Web Developer

"Knowledge work requires both autonomy and accountability."



Table schema:

User
user.UserID
user.username
user.password
etc...

Group
group.GroupID
group.name
etc...

mapgroups_users
mapgroups_users.usersID
mapgroups_users.groupsID
etc...

ManyToMany in transfer.xml.cfm:

<manytomany name="groups" table="mapgroups_users">
<link to="user.User" column="userID"/>
<link to="group.Group" column="groupID"/>
<collection type="struct">
<key property="groupID"/>
</collection>
</manytomany>

I do not have a transfer object defined for mapgroups_users ... per
recommendation from Ray Camden.

the related event:

user.dspEditUser:

<cffunction name="dspEditUser" access="public" returntype="void"
output="false">
<cfargument name="Event" type="coldbox.system.beans.requestContext">
<cfset var rc = Event.getCollection() />
<!--- No user object in Event Collection? (Will exist after
validation) --->
<cfif not isDefined("rc.user")>
<cfset rc.user = getPlugin("ioc").getBean("UserManager").getUser
( Event.getValue("userId","") ) />
</cfif>
<!--- EXIT EVENT HANDLERS: --->
<cfset rc.xehSave = "user.doSaveUser">
<cfset rc.xehBack = "user.dspUsers"> </cffunction>

&lt;cfset Event.setView("user/edit")&gt;

the related userManager

<cffunction name="getUser" access="public"
returntype="transfer.com.TransferObject">
<cfargument name="userId" type="string" required="false" default="0">
</cffunction>

&lt;cfset var user = ""&gt;

&lt;!--- Read user from DB? ---&gt;

&lt;cfif isNumeric(arguments.userId) AND arguments.userId neq 0&gt;

    &lt;cfdump var="#getTransfer().list("user.User")#"
label="getTransfer"&gt;

    &lt;cfset user = getTransfer().get("user.User", arguments.userId)
&gt;

    &lt;!---&gt;

    &lt;cfset groups = user.getGroupArray()&gt;

    --->

&lt;cfelse&gt;

&lt;cfdump var="else"&gt;

    &lt;cfset user = getTransfer().new("user.User")&gt;

&lt;/cfif&gt;

&lt;cfreturn user&gt;

It's definitely something related to the manyToMany relationship, as
when it is removed, the error does not persist.




stack trace:

invalid call of the function init, second Argument (UTILITY) is of
invalid type, can't cast Object type [Struct] to a value of type
[transfer.com.util.Utility]
        at railo.runtime.type.UDFImpl.castToAndClone(UDFImpl.java:148):148
        at railo.runtime.type.UDFImpl.defineArguments(UDFImpl.java:162):162
        at railo.runtime.type.UDFImpl._call(UDFImpl.java:290):290
        at railo.runtime.type.UDFImpl.call(UDFImpl.java:260):260
        at railo.runtime.ComponentImpl._call(ComponentImpl.java:399):399
        at railo.runtime.ComponentImpl._call(ComponentImpl.java:331):331
        at railo.runtime.ComponentImpl.call(ComponentImpl.java:1496):1496
        at railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues
(VariableUtilImpl.java:617):617
        at railo.runtime.PageContextImpl.getFunction(PageContextImpl.java:
1252):1252
        at transfer.com.transfer_cfc$cf.udfCall1(/home/jimrising/Desktop/
railo-express/webroot/transfer/com/Transfer.cfc:80):80
        at transfer.com.transfer_cfc$cf.udfCall(/home/jimrising/Desktop/railo-
express/webroot/transfer/com/Transfer.cfc):-1
        at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:140):140
        at railo.runtime.type.UDFImpl._call(UDFImpl.java:293):293
        at railo.runtime.type.UDFImpl.call(UDFImpl.java:260):260
        at railo.runtime.ComponentImpl._call(ComponentImpl.java:399):399
        at railo.runtime.ComponentImpl._call(ComponentImpl.java:331):331
        at railo.runtime.ComponentImpl.call(ComponentImpl.java:1496):1496
        at railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues
(VariableUtilImpl.java:617):617
        at railo.runtime.PageContextImpl.getFunction(PageContextImpl.java:
1252):1252
        at transfer.com.transferobject_cfc$cf.udfCall2(/home/jimrising/
Desktop/railo-express/webroot/transfer/com/TransferObject.cfc:198):198
        at transfer.com.transferobject_cfc$cf.udfCall(/home/jimrising/Desktop/
railo-express/webroot/transfer/com/TransferObject.cfc):-1
        at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:140):140
        at railo.runtime.type.UDFImpl._call(UDFImpl.java:293):293
        at railo.runtime.type.UDFImpl.call(UDFImpl.java:260):260
        at railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues
(VariableUtilImpl.java:622):622
        at railo.runtime.PageContextImpl.getFunction(PageContextImpl.java:
1252):1252
        at transfer.com.transferobject_cfc$cf.udfCall2(/home/jimrising/
Desktop/railo-express/webroot/transfer/com/TransferObject.cfc:166):166
        at transfer.com.transferobject_cfc$cf.udfCall(/home/jimrising/Desktop/
railo-express/webroot/transfer/com/TransferObject.cfc):-1
        at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:140):140
        at railo.runtime.type.UDFImpl._call(UDFImpl.java:293):293
        at railo.runtime.type.UDFImpl.call(UDFImpl.java:260):260
        at railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues
(VariableUtilImpl.java:622):622
        at railo.runtime.PageContextImpl.getFunction(PageContextImpl.java:
1252):1252
        at workspace.svn_fiduciaryedge.trunk.definitions.user_user
$e2a92a16fb55f5823e60d4ee8f35de76_transfer230$cf.udfCall2(/home/
jimrising/workspace/svn_fiduciaryEdge/trunk/definitions/user.User
$E2A92A16FB55F5823E60D4EE8F35DE76.transfer:207):207
        at workspace.svn_fiduciaryedge.trunk.definitions.user_user
$e2a92a16fb55f5823e60d4ee8f35de76_transfer230$cf.udfCall(/home/
jimrising/workspace/svn_fiduciaryEdge/trunk/definitions/user.User
$E2A92A16FB55F5823E60D4EE8F35DE76.transfer):-1
        at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:140):140
        at railo.runtime.type.UDFImpl._call(UDFImpl.java:293):293
        at railo.runtime.type.UDFImpl.call(UDFImpl.java:260):260
        at railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues
(VariableUtilImpl.java:622):622
        at railo.runtime.PageContextImpl.getFunction(PageContextImpl.java:
1252):1252
        at workspace.svn_fiduciaryedge.trunk.definitions.user_user
$e2a92a16fb55f5823e60d4ee8f35de76_transfer230$cf.udfCall2(/home/
jimrising/workspace/svn_fiduciaryEdge/trunk/definitions/user.User
$E2A92A16FB55F5823E60D4EE8F35DE76.transfer:178):178
        at workspace.svn_fiduciaryedge.trunk.definitions.user_user
$e2a92a16fb55f5823e60d4ee8f35de76_transfer230$cf.udfCall(/home/
jimrising/workspace/svn_fiduciaryEdge/trunk/definitions/user.User
$E2A92A16FB55F5823E60D4EE8F35DE76.transfer):-1
        at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:140):140
        at railo.runtime.type.UDFImpl._call(UDFImpl.java:293):293
        at railo.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:253):
253
        at railo.runtime.ComponentImpl._call(ComponentImpl.java:400):400
        at railo.runtime.ComponentImpl._call(ComponentImpl.java:331):331
        at railo.runtime.ComponentImpl.callWithNamedValues(ComponentImpl.java:
1515):1515
        at railo.runtime.util.VariableUtilImpl.callFunctionWithNamedValues
(VariableUtilImpl.java:651):651
        at railo.runtime.PageContextImpl.getFunctionWithNamedValues
(PageContextImpl.java:1267):1267
        at
workspace.svn_fiduciaryedge.trunk.definitions.user_user_e2a92a16fb55f5823e60d4ee8f35de76_transfer870$cf.udfCall3
(/home/jimrising/workspace/svn_fiduciaryEdge/trunk/definitions/
[email protected]:153):153
        at
workspace.svn_fiduciaryedge.trunk.definitions.user_user_e2a92a16fb55f5823e60d4ee8f35de76_transfer870$cf.udfCall
(/home/jimrising/workspace/svn_fiduciaryEdge/trunk/definitions/
[email protected]):-1
        at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:140):140
        at railo.runtime.type.UDFImpl._call(UDFImpl.java:293):293
        at railo.runtime.type.UDFImpl.call(UDFImpl.java:260):260
        at railo.runtime.ComponentImpl._call(ComponentImpl.java:399):399
        at railo.runtime.ComponentImpl._call(ComponentImpl.java:331):331
        at railo.runtime.ComponentImpl.call(ComponentImpl.java:1496):1496
        at railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues
(VariableUtilImpl.java:617):617
        at railo.runtime.PageContextImpl.getFunction(PageContextImpl.java:
1252):1252
        at transfer.com.dynamic.transferpopulator_cfc$cf.udfCall1(/home/
jimrising/Desktop/railo-express/webroot/transfer/com/dynamic/
TransferPopulator.cfc:59):59
        at transfer.com.dynamic.transferpopulator_cfc$cf.udfCall(/home/
jimrising/Desktop/railo-express/webroot/transfer/com/dynamic/
TransferPopulator.cfc):-1
        at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:140):140
        at railo.runtime.type.UDFImpl._call(UDFImpl.java:293):293
        at railo.runtime.type.UDFImpl.call(UDFImpl.java:260):260
        at railo.runtime.ComponentImpl._call(ComponentImpl.java:399):399
        at railo.runtime.ComponentImpl._call(ComponentImpl.java:331):331
        at railo.runtime.ComponentImpl.call(ComponentImpl.java:1496):1496
        at railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues
(VariableUtilImpl.java:617):617
        at railo.runtime.PageContextImpl.getFunction(PageContextImpl.java:
1252):1252
        at transfer.com.dynamic.dynamicmanager_cfc$cf.udfCall1(/home/
jimrising/Desktop/railo-express/webroot/transfer/com/dynamic/
DynamicManager.cfc:72):72
        at transfer.com.dynamic.dynamicmanager_cfc$cf.udfCall(/home/jimrising/
Desktop/railo-express/webroot/transfer/com/dynamic/
DynamicManager.cfc):-1
        at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:140):140
        at railo.runtime.type.UDFImpl._call(UDFImpl.java:293):293
        at railo.runtime.type.UDFImpl.call(UDFImpl.java:260):260
        at railo.runtime.ComponentImpl._call(ComponentImpl.java:399):399
        at railo.runtime.ComponentImpl._call(ComponentImpl.java:331):331
        at railo.runtime.ComponentImpl.call(ComponentImpl.java:1496):1496
        at railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues
(VariableUtilImpl.java:617):617
        at railo.runtime.PageContextImpl.getFunction(PageContextImpl.java:
1252):1252
        at transfer.com.transfer_cfc$cf.udfCall1(/home/jimrising/Desktop/
railo-express/webroot/transfer/com/Transfer.cfc:120):120
        at transfer.com.transfer_cfc$cf.udfCall(/home/jimrising/Desktop/railo-
express/webroot/transfer/com/Transfer.cfc):-1
        at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:140):140
        at railo.runtime.type.UDFImpl._call(UDFImpl.java:293):293
        at railo.runtime.type.UDFImpl.call(UDFImpl.java:260):260
        at railo.runtime.ComponentImpl._call(ComponentImpl.java:399):399
        at railo.runtime.ComponentImpl._call(ComponentImpl.java:331):331
        at railo.runtime.ComponentImpl.call(ComponentImpl.java:1496):1496
        at railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues
(VariableUtilImpl.java:617):617
        at railo.runtime.PageContextImpl.getFunction(PageContextImpl.java:
1252):1252
        at workspace.svn_fiduciaryedge.trunk.model.managers.user_cfc
$cf.udfCall(/home/jimrising/workspace/svn_fiduciaryEdge/trunk/model/
managers/User.cfc:12):12
        at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:140):140
        at railo.runtime.type.UDFImpl._call(UDFImpl.java:293):293
        at railo.runtime.type.UDFImpl.call(UDFImpl.java:260):260
        at railo.runtime.ComponentImpl._call(ComponentImpl.java:399):399
        at railo.runtime.ComponentImpl._call(ComponentImpl.java:331):331
        at railo.runtime.ComponentImpl.call(ComponentImpl.java:1496):1496
        at railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues
(VariableUtilImpl.java:617):617
        at railo.runtime.PageContextImpl.getFunction(PageContextImpl.java:
1252):1252
        at workspace.svn_fiduciaryedge.trunk.handlers.user_cfc$cf.udfCall(/
home/jimrising/workspace/svn_fiduciaryEdge/trunk/handlers/user.cfc:15):
15
        at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:140):140
        at railo.runtime.type.UDFImpl._call(UDFImpl.java:293):293
        at railo.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:253):
253
        at railo.runtime.ComponentImpl._call(ComponentImpl.java:400):400
        at railo.runtime.ComponentImpl._call(ComponentImpl.java:331):331
        at railo.runtime.ComponentImpl.callWithNamedValues(ComponentImpl.java:
1511):1511
        at railo.runtime.tag.Invoke.doComponent(Invoke.java:236):236
        at railo.runtime.tag.Invoke.doEndTag(Invoke.java:192):192
        at coldbox.system.controller_cfc$cf.udfCall4(/home/jimrising/Desktop/
railo-express/webroot/coldbox/system/controller.cfc:445):445
        at coldbox.system.controller_cfc$cf.udfCall(/home/jimrising/Desktop/
railo-express/webroot/coldbox/system/controller.cfc):-1
        at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:140):140
        at railo.runtime.type.UDFImpl._call(UDFImpl.java:293):293
        at railo.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:253):
253
        at railo.runtime.ComponentImpl._call(ComponentImpl.java:400):400
        at railo.runtime.ComponentImpl._call(ComponentImpl.java:331):331
        at railo.runtime.ComponentImpl.callWithNamedValues(ComponentImpl.java:
1515):1515
        at railo.runtime.util.VariableUtilImpl.callFunctionWithNamedValues
(VariableUtilImpl.java:651):651
        at railo.runtime.PageContextImpl.getFunctionWithNamedValues
(PageContextImpl.java:1267):1267
        at coldbox.system.coldbox_cfc$cf.udfCall1(/home/jimrising/Desktop/
railo-express/webroot/coldbox/system/coldbox.cfc:163):163
        at coldbox.system.coldbox_cfc$cf.udfCall(/home/jimrising/Desktop/
railo-express/webroot/coldbox/system/coldbox.cfc):-1
        at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:140):140
        at railo.runtime.type.UDFImpl._call(UDFImpl.java:293):293
        at railo.runtime.type.UDFImpl.call(UDFImpl.java:260):260
        at railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues
(VariableUtilImpl.java:622):622
        at railo.runtime.PageContextImpl.getFunction(PageContextImpl.java:
1252):1252
        at workspace.svn_fiduciaryedge.trunk.application_cfc$cf.udfCall(/home/
jimrising/workspace/svn_fiduciaryEdge/trunk/Application.cfc:51):51
        at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:140):140
        at railo.runtime.type.UDFImpl._call(UDFImpl.java:293):293
        at railo.runtime.type.UDFImpl.call(UDFImpl.java:260):260
        at railo.runtime.ComponentImpl._call(ComponentImpl.java:399):399
        at railo.runtime.ComponentImpl._call(ComponentImpl.java:331):331
        at railo.runtime.ComponentImpl.call(ComponentImpl.java:1496):1496
        at railo.runtime.listener.ModernAppListener.call
(ModernAppListener.java:280):280
        at railo.runtime.listener.ModernAppListener._onRequest
(ModernAppListener.java:100):100
        at railo.runtime.listener.MixedAppListener.onRequest
(MixedAppListener.java:23):23
        at railo.runtime.PageContextImpl.execute(PageContextImpl.java:1651):
1651
        at railo.runtime.engine.CFMLEngineImpl.serviceCFML
(CFMLEngineImpl.java:248):248
        at railo.loader.servlet.CFMLServlet.service(CFMLServlet.java:32):32
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853):853
        at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:
491):491
        at org.mortbay.jetty.servlet.ServletHandler.handle
(ServletHandler.java:367):367
        at org.mortbay.jetty.security.SecurityHandler.handle
(SecurityHandler.java:185):185
        at org.mortbay.jetty.servlet.SessionHandler.handle
(SessionHandler.java:181):181
        at org.mortbay.jetty.handler.ContextHandler.handle
(ContextHandler.java:689):689
        at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:
391):391
        at org.mortbay.jetty.handler.ContextHandlerCollection.handle
(ContextHandlerCollection.java:146):146
        at org.mortbay.jetty.handler.HandlerCollection.handle
(HandlerCollection.java:114):114
        at org.mortbay.jetty.handler.HandlerWrapper.handle
(HandlerWrapper.java:139):139
        at org.mortbay.jetty.Server.handle(Server.java:285):285
        at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:
457):457
        at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete
(HttpConnection.java:751):751
        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:500):500
        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:209):
209
        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:357):
357
        at org.mortbay.io.nio.SelectChannelEndPoint.run
(SelectChannelEndPoint.java:329):329
        at org.mortbay.thread.BoundedThreadPool$PoolThread.run
(BoundedThreadPool.java:475):475


--~--~---------~--~----~------------~-------~--~----~
Before posting questions to the group please read:
http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer

You received this message because you are subscribed to the Google Groups 
"transfer-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/transfer-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to