Reputation: 18869
We have a multi-module Java EE application that uses EJB's.
This is an example of the error that we get:
20210211:20:02:37:923|ERROR|Thread 223|-||||c.o.p.i.I.c.o.p.i.InterceptionMetadata|Cannot find JNDI binding for 'java:comp/env/be.cm.apps.evsb.datasplitter.mdb.GsBOBDataFileNotificationMDB/gsDataFileReader', While trying to look up comp/env/be.cm.apps.evsb.datasplitter.mdb.GsBOBDataFileNotificationMDB/gsDataFileReader in /app/ejb/be.cm.common.vsb-vsb-sync-client-javaee-1.3.0-SNAPSHOT.jar/#RabbitTopicConnectionImpl.
We can find no information about this error online or in documentation.
vsb-sync-client-javaee
is an external dependency that we import as a type ejb into a module that we in turn import as ejb type in our pom dependency file within the global ear project.
RabbitTopicConnectionImpl
here is an EJB from within that dependency.
The example class here: gsDataFileReader
is an EJB that is used from within another module within the same EAR. This module both declares and injects the EJB.
We receive an entire stream of errors in Weblogic for every EJB (local) in this module.
The first module (vsb-sync-client-javaee) has a dependency on the second module, but not the other way around.
It looks as if the second module tries to lookup the EJB within the first module, which makes no sense.
More so since the EjB's are declared from within that module.
Any idea why this happens, or any alternative ideas?
Note, the application worked perfectly before we added the external vsb-sync-client-javaee EJB module.
Let me know if anything is not clear, as this is not an easy problem to describe.
Upvotes: 0
Views: 1507
Reputation: 26
You need to add a beans.xml file to your module under resources/META-INF with following content:
<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd"
bean-discovery-mode="all"
version="1.1">
</beans>
Upvotes: 1