Home > Net >  Abnormal WebApi interface to access problem. An error occurred when trying to create "testContr
Abnormal WebApi interface to access problem. An error occurred when trying to create "testContr

Time:09-16

Error message is as follows:
"Message" : "there is an error,,"
"ExceptionMessage" : "trying to create" testController "type of error controller, please make sure that the controller has a parameterless public constructor,",
"ExceptionType" : "System. InvalidOperationException,"
"StackTrace" : "ats System. Web. Http. Dispatcher. DefaultHttpControllerActivator. Create (HttpRequestMessage request, HttpControllerDescriptor controllerDescriptor, Type controllerType)
The ats System. Web. Http. Controllers. HttpControllerDescriptor. CreateController (HttpRequestMessage request)
The ats System. Web. Http. Dispatcher. HttpControllerDispatcher. & lt; SendAsync & gt; D__1. MoveNext ()

This error is not appear every time, occasionally appear this error page call interface,
Trouble ask help to look at the great god, where is the problem really out,

CodePudding user response:

Someone someone?

CodePudding user response:

In addition to the mode what else can I do?

CodePudding user response:

TestController have multiple? With something of the IOC container? To have too little information

CodePudding user response:

Dependency injection problem and see the inside of the controller constructor does service problems which instantiates the
Or
Controller of static field assignment is abnormal

CodePudding user response:

Described more comprehensively, such as Posting your testcontrol code, whether as 4 l say with the ioc?

CodePudding user response:

Did you solve? I also encountered this problem today

CodePudding user response:

Element namespace "objects" in the "http://www.springframework.net", "http://www.springframework.net"> child element namespace in the objcet, invalid, should be a list of possible elements: namespace "http://www.springframework.net" in the "import, alias, object", and the namespace "# # other" in any of the element,
Note: during the execution of the current Web request, abnormal untreated, please check the stack trace, to learn about the errors and mistakes in the code of the source of detailed information,

Exception details: System. Xml. Schema. XmlSchemaValidationException: element namespace "objects" in the "http://www.springframework.net", "http://www.springframework.net"> child element namespace in the objcet, invalid, should be a list of possible elements: namespace "http://www.springframework.net" in the "import, alias, object", and the namespace "# # other" in any of the element,

The error source:


Line 28://GET/ScoreAnalysisManage:/
29: # region external interface
30: IuserServiceBll IuserServiceBll=SpringHelper. GetObject (" userServiceBll ");
31: IscoresServiceBll scoreservicebll=SpringHelper. GetObject (" scoresServiceBll ");
Line 32: private readonly WCFIOrganization basicQueryAllCollege=ServiceFactory. GetOrganizationService ();


The source file: g: \ ITOO \ ITOO ExamEval \ ITOO ExamEval. The Client \ Controllers \ ScoreAnalysisManage \ ScoreAnalysisManageController line cs: 30

CodePudding user response:

[XmlSchemaValidationException: element namespace "objects" in the "http://www.springframework.net", "http://www.springframework.net"> child element namespace in the objcet, invalid, should be a list of possible elements: namespace "http://www.springframework.net" in the "import, alias, object", and the namespace "# # other" in any of the elements,]
Spring. Objects. Factory. Xml. XmlObjectDefinitionReader. HandleValidation (Object sender, ValidationEventArgs args) in c: \ _prj \ Spring -.net \ SRC \ Spring \ Spring Core \ Objects \ Factory \ Xml \ XmlObjectDefinitionReader cs: 371
. System. Xml Schema. XmlSchemaValidator. SendValidationEvent (ValidationEventHandler eventHandler, Object sender, XmlSchemaValidationException e, XmlSeverityType severity) + 54
. System. Xml Schema. XmlSchemaValidator. ElementValidationError (XmlQualifiedName name, ValidationState context, ValidationEventHandler eventHandler, Object sender, String sourceUri, Int32 lineNo, Int32 linePos, XmlSchemaSet schemaSet) + 759
. System. Xml Schema. XmlSchemaValidator. ValidateElementContext (XmlQualifiedName elementName, Boolean& InvalidElementInContext) + 5354504
. System. Xml Schema. XmlSchemaValidator. ValidateElement (String localName, String namespaceUri, XmlSchemaInfo schemaInfo, String xsiType, String xsiNil, String xsiSchemaLocation, String xsiNoNamespaceSchemaLocation) + 142
System. Xml. XsdValidatingReader. ProcessElementEvent (+ 161)
System. Xml. XsdValidatingReader. ProcessReaderEvent () + 51
System. Xml. XsdValidatingReader. Read () + 49
System. Xml. XmlLoader. LoadNode (Boolean skipOverWhitespace) + 57
System. Xml. XmlLoader. LoadDocSequence (XmlDocument parentDoc) + 20
System. Xml. XmlLoader. Load (XmlDocument doc, XmlReader reader, Boolean preserveWhitespace) + 129
System. Xml. XmlDocument. Load (XmlReader reader) + 107
Spring. Util. ConfigXmlDocument. Load (XmlReader reader) in c: \ _prj \ Spring -.net \ SRC \ Spring \ Spring Core \ Util \ ConfigXmlDocument cs: 234
Spring. Objects. Factory. Xml. XmlObjectDefinitionReader. DoLoadObjectDefinitions (Stream, Stream, IResource resource) in c: \ _prj \ Spring -.net \ SRC \ Spring \ Spring Core \ Objects \ Factory \ Xml \ XmlObjectDefinitionReader cs: 295

CodePudding user response:

[TargetInvocationException: call target abnormal happens,]
System. RuntimeTypeHandle. CreateInstance (RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& CanBeCached RuntimeMethodHandleInternal& Ctor, Boolean& BNeedSecurityCheck) + 0
System. RuntimeType. CreateInstanceSlow (Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& StackMark) + 113
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  •  Tags:  
  • C #
  • Related