Uploaded image for project: 'Spring Web Services'
  1. Spring Web Services
  2. SWS-718

Reloading the spring context does not refresh the MessageDispatcherServlet

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.2
    • Fix Version/s: 2.0.3
    • Component/s: Core
    • Labels:
      None

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

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open In Progress In Progress
        96d 17h 42m 1 Arjen Poutsma 17/Oct/11 2:21 AM
        In Progress In Progress Resolved Resolved
        56m 31s 1 Arjen Poutsma 17/Oct/11 3:18 AM
        Resolved Resolved Closed Closed
        200d 3h 45m 1 Arjen Poutsma 04/May/12 7:03 AM

          People

          • Assignee:
            arjen.poutsma Arjen Poutsma
            Reporter:
            j.gorter Johan Gorter
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - Not Specified
              Not Specified
              Logged:
              Time Spent - 55m
              55m