title: Cannot create PoolableConnectionFactory (Access denied for user 'root'@'localhost' (using password: YES))
body: <p>I recently deployed a working webapp on my localhost to amazon web services.
  The problem i'm encountering is - though context.xml has username as 'james', the exception stacktrace mentions otherwise.</p>
  
  <pre><code>org.apache.jasper.JasperException: org.apache.jasper.JasperException: org.apache.jasper.JasperException: javax.servlet.ServletException: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Access denied for user 'root'@'localhost' (using password: YES))
      org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:491)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:401)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
  </code></pre>
  
  <p>It is trying to connect to database with username 'root'. It it be because of caching of the file(context.xml)? How do I tackle that? I have restarted the web server as well, but it's not coming to effect.</p>
  
  <p>Thanks in Advance.</p>
  
  <p><code>EDIT:</code></p>
  
  <p>Here's the content of context.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;Context antiResourceLocking="false" privileged="true" &gt;
      &lt;Resource 
         name="jdbc/NetmarketDB"
         auth="Container"
         type="javax.sql.DataSource"
         removeAbandoned="true"
         removeAbandonedTimeout="30"
         maxActive="100"
         maxIdle="30"
         maxWait="1000"
         username="james"
         password="xxxxxxxxxx"
         driverClassName="com.mysql.jdbc.Driver"
         url="jdbc:mysql://localhost:3306/ams"/&gt;
  &lt;/Context&gt;
  </code></pre>
  
  <p>You can see it happening by clicking on <code>Login</code> or <code>Register</code> on the page:
  <a href="http://184.73.118.76/Links.jsp" rel="nofollow noreferrer">http://184.73.118.76/Links.jsp</a></p>
  
  <p>Is there anything I need to do to bring context.xml changes to effect?
  I have carried out two actions:<br>
  1. <code>touch web.xml</code> in WEB-INF<br>
  2. Restart tomcat server.</p>
  
  <p>Desperately need help here.</p>
  
  <p>Thanks again.
  James.</p>