Re: Injection fails in rewrite processor. Injected components are always null

Splash Forums PrettyFaces Users Injection fails in rewrite processor. Injected components are always null Re: Injection fails in rewrite processor. Injected components are always null

#22222

I think the easiest way for you is to use some library for this. Deltaspike for example contains a helper class called BeanProvider that can be used to manually look up beans like this:

MyService myService = BeanProvider.getContextualReference(MyService.class, false);

To include Deltaspike in your project just add this to your pom:

<dependency>
<groupId>org.apache.deltaspike.core</groupId>
<artifactId>deltaspike-core-impl</artifactId>
<version>0.1-incubating</version>
</dependency>

I think other libraries like Seam Solder and MyFaces CODI provide similar functionality.