General

Where can I get more answers?

Beanoh Google Group (http://groups.google.com/group/beanoh).


Why can't I just use '@RunWith(SpringJUnit4ClassRunner.class)' to verify my Spring context?

This will only load the singleton beans. Beanoh loads all bean scopes (singleton, prototype, request, session, global session).


Why should I reconcile the classes marked with '@Component' in my classpath with the beans in my Spring context?

It is fairly easy to forget to component-scan the packages that contain beans marked with '@Component'. Beanoh provides a simple way to ignore components that you do not want to load in Spring. This feature empowers developers to decide which components should be loaded.


Is there any harm in having duplicate bean id's?

If multiple beans have the same id, the last bean loaded will win. This loading order is not guaranteed. If the bean definitions are not exactly the same, this can create subtle bugs that are very difficult to track down.


How do I import a Spring context file located in the WEB-INF folder?

Use a file resource.

<import resource="file:WebContent/WEB-INF/spring-ws-servlet.xml"/>

Why does 'assertUniqueBeanContextLoading' fail if I add a '<jdbc:embedded-database>' tag to my test bootstrap context.

The resulting 'org.springframework.beans.factory.config.BeanDefinition' returns null when you call the 'getResourceDescription' method. This information ties the definition back to the context file in which it was defined. Bootstrap context bean definitions are excluded when Beanoh looks for duplicate bean definitions. However if 'getResourceDescription' returns null there is no way to determine if the definition came from the test bootstrap context.

Use this instead:

<bean id="datasource" parent="beanohDataSource"/>