users@glassfish.java.net

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

From: <glassfish_at_javadesktop.org>
Date: Mon, 21 Jun 2010 15:05:23 PDT

My project structure is that of a simple jar file.

pom.xml
src/
src/main/java/
......... my java classes (jpa entities, dao classes)
src/main/resources/
......... my spring configuration files
src/test/java/
......... my JUnit test cases
src/test/resources/
......... my spring context.xml files
src/test/resources/org/glassfish/embed/domain.xml

I made my AppTest.class a @Stateless EJB because otherwise the application would not load. I don't have any EJB's in my project, only Spring managed POJOs. Without the @Stateless annotation EclipseLink was unable to locate the DataSource specified in persistence.xml. When I add the @Stateless back, then the application can at least load and the DataSource gets resolved.

The Test code belongs to the same module that I have the entities currently defined in, which is a simple jar project. I do not have an EJB Project defined.

I'll try the 3.1-SNAPSHOT and see what occurs. I'm still stuck as to how I can retrieve the EntityManager from JNDI so I can inject it into my Dao objects. If I define all of my dao objects as EJBs, then I would need to perform a lookup to locate each bean. Seeing as I don't have an EJB project or a Web Project I cannot specify the refs in ejb-jar.xml or web.xml and would need to perform a lookup in the global namespace. It would be much simpler if I could simply lookup the EntityManager and inject it into my Dao objects.
[Message sent by forum member 'fericit_bostan']

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