Rick-Rainer Ludwig [
https://community.jboss.org/people/rick-rainer.ludwig] created the
discussion
"Re: JBoss AS 7.1.1.Final custom login module for remoting and custom
principal"
To view the discussion, visit:
https://community.jboss.org/message/759783#759783
--------------------------------------------------------------
I have exactly the same issue with JBoss 7.1.1. For the ClassCastException itself, I do
not have a solution, but I have a workaround which works until I have a clean and staight
solution.
When retrieving the principal via
@Resource
public SessionContext sessionContext;
...
Principal principal = sessionContext.getCallerPrincipal();
I check the name of the instantiated class via
principal.getClass().getName(). equals(MyExpectedPrincipalClass.class.getName())
to assure the correct implementation and to avoid later exceptions. Then I work with
reflection to access fields and method via getMethod() and getField(). It works fine, but
it is quite ugly. Does anyone have a better idea?
--------------------------------------------------------------
Reply to this message by going to Community
[
https://community.jboss.org/message/759783#759783]
Start a new discussion in JBoss AS 7 Development at Community
[
https://community.jboss.org/choose-container!input.jspa?contentType=1&...]