Hi Thomas! Please allow me a very direct answer:
a.) The reason is that @Singleton is a completely underspecified crap in JSR-330 and thus the JSR-299 EG decided to completely leave it out ;) What does @Singleton mean? 1 instance per server? 1 instance per webapp? 1 instance per cluster? b.) NormalScoped beans must not be final per the spec. The reason is that we cannot subclass a final class, so we cannot create a proxy for it. hope that helps! LieGrue, strub --- On Thu, 8/4/11, Thomas Andraschko <[email protected]> wrote: From: Thomas Andraschko <[email protected]> Subject: Some questions about generics and @Singleton To: [email protected] Date: Thursday, August 4, 2011, 8:15 PM Hi, first i declared @Singleton on my DAO's but sometimes the EntityManager (which was injected with a normal producer) was null. So i looked at other examples and i tried @ApplicationScoped. After removing all final methods (Why OWB does not throw this exception with @Singleton but with @ApplicationScoped???) , i get a exception in my generic DAO. I get the persistent class from getGenericSuperclass().getActualTypeArguments()[0] but AFAICS the superclass is now a proxy of OWB and does not work anymore. How can i fix this? Thanks and best regards, Thomas
