-
1. Re: Identity not created
monkeyden Jul 19, 2007 10:08 AM (in response to monkeyden)Does anyone have a complete example which shows how to extend Identity? The only one I have seen was posted here, which I used as a model. Apparently not complete. I need to override this functionality. I need to prevent the error message from being global and make it SEVERITY_ERROR.
-
2. Re: Identity not created
gavin.king Jul 19, 2007 10:15 AM (in response to monkeyden)That looks fine. Do you see it being installed in the log?
-
3. Re: Identity not created
monkeyden Jul 19, 2007 10:23 AM (in response to monkeyden)Indeed it is:
Component: org.jboss.seam.security.identity, scope: SESSION, type: JAVA_BEAN, class: com.mycompany.pws.security.Identity
I even see the precedence play out:
two components with same name, higher precedence wins: org.jboss.seam.security.identity
two components with same name, higher precedence wins: org.jboss.seam.security.identity -
4. Re: Identity not created
gavin.king Jul 19, 2007 10:25 AM (in response to monkeyden)OK, now go to the debug page. Do you see it?
-
5. Re: Identity not created
monkeyden Jul 19, 2007 10:28 AM (in response to monkeyden)Yes, and it is of my type:
class - com.mycompany.pws.security.Identity
toString() - com.mycompany.pws.security.Identity@bae91d -
6. Re: Identity not created
gavin.king Jul 19, 2007 10:34 AM (in response to monkeyden)OK, now what do you see if you display the following on a facelets page:
identity=#{identity} org.jboss.seam.security.identity=#{org.jboss.seam.security.identity}
-
7. Re: Identity not created
monkeyden Jul 19, 2007 10:34 AM (in response to monkeyden)The issue appears to be strictly injection/autocreation. In stepping through the code, it appears that the base class's instance() method should work.
-
8. Re: Identity not created
monkeyden Jul 19, 2007 10:36 AM (in response to monkeyden)Same:
identity=com.mycompany.pws.security.Identity@bae91d org.jboss.seam.security.identity=com.mycompany.pws.security.Identity@bae91d -
9. Re: Identity not created
gavin.king Jul 19, 2007 10:38 AM (in response to monkeyden)What does Component.getInstance("identity") return, in one of the components where injection fails?
-
10. Re: Identity not created
monkeyden Jul 19, 2007 10:45 AM (in response to monkeyden)Both of these return the correct object:
Object idObj = Component.getInstance("identity");
Identity id = (com.mycompany.pws.security.Identity)Identity.instance(); -
11. Re: Identity not created
gavin.king Jul 19, 2007 11:03 AM (in response to monkeyden)OK then, step through Component.getValueToInject() in your debugger. Find out what is different.
-
12. Re: Identity not created
monkeyden Jul 19, 2007 12:06 PM (in response to monkeyden)That's a busy method! I've added a conditional breakpoint, so I don't have to respond to all calls to it:
return name.equals("identity") && bean instanceof {class in which injection is failing};
In every case it returns the correct object. It seems that the problem is happening after the call to getValueToInject (i.e. that it does with result).