javax.naming.namenotfoundexception:name[XXX] is not bound in this context.

Source: Internet
Author: User

When using the local data source to connect the database, in the local project, it is possible, but a deployment to the server, the error.

The error reported was: javax.naming.namenotfoundexception:name[XXX] is not bound in the this context.

Check out the solution: Add the following code to the project's Web. xml

<resource-ref>    <description>db connection</description>    <res-ref-name>zjut_ echarts</res-ref-name>    <res-type>javax.sql.DataSource</res-type>    <res-auth> Container</res-auth>  </resource-ref>

After joining, the mistake was gone, but a new error came up.

What to do, okay? The current solution is: C:\apache-tomcat-7.0.37\conf directory below the context.xml Delete, the Meta-inf directory in our project to copy the context.xml file to C: \ Under the apache-tomcat-7.0.37\conf directory

javax.naming.namenotfoundexception:name[XXX] is not bound in this context.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.