title: Netbeans Project: Resolve Data Source Problems
body: <p>In Netbeans 7.1.1. I have a Java project for a web application that I deploy on Tomcat 7. The project is migrated from an earlier version from Netbeans (together with all my other projects).</p>
  
  <p>The problem is that my project now is in an error state. Its name is in red and it has a little yellow triangle in its blue globe project icon.  When I right click on the project I see the option to "Resolve Data Source Problem.".</p>
  
  <p>Unfortunately this option does not resolve the problem. When I choose the option I get a dialog with the text: "To resolve, select a Data Source name below then click Add Connection. Database connections for the Data Sources referenced in this project could not be located." </p>
  
  <p>When I select the data source that can't be located (jdbc/mydb) and press the "Add Connection" button, it opens the "New Connection Wizard" but when I press the "Finish" button, I get an "Unable to add connection. Connection already exists."</p>
  
  <p>The connection is already defined in my <code>context.xml</code> and my project is running and deploying without any problems. </p>
  
  <p>Here is my context.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;Context path="/myapp.com"&gt;
      &lt;Resource auth="Container" driverClassName="com.mysql.jdbc.Driver" 
          maxActive="100" maxIdle="30" maxWait="10000" name="jdbc/mydb" 
          password="secret" type="javax.sql.DataSource" 
          url="jdbc:mysql://127.0.0.1:3306/mydb?autoReconnect=true" 
          username="user" validationQuery="select 1"/&gt;
  
  &lt;/Context&gt;
  </code></pre>
  
  <p><strong>How can I get my Netbeans project out of this "Resolve Data Source problem"?</strong></p>