I developed very simple Hello World EJB (3.x) which I deployed on JBoss 7.1.
I can successfully call this EJB from within a standalone application.
When trying to call it from a servlet I find the EJB.
I have package the EJB in a JAR and the servlet in a WAR.
It seems that this is the reason for the servlet not able to access the EJB.
Might that be true?
Once I package both, the EJB JAR and the servlet WAR into the same EAR it works.
As that the supposed behavior or can I make this work even without using EARs?
Maybe someone can shed some light into this.
I am pretty sure that I did not need to do these things on earlier JBoss version.
According to Java EE spec, deployed applications should be isolated, unless they are in the same EAR archive. So the behaviour you see is correct.
This is different from JBoss 4 or JBoss 5 default configuration, which did not have archives isolation (that was essentially a bad thing, but often quite convinient…).
EAR packaging is sort of annoying, but can be done automatically by IDE or Maven.
In addition, in case of Java EE v. 6, you might pack EJB components with local interface into WAR archive, which simplifies deployment.