Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reloading the spring context does not refresh the MessageDispatcherServlet [SWS-718] #700

Closed
gregturn opened this issue Jul 12, 2011 · 2 comments
Assignees
Milestone

Comments

@gregturn
Copy link
Member

@gregturn gregturn commented Jul 12, 2011

Johan Gorter opened SWS-718 and commented

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);
		}
	}
}

Affects: 2.0.2

Referenced from: commits 4b89c40

@gregturn
Copy link
Member Author

@gregturn gregturn commented Oct 17, 2011

Arjen Poutsma commented

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

@gregturn
Copy link
Member Author

@gregturn gregturn commented May 4, 2012

Arjen Poutsma commented

Closing old issues

@gregturn gregturn closed this May 4, 2012
@gregturn gregturn added this to the 2.0.3 milestone Sep 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.