import javax.ejb.Stateless;
|
import javax.enterprise.inject.spi.InjectionPoint;
|
import javax.inject.Inject;
|
|
@Stateless
|
public class StatelessBean {
|
|
private InjectionPoint injectionPoint;
|
|
public StatelessBean() {
|
super();
|
}
|
|
@Inject
|
protected void inject(InjectionPoint injectionPoint) {
|
this.injectionPoint = injectionPoint;
|
}
|
|
public InjectionPoint getInjectionPoint() {
|
return injectionPoint;
|
}
|
}
|
Having the above posted bean and a servlet which @Inject StatelessBean statelessBean, then calling:
statelessBean.getInjectionPoint().toString());
|
will result in a NPE. The bean, however, is injected.
Debugging shows that there is no specific implementation of toString method in ForwardingInjectionPoint (and any subclasses).
Adding toString implementation to SerializableForwardingInjectionPoint will make the NPE go away.
We also need to investigate if this is the case with other beans (not just stateless).
|