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

Moderator: admin

Post Reply
deadlock_gr
Posts: 54
Joined: Tue Apr 19, 2011 10:32 am
Contact:

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

Post by deadlock_gr »

Typo:

// valid cdoe

-->

// valid code

admin
Site Admin
Posts: 10386
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post by admin »

Fixed.
Thanks for the feedback!

gurpreet_asrgndu
Posts: 55
Joined: Thu Jan 03, 2013 7:51 am
Contact:

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

Post 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

admin
Site Admin
Posts: 10386
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post by admin »

I am not sure I follow. Could you please give an example?

thank you,
Paul.

himaiMinh
Posts: 358
Joined: Fri Nov 29, 2013 8:26 pm
Contact:

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

Post 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.

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests