You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Guillaume Chauvet (JIRA)" <ji...@apache.org> on 2012/10/03 16:52:07 UTC

[jira] [Created] (OPENJPA-2272) Unable to instantiate proxy for type "java.util.EnumMap"

Guillaume Chauvet created OPENJPA-2272:
------------------------------------------

             Summary: Unable to instantiate proxy for type "java.util.EnumMap"
                 Key: OPENJPA-2272
                 URL: https://issues.apache.org/jira/browse/OPENJPA-2272
             Project: OpenJPA
          Issue Type: Bug
    Affects Versions: 2.2.0
            Reporter: Guillaume Chauvet


Dear OpenJPA team,

I have defined a EnumMap collection field like this :

@OneToMany(cascade = CascadeType.ALL, mappedBy = "settings")
@MapKeyColumn(name = "ENUMKEY")
@MapKeyEnumerated
private Map<FilterType, Ponderation> ponderations = new EnumMap<FilterType, Ponderation>(FilterType.class);

Generated tables are okay but when I launch my unit test I obtain this message :
<openjpa-2.2.0-r422266:1244990 fatal store error> org.apache.openjpa.persistence.RollbackException: Unable to instantiate proxy for type "java.util.EnumMap".  Make sure the class has a default constructor.

I understand OpenJPA needs collections with default constructor, but EnumMap needs the enum type as parameter. This means the EnumMap collection is not usable ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (OPENJPA-2272) Unable to instantiate proxy for type "java.util.EnumMap"

Posted by "Guillaume Chauvet (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-2272?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Guillaume Chauvet updated OPENJPA-2272:
---------------------------------------

      Priority: Minor  (was: Major)
    Issue Type: Improvement  (was: Bug)
    
> Unable to instantiate proxy for type "java.util.EnumMap"
> --------------------------------------------------------
>
>                 Key: OPENJPA-2272
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2272
>             Project: OpenJPA
>          Issue Type: Improvement
>    Affects Versions: 2.2.0
>            Reporter: Guillaume Chauvet
>            Priority: Minor
>
> Dear OpenJPA team,
> I have defined a EnumMap collection field like this :
> @OneToMany(cascade = CascadeType.ALL, mappedBy = "settings")
> @MapKeyColumn(name = "ENUMKEY")
> @MapKeyEnumerated
> private Map<FilterType, Ponderation> ponderations = new EnumMap<FilterType, Ponderation>(FilterType.class);
> Generated tables are okay but when I launch my unit test I obtain this message :
> <openjpa-2.2.0-r422266:1244990 fatal store error> org.apache.openjpa.persistence.RollbackException: Unable to instantiate proxy for type "java.util.EnumMap".  Make sure the class has a default constructor.
> I understand OpenJPA needs collections with default constructor, but EnumMap needs the enum type as parameter. This means the EnumMap collection is not usable ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (OPENJPA-2272) Unable to instantiate proxy for type "java.util.EnumMap"

Posted by "Guillaume Chauvet (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-2272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13469223#comment-13469223 ] 

Guillaume Chauvet commented on OPENJPA-2272:
--------------------------------------------

Hello Rick,

Thank you for your quick answer. I will replace EnumMap by an HashMap, for the moment.
                
> Unable to instantiate proxy for type "java.util.EnumMap"
> --------------------------------------------------------
>
>                 Key: OPENJPA-2272
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2272
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 2.2.0
>            Reporter: Guillaume Chauvet
>
> Dear OpenJPA team,
> I have defined a EnumMap collection field like this :
> @OneToMany(cascade = CascadeType.ALL, mappedBy = "settings")
> @MapKeyColumn(name = "ENUMKEY")
> @MapKeyEnumerated
> private Map<FilterType, Ponderation> ponderations = new EnumMap<FilterType, Ponderation>(FilterType.class);
> Generated tables are okay but when I launch my unit test I obtain this message :
> <openjpa-2.2.0-r422266:1244990 fatal store error> org.apache.openjpa.persistence.RollbackException: Unable to instantiate proxy for type "java.util.EnumMap".  Make sure the class has a default constructor.
> I understand OpenJPA needs collections with default constructor, but EnumMap needs the enum type as parameter. This means the EnumMap collection is not usable ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (OPENJPA-2272) Unable to instantiate proxy for type "java.util.EnumMap"

Posted by "Rick Curtis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-2272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13468841#comment-13468841 ] 

Rick Curtis commented on OPENJPA-2272:
--------------------------------------

I hate to break it to you, but it looks like this problem was pointed out a number of years ago[1].

> This means the EnumMap collection is not usable ?
Yes, I would say that is the case... It sounds like adding support for EnumMap is possible, but not probable.

Thanks,
Rick

[1] http://markmail.org/thread/43fvfqdpcpqke6xb
                
> Unable to instantiate proxy for type "java.util.EnumMap"
> --------------------------------------------------------
>
>                 Key: OPENJPA-2272
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2272
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 2.2.0
>            Reporter: Guillaume Chauvet
>
> Dear OpenJPA team,
> I have defined a EnumMap collection field like this :
> @OneToMany(cascade = CascadeType.ALL, mappedBy = "settings")
> @MapKeyColumn(name = "ENUMKEY")
> @MapKeyEnumerated
> private Map<FilterType, Ponderation> ponderations = new EnumMap<FilterType, Ponderation>(FilterType.class);
> Generated tables are okay but when I launch my unit test I obtain this message :
> <openjpa-2.2.0-r422266:1244990 fatal store error> org.apache.openjpa.persistence.RollbackException: Unable to instantiate proxy for type "java.util.EnumMap".  Make sure the class has a default constructor.
> I understand OpenJPA needs collections with default constructor, but EnumMap needs the enum type as parameter. This means the EnumMap collection is not usable ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira