@Autowired not working on EAP 6 when using EJB and Spring MVC

Solution Verified - Updated -

Issue

  • @Autowired bean always returns null when accessed through a Spring MVC web controller
  • On EAP 6 with Spring MVC 3.2 installed as a module, @Autowired beans don't work on EJBs
  • @Autowired not working on EAP 6 when using EJB and Spring MVC
  • When I'm using the Spring Framework as a module of the application, the class containing the annotation is simply not instantiated, generating a NullPointerException

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 6.2
  • Spring MVC
    • 3.2

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.