Announcement Announcement Module
Collapse
No announcement yet.
Autowired property is null, certain I'm not creating objects properly but why? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Autowired property is null, certain I'm not creating objects properly but why?

    The XML config:
    Code:
    <util:map id="simpleConfiguration">
        <entry key="item1" value="value1" />
    </util:map>
    The class and instantiation
    Code:
    @Component
    class Foobar {
        @Resource(name='simpleConfiguration')
        private configuration
    }
    
    Foobar fb = new Foobar();
    This is pretty much what I am doing. I know that the component scan is working, other classes in the same namespace are fine.

    the configuration property of Foobar is null, and I don't know why, but I suspect it's because what I'm doing to create an instance of Foobar is too easy

    I am sorry if this has been asked before, I'm not clear what to search for. Instantiating @components didn't really reveal much

    thanks in advance
Working...
X