2011-01-17 4 views

Antwort

0

Ich denke, es ist ein Fehler in einem Spring.NET Spring.Web.Mvc.SpringControllerFactory:

protected override IController GetControllerInstance(RequestContext requestContext, Type controllerType) 
{ 
    IController controllerInstance = null; 
    if (controllerType != null) 
    { 
     IDictionary objectsOfType = ApplicationContext.GetObjectsOfType(controllerType); 
     if (objectsOfType.Count > 0) 
     { 
      controllerInstance = (IController)objectsOfType.Cast<DictionaryEntry>().First<DictionaryEntry>().Value; 
     } 
    } 
    else // there should be if (contollerInstance == null) 
    { 
     controllerInstance = base.GetControllerInstance(requestContext, controllerType); 
    } 
    this.AddActionInvokerTo(controllerInstance); 
    return controllerInstance; 
} 

Wenn ControllerInstance kann nicht von einem Federbehälter gewonnen werden - es sollte von einer Basisklasse abgerufen werden (DefaultControllerFactory) .

+0

Dieses Problem wurde gemeldet und für 2.0 M1 behoben. Siehe [SPRNET-1482] (https://jira.springsource.org/browse/SPRNET-1482) –

2

Ich hatte das gleiche Problem. In meinem Fall verwendete ich Spring.NET Dependency Injection und ich habe vergessen, die AccountController Objektabhängigkeit in der XML-Datei zu deklarieren.

Ein Jahr später hoffe ich, dass dies jemandem hilft.

Verwandte Themen