user3488102
user3488102

Reputation:

Does CDI work inside OSGI bundle (GF4, WELD)?

Maybe this is a stupid question but I have a component class (it's used as service - declarative service) and I can't inject anything in it after several hours. What I do is

@Inject
InterfaceName name;

Is this my mistake or it's impossible? At the same time I can inject this service into another bundle via @Inject @OSGiService.

I didn't get any compilation or deployment error. The only problem that the name field is null (java.lang.NullPointerException).

Upvotes: 3

Views: 121

Answers (1)

Achim Nierbeck
Achim Nierbeck

Reputation: 5285

If you use Pax CDI, it is possible to use Injection also in OSGi. You are free to choose whatever injection framework you want to use, either weld, openwebbeans or deltaspike.

Upvotes: 1

Related Questions