2012-04-23 4 views
0

Spring.Net으로 응용 프로그램을 작성했습니다. 언제는 Spring.Net의 나는 예외를 가지고있다 ("...") GetObject를에 전화를 시도 :spring throwing error 객체의 정의를 찾을 수 없습니다.

'SystemConfiguration_Workspace_NewWorkspaceAction'라는 이름의 개체가 정의되어 있지 : 객체 [SystemConfiguration_Workspace_NewWorkspaceAction]

에 대한 정의를 찾을 수 없습니다

하지만 XML에 'SystemConfiguration_Workspace_NewWorkspaceAction'이라는 개체가 있습니다.

<?xml version="1.0" encoding="utf-8" ?> 
<spring> 

<typeAliases> 
<alias name="ContextMenuItemModelAlias" type="ElmoMotionControl.View.Model.ContextMenuItemModel, ElmoMotionControl.View.Model"/> 
</typeAliases> 

<objects xmlns="http://www.springframework.net" > 

<!--<description>An example that demonstrates simple IoC features.</description>--> 

<object id="WorkspaceTreeModel" type="ElmoMotionControl.View.Model.ContextMenuModel, ElmoMotionControl.View.Model" > 
    <property name="ContextMenus" ref="WorkspaceTreeModelDicProp"/> 
</object> 

<!-- _______________________The dictionary item______________________ --> 
<object id ="WorkspaceTreeModelDicProp" type="System.Collections.Generic.Dictionary&lt;string, System.Collections.Generic.Dictionary&lt;string, System.Collections.Generic.List&lt;ContextMenuItemModelAlias>>>"> 
    <constructor-arg> 
     <dictionary key-type="string" value-type="System.Collections.Generic.Dictionary&lt;string, System.Collections.Generic.List&lt;ContextMenuItemModelAlias>>"> 
     <entry key="SystemConfiguration_Workspace" value-ref="SystemConfiguration_Workspace"/> 
     </dictionary> 
    </constructor-arg> 
</object> 
. 
. 
. 
</objects> 
</spring> 

무엇이 문제 일 수 있습니까?

+0

'SystemConfiguration_Workspace'와'SystemConfiguration_Workspace_NewWorkspaceAction' 객체 정의 만 볼 수 있습니다. – Marijn

+0

죄송합니다! GetObject ("WorkspaceTreeModel") 을 사용하여 시도한 결과 "WorkspaceTreeModel"과 함께 동일한 오류가 발생했습니다. –

+0

'SystemConfiguration_Workspace'가 'SystemConfiguration_Workspace_NewWorkspaceAction'으로 설정된 프로퍼티 또는 생성자를 가지고있을 수 있습니까? – Marijn

답변

0

이 내 전체 XML입니다 :

<?xml version="1.0" encoding="utf-8" ?> 
<spring> 
    <typeAliases> 
     <alias name="ContextMenuItemModelAlias" type="ElmoMotionControl.View.Model.ContextMenuItemModel, ElmoMotionControl.View.Model"/> 
    </typeAliases> 

    <objects xmlns="http://www.springframework.net" > 
    <object id="WorkspaceTreeModel" type="ElmoMotionControl.View.Model.ContextMenuModel, ElmoMotionControl.View.Model" > 
     <property name="ContextMenus" ref="WorkspaceTreeModelDicProp"/> 
    </object> 

<!-- _______________________The dictionary item______________________ --> 
    <object id ="WorkspaceTreeModelDicProp" type="System.Collections.Generic.Dictionary&lt;string, System.Collections.Generic.Dictionary&lt;string, System.Collections.Generic.List&lt;ContextMenuItemModelAlias>>>"> 
     <constructor-arg> 
     <dictionary key-type="string" value-type="System.Collections.Generic.Dictionary&lt;string, System.Collections.Generic.List&lt;ContextMenuItemModelAlias>>"> 
     <entry key="SystemConfiguration_Workspace" value-ref="SystemConfiguration_Workspace"/> 
     </dictionary> 
    </constructor-arg> 
</object> 

<!--____________Context Menu Items Lists_______________--> 

<object id="SystemConfiguration_Workspace" type="System.Collections.Generic.Dictionary&lt;string, System.Collections.Generic.List&lt;ContextMenuItemModelAlias>>"> 
    <constructor-arg> 
     <dictionary key-type="string" value-type="System.Collections.Generic.List&lt;ContextMenuItemModelAlias>"> 
      <entry key="SystemConfiguration_Workspace_NewWorkspace" value-ref="SystemConfiguration_Workspace_NewWorkspace1"/> 
     </dictionary> 
    </constructor-arg> 
</object> 

<object id="SystemConfiguration_Workspace_NewWorkspace1" type="System.Collections.Generic.List &lt;ContextMenuItemModelAlias>"> 
    <constructor-arg> 
     <list element-type="ContextMenuItemModelAlias"> 
      <ref object="SystemConfiguration_Workspace_NewWorkspace"/> 
     </list> 
    </constructor-arg> 
</object> 

<!--_____________________Contecxt Menu Items_______________________--> 
<object id="SystemConfiguration_Workspace_NewWorkspace" type="ContextMenuItemModelAlias"> 
    <constructor-arg name="name" value="SystemConfiguration_Workspace_NewWorkspace"/> 
    <constructor-arg name="isEnable" value="true"/> 
    <constructor-arg name="action" ref="SystemConfiguration_Workspace_NewWorkspaceAction"/> 
</object> 

<!--_________________________Actions____________________________--> 
<object id="SystemConfiguration_Workspace_NewWorkspaceAction" type="ElmoMotionControl.Activity.Action.SystemConfigurationActivitySelectionAction, ElmoMotionControl.Activity.Action"/> 
</objects> 
</spring> 

"SystemConfiguration_Workspace"는 XML의 개체입니다. Spring.Net이 그 인스턴스를 생성하기를 원합니다. SystemConfiguration_Workspace에없는 SystemConfiguration_Workspace_NewWorkspaceAction으로 구성된 속성 또는 생성자가 있다고 생각하지 않습니다.

+0

고마워요! 나는 그 문제가 무엇인지 모르지만 모든 수준에서 수업을 들었습니다. List를 포함하는 하나의 클래스, 문자열 사전과 마지막 클래스를 포함하는 하나의 클래스와 문자열과 마지막 클래스를 포함하는 하나의 클래스. 이 클래스에 XML을 작성하는 것이 간단했습니다. 마리안, 귀하의 도움과 관용에 감사드립니다. 정말 감사. –

+0

반갑습니다. 모든 사람들이 문제가 해결되었음을 알 수 있도록 자신의 대답을 수락하십시오. SO가 당신의 대답을 받아들이 기까지 하루 이틀이 걸릴 수도 있습니다. – Marijn

+0

O.K 감사합니다. 안녕하세요. –

0

덕분에, 나는 내 문제

나는 문제가 무엇인지 모르는

를 해결 계승한다, 그러나 나는 모든 수준에 클래스를했다.

List를 포함하는 하나의 클래스, string 사전과 마지막 클래스를 포함하는 하나의 클래스와 문자열과 마지막 클래스를 포함하는 하나의 클래스.

해당 클래스에 XML을 만드는 것이 간단했습니다.

관련 문제