My Oracle Support Banner

javax.naming.NameNotFoundException When Looking Up a WLS JNDI Name (Doc ID 849448.1)

Last updated on JULY 06, 2021

Applies to:

Oracle Containers for J2EE - Version and later
Information in this document applies to any platform.


A J2EE application is deployed into 10.3.2 WebLogic Server (WLS). In order to access an EJB, from a JSP page of this application, a JNDI lookup is done with the 'mySampleEJB#sampleEjbProject.SessionEJB' name.

The same J2EE application is deployed into 10.1.3 OC4J successfully. However, when executing the JNDI lookup with mySampleEJB#sampleEjbProject.SessionEJB' name, it fails with the exception :

javax.naming.NameNotFoundException: mySampleEJB#sampleEjbProject.SessionEJB not found

The goal of this note is to show how to avoid this exception by having common code for both WLS and OC4J.


To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.