Help with setting up remote facade w/ coldspring

5 views
Skip to first unread message

Josh Grauer

unread,
Jun 8, 2009, 10:29:37 PM6/8/09
to ColdSpring-Users
My application is using ColdSpring 1.2 and Model-Glue Unity. I have a
remoteFacade.cfc that I'd like to have ColdSpring setup on application
start. What I've done is define the remoteFacade bean and set lazy-
init=false. I also have it pass other required beans into the facade
using constructor arguments. The problem I've run into is that if I
try to call a method within the facade that uses one of those other
beans it fails with error:

Element INSERTBEANNAMEHERE is undefined in a Java object of type class
[Ljava.lang.String;.

Here is how I have the remoteFacade bean configured in ColdSpring.xml:

<bean id="remoteFacade" class="MDS.model.remoteFacade" lazy-
init="false">
<constructor-arg name="contentGateway"><ref bean="contentGateway" /
></constructor-arg>
</bean>

And here's how my remoteFacade.cfc looks:

<cfcomponent displayName="Remote Facade" output="false">

<cffunction name="init" access="public" returnType="any"
output="false">
<cfargument name="contentGateway" />
<cfset VARIABLES.contentGateway = ARGUMENTS.contentGateway />
<cfreturn this />
</cffunction>

<cffunction name="getTest" access="remote" returnType="any"
output="false">
<cfreturn VARIABLES.contentGateway.getTest() />
</cffunction>

</cffunction>

Any ideas why the contentGateway bean is not being injected into my
remoteFacade? I've searched but I've mostly seen examples of having
ColdSpring auto generate a remote proxy, which I didn't want to do
because I have other methods that I want included in the facade that
can't be auto generated.

- Josh
Message has been deleted

Mark Mandel

unread,
Jun 9, 2009, 1:53:02 AM6/9/09
to coldspri...@googlegroups.com
When remoting comes in, it creates a new instance of the defined CFC, so it has no knowledge of ColdSpring at that point.

In a situation where I want to have a very specific API for my remote facade, I create it with only public methods inside ColdSpring, and then use ColdSpring to expose those methods through a RemoteFactoryBean, that way you have full control of the API, but it is always ColdSpring aware.

Mark
--
E: mark....@gmail.com
W: www.compoundtheory.com

Josh Grauer

unread,
Jun 9, 2009, 2:32:34 PM6/9/09
to ColdSpring-Users
Ok, that makes sense. I went in and changed the methods in
remoteFacade.cfc to public and then defined my remote proxy in
ColdSpring. The only part I got tripped up on is the property
"beanFactoryName" that it asks for. I have no idea what Model-Glue
has defined it as. I saw an example on Ray Camden's blog that just
left that bit out, so I tried it without and it's working great.

Thanks for the quick response and help!

- Josh
> E: mark.man...@gmail.com
> W:www.compoundtheory.com
Reply all
Reply to author
Forward
0 new messages