I am using JBoss As 7 and Java EE 6. I have an empty beans.xml
I have a logger Producer like this..
@Singleton
@Startup
public class LoggerProducer {
private static Logger logger = Logger.getLogger(LoggerProducer.class.getName());
@Produces
public Logger produceLogger(final InjectionPoint injectionPoint) {
final String injectingClass = injectionPoint.getMember().getDeclaringClass().getName();
return Logger.getLogger(injectingClass);
}
}
In my class i Inject as follows...
@Inject
Logger logger;
I import java util logger in each case
import java.util.logging.Logger;
Everything deploys correctly however the Injection of the logger is failing and I get a runtime NullPointer
if i try to use the injected logger