Menu

Using factory beans with 3.0.0M2?

Users
2005-09-12
2013-04-08
  • Kalle Korhonen

    Kalle Korhonen - 2005-09-12

    I might be doing something wrong, but if I try to instantiate a factory created Spring bean which scope is managed by JSF, I get an exception "FactoryBean must be defined as singleton - FactoryBeans themselves are not allowed to be prototypes". I have defined a spring bean with: singleton="false" factory-bean="dataFactory" factory-method="getData" and this used to work in 3.0.0M1. Even after looking at the examples in testsuite (which btw, are not part of the release - is this intentional or not?) it wasn't immediately obvious to me if you are supposed to do this somehow differently in 3.0.0M2. Referring to Spring singletons work ok and from the examples, it looks as if you should still set the singleton to false and set the scope in faces-config if you want the bean scope to be managed by JSF (as in testsuite with numberBean defined in applicationContext & faces-config-scope). Has the way to configure this changed or is this a bug?

     
    • Kalle Korhonen

      Kalle Korhonen - 2005-09-13

      Got it. Since you now specify the scope with a jsf-spring class (as in spring.SessionScope), the actual spring managed bean scope has to be set to application.

       
    • Andreas Kuhrwahl

      sorry for the bad docs. we will release a documented version very soon

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.