@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, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content