javax.servlet.ServletException: javax.naming.NameNotFoundException: Name comp is not bound in this Context

I am getting following exception while connecting to a database in spring framework.
Stacktrace:

org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:524)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:417)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)root cause
javax.servlet.ServletException: javax.naming.NameNotFoundException: Name comp is not bound in this Context
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:850)

Related Post

org.springframework.web.context.ContextLoader – Context initialization failed
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
Access is denied (user is not anonymous)

Comments

One Response to “javax.servlet.ServletException: javax.naming.NameNotFoundException: Name comp is not bound in this Context”

  1. Amit on September 3rd, 2008 11:35 pm

    You should include java:/ into your datasource path. Your datasource path me be in some datasource xml file or something like that.

    e.g.
    property name=”jndiName” value=”java:/comp/env/jdbc/mydb”

Leave a Reply