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 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 ]
        arjen.poutsma Arjen Poutsma made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          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