[jbossseam-issues] [JBoss JIRA] Resolved: (JBSEAM-3704) CLONE - Adding New Role to Group fails

Julien Hattier (JIRA) jira-events at lists.jboss.org
Mon Nov 17 12:21:46 EST 2008


     [ https://jira.jboss.org/jira/browse/JBSEAM-3704?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Julien Hattier resolved JBSEAM-3704.
------------------------------------

    Fix Version/s: 2.1.0.SP1
       Resolution: Done


So, the problem had is Origin in the JpaIdentityManager, line 425 :
Collection roleGroups = (Collection) roleGroupsProperty.getValue(targetRole); 

My Entity was define with the following statement for the RoleGroups Property :
@RoleGroups
@ManyToMany(targetEntity = org.summerschool.entities.security.Role.class)
@JoinTable(name = "RoleGroups",	joinColumns = @JoinColumn(name = "RoleId"),	inverseJoinColumns = @JoinColumn(name = "GroupId"))
private Set<Role> groups;

I had to initialize the field like this : 
private Set<Role> groups = new HashSet<Role>();

It solved the issue easily. But maybe someone can modify the JpaIdentityManager in order to tolerate this.

> CLONE - Adding New Role to Group fails
> --------------------------------------
>
>                 Key: JBSEAM-3704
>                 URL: https://jira.jboss.org/jira/browse/JBSEAM-3704
>             Project: Seam
>          Issue Type: Bug
>          Components: Examples, Security
>    Affects Versions: 2.1.0.GA
>         Environment: JDK 5
> JBoss AS 4.2.3
>            Reporter: Julien Hattier
>            Assignee: Shane Bryzak
>             Fix For: 2.1.0.SP1
>
>
> I am getting ClassCastException when trying to add new role. To reproduce try adding new role that will be member of some other exsting role,
> using identityManager.addRoleToGroup().
> Here is the output involved :
> Caused by java.lang.ClassCastException with message: "sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl cannot be cast to java.lang.Class"
> org.jboss.seam.security.management.JpaIdentityStore.addRoleToGroup(JpaIdentityStore.java:425)
> org.jboss.seam.security.management.IdentityManager.addRoleToGroup(IdentityManager.java:158)
> ...
> I'm workin on a jetty/easybeans server and the security components works well when I'm not using groups. I use the same entity objects User and Role as given in the documentation.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the seam-issues mailing list