Results 1 to 2 of 2

Thread: Spring unit testing EJB with mappedName

  1. #1
    Join Date
    Jun 2008
    Posts
    3

    Default 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. #2
    Join Date
    Feb 2012
    Posts
    1

    Default

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

    Ravi

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •