Backport lost references lookup fix

In pull request #1 a fix was implemented to avoid lost object reference lookups. This fix was only implemented in the JBoss 5 version of EASC.

This pull request backports the fix to the (unversioned) `java` and `jboss4` implementation.