java.lang.ClassNotFoundException error using enum as a key in Map

Posted by LCYSoft on Stack Overflow See other posts from Stack Overflow or by LCYSoft
Published on 2013-10-26T00:56:47Z Indexed on 2013/10/26 3:54 UTC
Read the original article Hit count: 176

Filed under:
|
|
<util:map id="myMap" key-type="com.myClass.Foo.myEnum" value-type="com.myClass.Foo">
    <entry>
        <key>
            <value type="com.myClass.Foo.myEnum">ONE</value>
        </key>
        <ref bean="myObj"/>
    </entry>
</util:map>



package com.myClass
public class Foo {
    public enum myEnum {ONE, TWO;}
}

I am trying to create a map from Spriong 2.5.

Map<myEnum, Foo> myMap;

I am getting

nested exception is java.lang.ClassNotFoundException:com.myClass.Foo.myEnum

I definitely have com.myClass.Foo.myEnumin com.myClass.Foo I don't know why I am getting java.lang.ClassNotFoundException

Thanks in advance

© Stack Overflow or respective owner

Related posts about java

Related posts about spring