How to use spring 3.X annotation without any .xml configuration
问题 I'm new to Spring and I don't like to use .xml as the spring configuration. So I want to use only annotation. Following is my test code, it works well without spring, but if I use DI and add annotation "@Resource", I get NullPointException, could anyone help with it, thanks a lot. I have imported related jar of spring already. It's a producer-consumer case, and I want to inject the resource-pool to producer and consumer. Producer.java import javax.annotation.Resource; public class Producer