I am creating a WAR project with the @Statelesssession beans part included (located in WEB-INF/classes). During the deployment, classes are scanned and my beans is deployed and registered in JNDI, everything is fine.
Now I need to include the dependency foo-service.jarin WEB-INF/lib, which contains the remote interface and the implementation (!) Of some EJBs with annotations @Statefuland @Statelesswhich I need to call remotely from the WAR application. Now these beans are also deployed, which seems fine according to the EJB specification packaged in WAR .
However, I do not want these beans to be deployed, since I want to use a remote interface implementation without providing it.
Q: Is there any standard mechanism for suppressing EJB annotations for selected JARs in a WAR? "Hey JBoss, don't browse this JAR!"
The approaches that I have considered so far:
- I can repack the external dependency to get a JAR that contains only interfaces, not implementations. (This is suggested in this question ). Touching the JAR seems cumbersome, and I would like to avoid it.
- Asking developers to split interfaces and their implementation into separate JARs will take too long until they release it.
ejb-jar.xml WEB-INF, "" beans, , foo-service.jar. , ( ), beans, .- EAR
foo-service.jar application.xml. , -...