after thinking a lot about DIP, it was kinda clear, that we need to refactor some stuff… ok not really the thinking part, more the discusting part… a big beans.xml file sucks… and analysing my beanx.xml showed, that one small component is used everywhere and a lot of injects only where this one class…
first, something about a concept… in my opinion there are two ways for dependency injection… the one where a config file injects classes to others and the one where the class, wishes to get an injection… secondly is @Resource, @Autowired…
and in my project, i thought the one class, which is used almost everywhere should be get by @Autowired… and actually it was an static class, where the key-value configuration out of the db is loaded… so simply refactored it…
and the main problem was: tell spring, that it should autowire!
<context:annotation-config />
<context:component-scan base-package=“[class name]” />
after adding this few lines to the beans.xml, it actually found the [class name] in time and could inject it 🙂
crap config!