[jboss-user] [JBoss Portal] - Re: Easiest way to get the Current Users's Role?

djmacpac do-not-reply at jboss.com
Mon Nov 27 11:25:48 EST 2006


Hmm, that's the problem:

I get the UserName via 

  | String UserName = (String)req.getRemoteUser();
  | 

and i can get the Name via

  | java.security.Principal principal = req.getUserPrincipal();
  | 

Both works fine. But when I try to create a User like this

  | User user = (User)userModule.findUserByUserName(UserName);
  | 

I get following Error:

Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.apache.myfaces.el.PropertyResolverImpl.getProperty(PropertyResolverImpl.java:400)
	... 274 more
Caused by: java.lang.ClassCastException: org.jboss.portal.identity.db.UserImpl
	at $Proxy178.findUserByUserName(Unknown Source)
	at TreeBacker.check_access(TreeBacker.java:99)
	at TreeBacker.get_tree_rek(TreeBacker.java:143)
	at TreeBacker.getTreeData(TreeBacker.java:236)
	... 279 more


And I need the "User" to find his specified Role or???

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3988947#3988947

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3988947



More information about the jboss-user mailing list