Skip to content
Advertisement

Getting javax.servlet.ServletException: javax.naming.NamingException: Lookup failed for ‘java:global/ShoppingCart-1.0-SNAPSHOT/ShoppingCartRemote’

I am new to JAVA EE. I am trying to implement stateful session Bean via IntelliJ IDEA and glassfish server 4.0 while running the code getting below exception. Attaching the code and glassfish configuration as well. Error is coming as the lookup has been failed. Can anyone help regarding the lookup? Glassfish Configuration

JavaScript

Remote Interface

JavaScript

Stateful Session Bean

JavaScript

JSP Code

JavaScript

Advertisement

Answer

The error was due to an incorrect lookup path. The updated code in the JSP file is

JavaScript

To find out the lookup path, I have checked the server logs it was printed over there, after fixing that it’s working fine.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement