• Post Reply Bookmark Topic Watch Topic
  • New Topic

EJB3.1 packaging  RSS feed

Zdenek Obst
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!