Access bean using @AutoWire outside component scan <p>I have a Java Project which is written using Spring and am having trouble with <code>@Autowire</code> of a bean. The declaration of the bean</p> <pre><code>&lt;beans:bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource"&gt; &lt;beans:property name="basenames" value="classpath:messages"/&gt; &lt;beans:property name="defaultEncoding" value="UTF-8" /&gt; &lt;/beans:bean&gt; </code></pre> <p>The bean is being autowired without issue in my class <code>BaseController</code> which falls under the component-scan</p> <pre><code>&lt;context:component-scan base-package="com.myproj.webservice.controller" /&gt; </code></pre> <p>I want to <code>@Autowire</code> in another class <code>MessageEnum</code> which does not fall under the <code>component-scan</code>. I have tried to add <code>autowire="byType"</code> and <code>autowire="byName"</code> to my bean declaration but the autowiring still did not work.</p> <p>Please find here also my code for the <code>MessageEnum</code> class</p> <pre><code>public enum MessageEnum{ ENUM1("someparam"), ENUM2("someparam2"); @Autorwire private MessageSource messageSource; private String param; //Constructors &amp; getParam and setParam methods public MessageSource getMessageSource() { return messageSource; } } </code></pre> <p>What am I missing here for the <code>messageSource</code> to be autowired?</p> <p>EDIT</p> <p>I tried to create the <code>MessageEnum</code> as a bean as advised here. I created the default constructor <code>MessageEnum() {}</code></p> <p>and set the bean in my xml</p> <pre><code>&lt;beans:bean id="messageEnum" class="com.myproj.webservice.util.MessageEnum"&gt; </code></pre> <p>but receive the error message</p> <pre><code>org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'messageEnum' defined in ServletContext resource [/WEB-INF/spring/appServlet/servlet-context.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.myproj.webservice.util.MessageEnum]: No default constructor found; nested exception is java.lang.NoSuchMethodException: com.myproj.webservice.util.MessageEnum.&lt;init&gt;() </code></pre>