users@glassfish.java.net

Re: glassfish-embedded-shell.jar 3.0.1 deployment issue

From: <glassfish_at_javadesktop.org>
Date: Mon, 21 Jun 2010 12:29:10 PDT

This now seems to be turing into a chicken-and-egg situation. My initial intent was to create my dao classes and let them reside within Spring, to be managed and injected into my other classes. But seeing as I can't find a way to acquire the EntityManager from the applicationContent via JNDI, I can't find a way to make this work. Spring cannot locate the EntityManager in JNDI (maybe I don't know the correct path) so I Spring cannot resolve the @Autowired dependency for the EntityManager and the loading of the Spring container fails.

I modified all my dao classes to be @Stateless EJBs and thus removing them from the Spring container. This seems to work to some extent; the GlassFish container loads and it appears to load my EJBs or at lest my BaseDaoImpl EJB.

INFO: Portable JNDI names for EJB BaseDaoImpl : [java:global/ejb-app2683221233574874865/classes/BaseDaoImpl!com.intraxinc.survey.persistence.dao.BaseDao, java:global/ejb-app2683221233574874865/classes/BaseDaoImpl]
Jun 21, 2010 12:07:08 PM org.hibernate.validator.engine.resolver.DefaultTraversableResolver detectJPA

From there, EclipseLink loads and performs the creation of the tables, which all are created successfully. The issue now is that I've made all of my Dao classes EJBs, Spring can no long resolve dependencies on the Dao classes.

Isn't there a way to perform a JNDI lookup of the EntityManager that is loaded within the application context for the persistence.xml file?
[Message sent by forum member 'fericit_bostan']

http://forums.java.net/jive/thread.jspa?messageID=475225