I attempted to resolve this by adding a dependency to the module.xml file, in this way:
<module xmlns="urn:jboss:module:1.0" name="com.mycompany.logging.handler">
<module name="org.slf4j" />
However, the Server refused to start when this "deployment" entry was processed!
You could deploy the jar containing the remote interface as a module, and then have your log handler do a "manual" lookup of the remote EJB. Both your log handler module, and the ear, would need to depend on the new module containing the remote interface. Otherwise, when the log handler does the lookup, you'd get a ClassCastException.
Thanks for your suggestion, Greg!
I think that the fundamental problem I am running into is that there is no way to have any "JBoss Module" (even if it contains a Remote EJB Interface) have a dependency on a deployed Application JAR/EJB. The Modules have their own isolated classloader, so instantiating a class instance from within that context does not refer to use the deployed application JARs at all. I actually was able to force the container to instantiate a Proxy for my EJB, but when I attempted to invoke the actual method I want, it threw an Exception because it couldn't actually resolve the remote dependency at runtime.
I haven't personally done this, and maybe I'm not understanding what you are saying, but it seems like it should work. If you deploy the interface as a jboss module (in the wildfly/modules area), then you would only be dependent on the interface. The Java EE spec says that everything in the remote interface has to be Serializable. You invoke a method on the interface, which goes through the proxy and serializes it to send it to the deployed application. The log handler module would have no need for the actual implementing class (EJB) to be on its classloader, just like any non-JavaEE client.
I could not get any EJB lookups to work from within the Module code.
Nothing I read anywhere seems to indicate that this is possible.
As a workaround, I am instead creating the reverse relationship by having an EJB (deployed within an EAR in the "deployments" folder) invoke a "register" method on a global JBoss Module and pass "this" to it, so the Module can later use the "this" reference to call out to that EJB and invoke Interface-defined methods on it.