In NetBeans 7.1.1. I have a Java project for a web application that I am deploying to Tomcat 7. The project has been migrated from an earlier version from Netbeans (along with all my other projects).
The problem is that my project is now in an error state. Its name is red and has a yellow triangle in the blue globe project icon. When I right-click on a project, I see the option “Fix a data source problem”.
Unfortunately, this option does not solve the problem. When I select an option, I get a dialog with the text: “To solve, select the data source name below, then click“ Add Connection. ”Database connections for the data sources mentioned in this project cannot be found.”
When I select a data source that cannot be located (jdbc / mydb) and click the Add Connection button, it opens the New Connections Wizard, but when I click the Finish button, I get “Unable to add connection. Connection already exists".
The connection is already defined in my context.xml
and my project works and deploys without problems.
Here is my context.xml:
<?xml version="1.0" encoding="UTF-8"?> <Context path="/myapp.com"> <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"/> </Context>
How can I get a Netbeans project from this "Solve a data source problem" problem?
source share