No, It is Immpossible. I ran into the same issue in the context of deploying an EJB 3.0 application on WebLogic 10.3.x.
The application runs on Oracle Application Server 10.1.3 and GlassFish 3.x.
- Oracle AS (OC4J) has its own mechanism for locating the local EJB using JNDI.
- GlassFish 3.x implements EJB 3.1 using the portable JNDI name syntax.
Our application uses a search engine for the current application server, which is determined at run time.
In WebLogic Server 10.3, the local EJB interface:
- can be injected into managed classes in the servlet container (servlets, filters, etc.) and other EJBs using
@EJB annotations - searchable from JNDI only if it was declared in the
ejb-local-ref element in web.xml or ejb-jar.xml
It is not possible for us to declare all watched EJBs. We have 192 stateless EJBs, mostly injected, but many were looking from JNDI because we need them for unmanaged classes.
The source of this information, in addition to trial and error, is WebLogic 10.3 EJB3 Local Lookup Sample . Almost everything I found, including the Oracle documentation, describes the syntax of the JNDI lookup using mappedName#fullInterface , but it doesn't make it clear that only the remote interface name is specified in the JNDI tree.
Update: We set off with declarations in web.xml and ejb-jar.xml (yes, there are EJBs that use utility classes that look for other EJBs in JNDI). Started with a script to generate them from sources, and then manually edited them until they were correct. Not nice, but necessary.
source share