Geronimo with MySQL - Can't deploy .ear (DeploymentException: Unable to resolve resource reference)
I have a web app attempting to connect to MySQL 5.5.11. However, when I try to depoly my .ear file to Geronimo 2.2.1 the following exception is thrown:
org.apache.geronimo.common.DeploymentException: Unable to resolve resource reference 'jdbc/MyDataSource' (Could not auto-map to resource. Try adding a resource-ref mapping to your Geronimo deployment plan.
Here's I what I've done:
- I created a database pool name jdbc/MySQL with the Geronimo console (Using the Geronimo database pool wizard). In the wizard, I choose MySQL Connector/J 3.0.17. I verified the jar was downloaded to {GERONIMO_HOME}/repository. I verified that I could create a table and insert data using that database pool in the Geronimo console.
- I add the following to my WEB-INF/web.xml file:
<resource-ref> <res-ref-name>jdbc/MyDataSource</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> <res-sharing-scope>Shareable</res-sharing-scope> </resource-ref>
- I add the following to my WEB-INF/geronimo-web.xml:
<dep:environment> ... <dep:dependencies> <dep:dependency> <dep:groupId>console.dbpool</dep:groupId> <dep:artifactId>jdbc_MySQL</dep:artifactId> </dep:dependency> </dep:dependencies> </dep:environment> <name:resource-ref> <name:ref-name>jdbc/MyDataSource</name:ref-name> <name:resource-link>jdbc/开发者_StackOverflowMySQL</name:resource-link> </name:resource-ref>
What can I be doing wrong? How do I properly connect my web app to MySQL and deploy to Geronimo?
Here's what I'm working with:
- Geronimo 2.2.1 with Tomcat 6
- MySQL 5.5.11
- Eclipse Indigo Release
- Mac OS X 10.6.7
Thanks
精彩评论