Sorry, a ColdSpring BeanFactory named beanFactory was not found in application scope

118 views
Skip to first unread message

Robert Rawlins

unread,
Apr 5, 2013, 4:52:47 AM4/5/13
to coldspri...@googlegroups.com
Hello Guys,

Got a legacy CS application running CS1.2 and I'm having troubles defining a beanFactoryName for my remote services.

I define my remote proxy like so, in this instance exposing service methods to the task scheduler.


My application defined the bean factory onApplicationStart() and put it in to the application scope, like so.


When trying to use the remote service from the browser, I get an exception which says:

"Sorry, a ColdSpring BeanFactory named beanFactory was not found in application scope. Please make sure your bean factory is properly loaded. Perhapse your main application is not running?"

If I remove the explicit definition of the beanFactory from my XML for the remote proxy it inits and runs just fine, but presumably this creates a separate instance of the beanfactory for the remote proxy to use? which probably isn't very efficient on memory and alike.

Any advice welcome.

Thanks,

Rob

Brian Kotek

unread,
Apr 5, 2013, 9:30:40 AM4/5/13
to coldspri...@googlegroups.com
I'm reaching back into memory here, but if I recall, that error is probably not what is actually happening. If you look at the core remove proxy code, I think there is a try/catch block that will catch just about any error when trying to create the proxied bean and it will throw that exception because a missing bean factory was the most COMMON reason for it to fail. If memory serves (and it may not), you can try editing the remote proxy CFC to remove the cfthrow for that exception, and hopefully you'll then get a more accurate exception.


--
You received this message because you are subscribed to the Google Groups "ColdSpring-Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to coldspring-use...@googlegroups.com.
To post to this group, send email to coldspri...@googlegroups.com.
Visit this group at http://groups.google.com/group/coldspring-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Kevin didier jean Olivar

unread,
Apr 16, 2013, 3:49:08 AM4/16/13
to coldspri...@googlegroups.com
Hi there,

I am trying to implement remote proxies within my system (fw/1 and coldspring 1.2) that will be consumed by a third party.

However, I am facing different issues such as,
- the mappings defined in my application.cfc are not working
- the beans do not seem to be wired up

Below is the bespoke structure of my system

root folder
  + coldspring
  + com
     + remote
        + my remote proxies
  + application.cfc

In application.cfc, there are mappings to the com and coldspring folders. The bean factory is set in setupApplication() but I've tried to recreate an application.cfc under the 'remote' folder and have that bean factory set in the onRequestStart.
I've been banging my head on that for the past couple of days now, a bit of help will be appreciated !

Or if someone has successfully managed to implement similar task...that will be cool to know how this was achieved !

Cheers,
K.

Kevin didier jean Olivar

unread,
Apr 17, 2013, 10:28:02 PM4/17/13
to coldspri...@googlegroups.com
So, the wiring seems working now, I've added the 'lazy-init=false' option to my beans definitions. Now, the only problem is the mappings not being picked up but this was overcome by
- putting the remote proxies in the root folder (not good practice)
or
- adding a mapping through CF admin (but that defies the purpose of having the mappings defined in application.cfc)

Cheers,K.

Robert Rawlins

unread,
Jun 10, 2013, 10:35:17 AM6/10/13
to coldspri...@googlegroups.com
Hi Guys,

Dusting off this old peach of an issue today whilst working on some remote proxies I'm having to continually restart by dev server as changes aren't picked up as part of the app reinit because the remote proxies are running out of their own factory.

I have a remote proxy defined as so: https://gist.github.com/SirRawlins/35976fb9330b0cda1a9d

Without the "beanFactoryName" defined this remote service works just fine, albiet from it's own instance of the bean factory rather than the one I define for my application in onAppStart().

However when I define the factory it should use I get an exception, as described in the title of this thread.

Looking at the generated proxy file as suggested by Brian I remove the try/catch to try and get to the root of the issue however I still get a vague empty exception: https://gist.github.com/SirRawlins/4e3d3ce41b1510209c16

It seems that fot some reason that whatever is returned by bfUtils.getNamedFactory() isn't happy about supplying beans to the service.

Any suggestions on diagnosing this would be greatly appreciated.

Rob
Reply all
Reply to author
Forward
0 new messages