I'm using a JBoss eap 6.4 and tries to create a test EAR with a WAR and a JAR with ejb's inside.
My problem is that Servlets in my WAR can not make local calls (@EJB) to the ejb's inside the JAR even though they are packed inside the same EAR. The reference is never injected.
I found this for local clients: It must run in the same application as the enterprise bean it accesses. at https://docs.oracle.com/javaee/6/tutorial/doc/gipjf.html#girfl. To my that sounds like my situation, please correct me if I'm wrong.
I also found this interesting post: EAR vs separate EJB + WAR. To me the situation #1 in the first answer sounds like this should work.
But I also found this post: How to get CDI in war AND EJB running if both are bundled in an EAR that saying that there is different scope for the classloader. To me that sounds like my attempt with local calls never will work. Could it be different situation's for different app-servers?
To illustrate this I just made this image, the problem is where the red arrow is.
Do you think I have mixed something up?
Best regards Fredrik