If a bean is annotated with @Primary or the attribute primary is set on the <bean> element, then the injection mechanism choose the primary configured bean as first choice if more than one candidate are qualified. This works fine with usage of @Autowired or @Inject.
By resolve the bean over the application context, I expected the same behaviour. Because the DefaultListableBeanFactory implementation of <T> T getBean(Class<T> requiredType) method doesn't check the the primary attribute of BeanDefinition, a NoSuchBeanDefinitionException is thrown in case of multiple qualified bean candidates regardless the the primary qualification.
I posted a workaround solution in my blog: http://develop.nydi.ch/2010/12/spring-primary-bean-injection/
To reproduce this behavior you can run the following JUnit test case.