[SWS-718] Reloading the spring context does not refresh the MessageDispatcherServlet Created: 12/Jul/11  Updated: 04/May/12  Resolved: 17/Oct/11

Status: Closed
Project: Spring Web Services
Component/s: Core
Affects Version/s: 2.0.2
Fix Version/s: 2.0.3

Type: Bug Priority: Minor
Reporter: Johan Gorter Assignee: Arjen Poutsma
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: 55m
Original Estimate: Not Specified


Our application uses a special classloader from which it can load beans dynamically. The applicationcontext is reloaded to do this. The normal DispatcherServlet has a mechanism to allow the applicationcontext to be reloaded by overriding the onRefresh method. The MessageDispatcherServlet does not do this and crashes occur when webservices are invoked.

The class below can be used as a workaround.

public class FixedMessageDispatcherServlet
	extends MessageDispatcherServlet

	private boolean initializing = true;

	protected void onRefresh(ApplicationContext context)
		try {
			if (this.initializing) {
				this.initializing = false;
			} else {
		} catch (Exception e) {
			throw new RuntimeException(e);

Comment by Arjen Poutsma [ 17/Oct/11 ]

Fixed. MessageDispatcherServlet.onRefresh now calls the new initDefaultStrategies method, just like the normal DispatcherServlet does.

Comment by Arjen Poutsma [ 04/May/12 ]

Closing old issues

Generated at Sat Apr 20 06:59:09 UTC 2019 using JIRA 7.9.2#79002-sha1:3bb15b68ecd99a30eb364c4c1a393359bcad6278.