- an ejb-jar containning the code related to a JPA persistence layer.
- two (or more) web-applications that depends on the above ejb-jar.
— Today solution:
None, people need to invent alternative solutions like to deploy the ejb-jar in
the Glassfish lib folder or to re-pack the ejb-jar in each of the differente
applications. The former solution open a security breach and the latter forces a
complicated synchronization between the deployment artifacts every time the
persistence layer is modified.
People also reported problems using Hibernate with the ejb-jar shared through
the Glassfish lib folder. Since a Stateless session bean is already loaded in
one classloader, Glassfish throws exceptions if a second application tries to
load the same EJB.
— Proposed feature:
Glassfish should support the deployment of ejb-jar as "sharable resource",
including security management on what application can access the resource and
managing the classloader issues related to such feature.