Announcement Announcement Module
Collapse
No announcement yet.
Spring unit testing EJB with mappedName Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring unit testing EJB with mappedName

    I have an EJB with a reference to another EJB through @EJB annotation +mappedName attribute.

    When I try to unit test the EJB out-of-container using SpringJUnit4ClassRunner, autowiring the bean causes Spring to try to look up the referenced bean from JNDI. Spring documentation states this is done by default because of the mappedName attribute.

    Is there a nice way to change this behaviour, to inject a bean from application context and not lookup from JNDI? Or what would be the proper workaround?

  • #2
    I am also struck on same problem.
    Did you find any solution so far.

    Ravi

    Comment

    Working...
    X