[jboss-jira] [JBoss JIRA] Created: (SECURITY-290) Member variable for @UserPrincipal Annotation must be public even if there is a public getter for this member variable with @UserPrincipal Annotation

Marco Röà Marco RöÃ
Tue Oct 14 03:32:20 EDT 2008


Member variable for @UserPrincipal Annotation must be public even if there is a public getter for this member variable with @UserPrincipal Annotation
-----------------------------------------------------------------------------------------------------------------------------------------------------

                 Key: SECURITY-290
                 URL: https://jira.jboss.org/jira/browse/SECURITY-290
             Project: JBoss Security and Identity Management
          Issue Type: Bug
      Security Level: Public (Everyone can see)
         Environment: WinXp pro / eclpise 3.4 / Jboss Server 2.4 R
            Reporter: Marco Röösli
            Assignee: Anil Saldhana


I can't add @UserPrincipal just to a public getter Method.

My Entity:

....
@Column(name = "USERNAME", length = 16, nullable = false, unique = true)
private String username;


@UserPrincipal
public String getUsername() {
                return username;
}

With this code above i get this Error:

Caused by: java.lang.IllegalAccessException: Class org.jboss.seam.util.Reflections can not access a member of class ch.pomop.dummy.security.UserAccount with modifiers "private"
        at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:65)
        at java.lang.reflect.Field.doSecurityCheck(Field.java:954)
        at java.lang.reflect.Field.getFieldAccessor(Field.java:895)
        at java.lang.reflect.Field.get(Field.java:357)
        at org.jboss.seam.util.Reflections.get(Reflections.java:51)
        at org.jboss.seam.util.Reflections.getAndWrap(Reflections.java:88)
        ... 83 more
Is it necessary to set the members public? or is this a bug?

As i changed the my Entity Code to:

My Entity:


@UserPrincipal
@Column(name = "USERNAME", length = 16, nullable = false, unique = true)
public String username;

}
it worked but I don't want to set my members public if there is an other way


thx for help

-- 
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 jboss-jira mailing list