There are multiple situations when an InjectionTarget is created by an extension for a class that does not match bean class requirements. For example:
- abstract classes (Solder)
- non-static inner classes (cdi-wicket)
- classes with no appropriate constructor
Creating an InjectionTarget for such a class is OK as long as it is only ever used for injecting existing instances, not for producing instances.
We should introduce an InjectionTarget implementation capable of doing this and also log a warning each time it is created. If the application attempts to call produce() on such InjectionTarget, the call should fail with exception.