javax.naming.NameNotFoundException: Name [comp/env] is not bound in this Context

后端 未结 5 1847
醉梦人生
醉梦人生 2020-12-21 00:50

I\'m developing a spring application which uses tomcat server managed connection pool.

I defined datasource in tag in context.xml of tomcat: (i am using spring 2.0.

5条回答
  •  别那么骄傲
    2020-12-21 01:15

    I faced similar problem with tomcat and did the following in eclipse to solve it:

    1. In the server's context.xml, included the jdbc connection details.
    2. Stop the server
    3. Clean the project(Project --> Clean) , the tomcat server (Server--> Right Click --> Clean) and Tomcat work directory (Server--> Right Click--> Clean Tomcat Work Directory).
    4. Start the server and run.

    Even after maintaining the details in context.xml, sometimes it might not get reflected. In such cases follow step#3 and hope it helps.

提交回复
热议问题