2012-04-23 9 views
0

Spring.Netでアプリケーションを作成しました。 『SystemConfiguration_Workspace_NewWorkspaceAction』という名前のオブジェクトが定義されていないスプリングスローエラーオブジェクトの定義が見つかりません

::オブジェクトの定義を見つけることができない[SystemConfiguration_Workspace_NewWorkspaceAction]

私はSpring.NetのGetObject関数(「...」)を呼び出すしようとすると、私は例外を持っています

しかし、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

ありがとう!私は何が問題なのか分かりませんが、私はあらゆるレベルにクラスを行いました。リストを含む1つのクラス、文字列の辞書と最後のクラス、文字列と最後のクラスを含む1つのクラスを含む1つのクラス。そのクラスにXMLを作成するのは簡単でした。 マリン、ご協力いただき、ありがとうございます。ほんとうにありがとう。 –

+0

ようこそ。あなたの問題が解決されたことを誰もが分かるように、あなた自身の答えを受け入れてください。あなたが自分の答えを受け入れることができるようになるまでには、それは1日か2日かかります。 – Marijn

+0

O.K ありがとうございました おはよう –

0

おかげで、私は成功し、私が問題だったのか分からないが、私はすべてのレベルにクラスをした私の問題

を解決しました。

Listを含む1つのクラス、文字列の辞書と最後のクラス、文字列と最後のクラスを含む1つのクラスを含む1つのクラス。

XMLをそのクラスに作成するのは簡単でした。

関連する問題