6 Replies Latest reply on Oct 14, 2008 12:44 PM by Marco Röösli

    annotation @UserPrincipal can not add to a field

    Tony Lee Newbie

      if I add the annotation before a field like this:


      @UserPrincipal private String personUsername;


      show the errors:


      Caused by: org.jboss.seam.security.management.IdentityManagementException: Invalid userClass com.city6life.contract.model.Person - required annotation @UserPrincipal not found on any Field or Method.
           at org.jboss.seam.security.management.JpaIdentityStore.initProperties(JpaIdentityStore.java:132)
           at org.jboss.seam.security.management.JpaIdentityStore.init(JpaIdentityStore.java:111)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
           at java.lang.reflect.Method.invoke(Unknown Source)
           at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
           at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:126)
           at org.jboss.seam.Component.callComponentMethod(Component.java:2154)
           at org.jboss.seam.Component.callCreateMethod(Component.java:2077)
           at org.jboss.seam.Component.newInstance(Component.java:2037)
           ... 115 more


      but if I add it before a method like:


      @UserPrincipal public String getPersonUsername() {...}


      everything is OK


      is this a BUG?


      other security annotation are the same to