File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes EJB3.1 packaging Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJB3.1 packaging" Watch "EJB3.1 packaging" New topic

EJB3.1 packaging

Zdenek Obst

Joined: Mar 19, 2009
Posts: 13
Hello there,

I would like to know what is the proper EJB3.1 packaging for this situation:

I got ejb-jar module with application logic which uses other ejb-jar module with persistence. The problem is that I would like to have various persistence modules (e.g persistence-jpa.jar, persistence-jdbc.jar ... and so on), so the application logic should operate persitence via some interface (implemented all persistence modules). I tried to package such (set of) interface as simple JAR, then include it in both application logic and persistence modules and finally do JNDI lookup from application logic to get concrete persistence implementation (e.g. read from configuration), retype it to interface and use it.

This solution worked for me on Glassfish AS but not on JBoss AS (and finally I want this application be run on JBoss). The problem was, that returned EJB proxy from JNDI lookup did not implement interface from JAR.

I'm wondering if this even was proper JxEE solution and if there is no any better solution or how generally package ejb-jar modules within ear to achieve such abstraction on application-logic level.

Thank you all
I agree. Here's the link:
subject: EJB3.1 packaging
It's not a secret anymore!