Here are my files and my directory: 

Spring-Module.xml

```
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
       http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"> 

<import resource="Spring-Datasource.xml" />
<import resource="Spring-User.xml" />

```

Spring-Datasource.xml

```
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
       http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">

<bean id="dataSource"
    class="org.springframework.jdbc.datasource.DriverManagerDataSource">

    <property name="driverClassName" value="com.mysql.jdbc.Driver" />
    <property name="url" value="VALID_URL" />
    <property name="username" value="USER" />
    <property name="password" value="PASS" />
</bean>

```

Spring-User.xml

```
<beans xmlns="http://www.springframework.org/schema/beans"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://www.springframework.org/schema/beans
             http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">

<bean id="userDAO" class="hello.JdbcUserDAO">
    <property name="dataSource" ref="dataSource" />
</bean>

```

Application.java

```
package hello;
<import statements>
@SpringBootApplication
public class Application {

public static void main(String[] args) {
    ApplicationContext context =
            new ClassPathXmlApplicationContext("Spring-Module.xml");
    SpringApplication.run(Application.class, args);

    UserDAO userDAO = (UserDAO) context.getBean("userDAO");
    }
}

```

RegistrationController.java

```
package hello;
@RestController
public class RegistrationController implements ApplicationContextAware {

private static final String template = "Hello, %s!";
//    @Autowired <-- using this instead of interface doesn't work either
private static ApplicationContext context;
private final AtomicLong counter = new AtomicLong();

@RequestMapping(value = "/api/register", method = RequestMethod.POST)
public Response registerUser(@RequestParam Map<String,String> req) {

    User user = new User(counter.incrementAndGet(),
                        req.get("first"), req.get("last"), req.get("email"), 
                        req.get("age"), Double.parseDouble(req.get("height")), 
                        Double.parseDouble(req.get("weight")), Double.parseDouble(req.get("bmi"))
                        );

    UserDAO userDAO = (UserDAO) context.getBean("userDAO"); // <--- error here
    userDAO.insert(user);

    return new Response(counter.get(), "200");
}

public static ApplicationContext getApplicationContext() {
    return context;
}

@Override
public void setApplicationContext(ApplicationContext ac) throws BeansException {
    this.context = ac;
    }

}

```

When I access the bean userDAO from the Application class, everything works perfectly and as expected. The problem is when I try to use the context to access userDAO from my route class, and it is throwing error 'bean userDAO not found'. Because of this I suspect that the context must be created again inside my route? 

I am relatively new to Spring and completely stumped! I will try to clarify any questions you guys have. 

Edit: Added directory
---------------------

```
   src/main/java/hello
      /resources
                /Spring-User.xml
                /Spring-Module.xml
                /Spring-Datasource.xml

```