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

        j.gorter Johan Gorter created issue -
        arjen.poutsma Arjen Poutsma made changes -
        Field Original Value New Value
        Fix Version/s 2.0.3 [ 12197 ]
        Assignee Arjen Poutsma [ arjen.poutsma ]
        arjen.poutsma Arjen Poutsma made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        arjen.poutsma Arjen Poutsma logged work - 17/Oct/11 3:17 AM
        • Time Spent:
          55m
           
          <No comment>
        arjen.poutsma Arjen Poutsma made changes -
        Time Spent 55m [ 3300 ]
        Worklog Id 28435 [ 28435 ]
        arjen.poutsma Arjen Poutsma made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        arjen.poutsma Arjen Poutsma added a comment -

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

        Show
        arjen.poutsma Arjen Poutsma added a comment - Fixed. MessageDispatcherServlet.onRefresh now calls the new initDefaultStrategies method, just like the normal DispatcherServlet does.
        Hide
        arjen.poutsma Arjen Poutsma added a comment -

        Closing old issues

        Show
        arjen.poutsma Arjen Poutsma added a comment - Closing old issues
        arjen.poutsma Arjen Poutsma made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        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