dev@jersey.java.net

[jersey-spring] singleton registration

From: Pedro Teixeira <pedro.t_at_gmail.com>
Date: Wed, 23 Dec 2009 03:56:18 -0200

Hi folks,

I'm migrating from a 1.0.1 to the latest :)


The strategy offered in the wiki to configure spring does not really
work for all cases.


= Changing from:
            StaticListableBeanFactory factory = new StaticListableBeanFactory();
            factory.addBean("bayeux", bayeux);

= to:
            StaticListableBeanFactory factory = new StaticListableBeanFactory();
            DefaultListableBeanFactory listableBeanFactory = new
DefaultListableBeanFactory(factory);
            listableBeanFactory.registerSingleton("bayeux", bayeux);



worked for me.


Otherwise, I get
"org.springframework.beans.factory.NoSuchBeanDefinitionException" for
all @Autowired cases.



cheers,
Pedro