-
1. Re: Login from Timerbean
jaikiran Aug 16, 2013 2:39 AM (in response to podiki)Use @RunAsPrinicipal or @RunAs (depending on your need) on the Timer bean which invokes the batch bean.
-
2. Re: Login from Timerbean
podiki Aug 16, 2013 3:45 AM (in response to jaikiran)I thought those didn't work in JBoss 7.x. Ok, I will try them out.
I don't seem to have @RunAsPrincipal though. In what package is this annotation? And what maven dependency would that be? As I can only find it in 'jboss:jboss-annotations-ejb3:4.2.2.GA' which doesn't look good to me...
Thank you for your response.
-
3. Re: Login from Timerbean
jaikiran Aug 16, 2013 4:35 AM (in response to podiki)1 of 1 people found this helpfulorg.jboss.ejb3:ejb3-ext-api is the Maven co-ordiante and the fully qualified annotation names are @org.jboss.ejb3.annotation.RunAsPrincipal and @org.jboss.ejb3.annotation.@RunAs
-
4. Re: Login from Timerbean
podiki Aug 16, 2013 7:08 AM (in response to jaikiran)@RunAsPrincipal is in that package, but @RunAs isn't.
An EJB that is annotated with @RunAsPrincipal, can I just get a reference with @EJB? Or do I have to do a context lookup?
-
5. Re: Login from Timerbean
jaikiran Aug 16, 2013 9:27 AM (in response to jaikiran)1 of 1 people found this helpfuljaikiran pai wrote:
and @org.jboss.ejb3.annotation.@RunAs
Sorry that's a typo. That should be @javax.annnotation.security which is part of Java EE and not specific to JBoss.
-
6. Re: Login from Timerbean
jaikiran Aug 16, 2013 9:29 AM (in response to podiki)Podiki Stifado wrote:
An EJB that is annotated with @RunAsPrincipal, can I just get a reference with @EJB? Or do I have to do a context lookup?
The presence or absence of @RunAsPrincipal on a EJB doesn't change the way you get hold of the EJB. So both @EJB and a manual lookup should work irrespective of whether or not that annotation is used.