javax.naming.NameNotFoundException When Looking Up a WLS JNDI Name

(Doc ID 849448.1)

Last updated on NOVEMBER 05, 2016

Applies to:

Oracle Containers for J2EE - Version: 10.1.3.3.0 and later   [Release: AS10gR3 and later ]
Information in this document applies to any platform.

Symptoms

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 sucesfully. 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.

Cause

Sign In with your My Oracle Support account

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

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms