I am trying to write a portlet for Liferay (using Tomcat and Spring) and need to use a database via Persistence API/Hibernate. I am using some configuration XMLs (applicationContext.xml, etc.) and annotations to realize that. e.g.
@Component @Scope("application")
public class SomeForm {
@PersistenceContext EntityManager entityManager;
At the moment I am having some troubles with NullPointerExceptions which occur, in my opinion, because the entityManager is not bound. But I am not asking for an answer to that problem, but to a more wider topic:
Is there an easy way to check what Objects are available in the application context at runtime (e.g. PesistenceContext, SessionContext) and to determine how an Object is bound in the application context at runtime?