你的web.xml中还要对Resource进行引用
 <resource-ref>
      <description>DB Connection</description>
      <res-ref-name>jdbc/quickstart</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
  </resource-ref>
你需要在web.xml中的<web-app></web-app>
中加入这个