Mantis - Resin
Viewing Issue Advanced Details
4182 major always 08-18-10 04:14 09-15-10 12:11
jharting  
reza  
normal  
closed 4.0.9  
fixed  
none    
none  
0004182: CDI Extensions cannot be injected
Resin breaks the following part of the CDI spec:

"For each service provider, the container must provide a bean of scope @ApplicationScoped and qualifier @Default, supporting
injection of a reference to the service provider instance. The bean types of this bean include the class of the service
provider and all superclasses and interfaces."

Currently, it is not possible to inject an extension.

The attached project demonstrates the problem.

 bar.zip [^] (4,856 bytes) 08-18-10 04:14
 bar1.zip [^] (4,856 bytes) 09-10-10 01:22
 bar.tar.bz2 [^] (3,558 bytes) 09-13-10 04:51

Notes
(0004742)
reza   
09-09-10 16:23   
The attachment appears to be corrupt. We need a little more info to see if/how this bug can be reproduced.
(0004743)
jharting   
09-10-10 01:25   
Reuploaded the file.

In short:
1.) Create a CDI extension (Foo extends javax.enterprise.inject.spi.Extension)
2.) Put fully qualified class name into a file named javax.enterprise.inject.spi and place this file into META-INF/services folder
3.) Anywhere, do @Inject private Foo foo;
(0004744)
reza   
09-10-10 07:29   
I could not open the updated zip file either, but will try to reproduce this.
(0004745)
reza   
09-10-10 13:24   
Was able to reproduce bug.
(0004747)
jharting   
09-13-10 04:53   
I reuploaded the project as a bz2 archive and only then noticed you reproduced it yourself already :-)
(0004751)
reza   
09-15-10 12:11   
This issue has been fixed on trunk and should be available in the next snapshot and/or release. The associated QA number is ioc/0pa0.