[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


 Description   

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;
 
	@Override
	protected void onRefresh(ApplicationContext context)
	{
		try {
			if (this.initializing) {
				this.initializing = false;
			} else {
				this.initFrameworkServlet();
			}
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}
}



 Comments   
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 Thu Dec 14 02:05:38 UTC 2017 using JIRA 6.4.14#64029-sha1:ae256fe0fbb912241490ff1cecfb323ea0905ca5.