ColdSpring with Spring on Model Glue and ColdBox

4 views
Skip to first unread message

ColdWarrior

unread,
Jun 3, 2009, 2:59:34 PM6/3/09
to ColdSpring-Users
In Model Glue there is the ability to do this:

<cfset ModelGlue_PARENT_BEAN_FACTORY = createObject( "component",
"model.coldspring.context.WebApplicationContextProxy" ).init() />

This allows you to use the WebApplicationContextProxy.cfc to load
Spring beans and tells Model Glue to use this
WebApplicationContextProxy (which extends
coldspring.beans.AbstractbeanFactory) to use this as your parent bean
factory. This way it runs in front of AbstractBeanFactory and
intercepts the bean requests to serve Spring beans in addition to
ColdSpring beans. (I haven't gotten this to work with MG, personally,
as I've been focusing on ColdBox, but others have been successful)

In ColdBox there is nothing like PARENT_BEAN_FACTORY (to my knowledge)
and so this is more difficult. I have tried using the
WebApplicationContextProxy.cfc and modified it with success to work
within ColdBox. However, this still requires me to use the
WebApplicationContextProxy as a factory for Spring beans within
ColdSpring rather than just extending Spring directly.

So, I was wondering if there was either a known way to use ColdSpring
in ColdBox and extend spring or if perhaps a feature could be added to
ColdSpring for extending Spring natively in ColdSpring by defining a
Spring Application Context to extend in the XML configuration file.
Any input would be great. I am running on JBoss 4.2.3, so my
environment is properly prepared for this.

I've looked at JavaSpringBeanFactoryAdapter but haven't been able to
figure out if it can load Spring the way I need with it. As of now, I
have an applicationContext.xml in my WEB-INF folder and the Spring
libraries in WEB-INF/lib. When I start JBoss it throws no errors and
starts correctly.

At this point, I'm not sure if this creates a bean factory for me to
use with the JavaSpringBeanFactoryAdapter or how exactly this works. I
haven't been able to find documentation.

Any help or suggestions are very welcome, thanks!!!

ColdWarrior

unread,
Jun 3, 2009, 4:12:58 PM6/3/09
to ColdSpring-Users
I have managed to get this working on ColdBox with the help of Luis. I
would still be interested in a native ColdSpring to Spring extender
though!

Jamie Krug

unread,
Jun 4, 2009, 10:55:08 AM6/4/09
to ColdSpring-Users
On Jun 3, 4:12 pm, ColdWarrior <dotfus...@changethings.org> wrote:
> I have managed to get this working on ColdBox with the help of Luis. I
> would still be interested in a native ColdSpring to Spring extender
> though!

Would you mind sharing some details on how you/Luis got this working
on ColdBox?

Thanks,
Jamie

whostheJBoss

unread,
Jun 5, 2009, 12:07:32 PM6/5/09
to ColdSpring-Users
Yes, I sure will! Your shared JARs guide helped start me off on this
path :)

I'll post something later today. The only thing I needed from Luis was
the final key, a setparent method for ColdSpring which I didn't think
was available in ColdBox, but it turned out that it was.

I had it working without ColdSpring, but it was ugly. It's flawless
now. I eventually wrote in Hibernate support and then managed that
through ColdSpring too. We are working on a Hibernate interceptor for
ColdBox to do all of this without Spring, although I like leveraging
Spring (Spring BlazeDS, etc)

I'll get you details when I get back this afternoon!
Reply all
Reply to author
Forward
0 new messages