Some notes while trying to get up on speed with Glassfish and JEE6, mainly about what can go wrong… and there is plenty of it. The most time-consuming activity is researching generic stack traces which hardly ever point to the real cause.
NullPointerException when deploying
Been there, done that: A beans.xml in META-INF might cause a NullPointerException when deploying to glassfish
Good to know for next time…
javax.naming.NamingException: Lookup failed for SomeStatelessBean#SomeStatelessBean in SerialContext
When SomeStatlessBean is annotated with @Stateless, it shouldn’t implement a generic interface.
Unable to retrieve EntityManagerFactory for unitName null
persistence.xml needs to be in src/META-INF, not webcontent/META-INF
Stateful session beans are instantiated constantly…
Still no idea why. Working around it by annotating the form backing objects with @ManagedBean
JSF @ManagedBean bean getters called multiple times
Yeah, it does that. Pretty annoying if the getter forwards to a service call. Do the service call in a @PostConstruct, keep the results in the bean and service the getter from that.