Page 1 of 1

About Question enthuware.oce-ejbd.v6.2.550 :

Posted: Thu Apr 21, 2011 4:22 am
by deadlock_gr
Typo:

// valid cdoe

-->

// valid code

Re: About Question enthuware.oce-ejbd.v6.2.550 :

Posted: Thu Apr 21, 2011 7:23 am
by admin
Fixed.
Thanks for the feedback!

Re: About Question enthuware.oce-ejbd.v6.2.550 :

Posted: Thu Jul 18, 2013 6:39 am
by gurpreet_asrgndu
the explanation says :
A type level (aka class level) dependency cannot be injected in a variable.

but imo, it can be overriden (by using the same name) in the DD and an <injection-target> can be specified. so some of the information will be provided by annotations(mappedName, or lookup, type) and injection target will be specified in DD

Re: About Question enthuware.oce-ejbd.v6.2.550 :

Posted: Sat Jul 20, 2013 1:09 pm
by admin
I am not sure I follow. Could you please give an example?

thank you,
Paul.

Re: About Question enthuware.oce-ejbd.v6.2.550 :

Posted: Sun May 10, 2015 4:25 pm
by himaiMinh
A type level (aka class level) dependency cannot be injected in a variable.
but imo, it can be overriden (by using the same name) in the DD and an <injection-target> can be specified. so some of the information will be provided by annotations(mappedName, or lookup, type) and injection target will be specified in DD
Let me answer this question:
Declaring a resource in the class level is different from injecting a resource into an instance field.

Declaring a resource in the class level is creating an environment entry for the bean, but it does not inject the resource until the bean provider lookup by JNDI name (by InitialContext.lookup or SessionContext.lookup).

When a resource is declared at the class level like this question, a lookup is necessary.
When a resource is injected into an instance field, a lookup is not needed.