I am running with JBOSS 7.0
I created the file called my-ds.xml and put it into the WebContent\WEB-INF directory.
<datasources>
<local-tx-datasource>
<jndi-name>jdbc/DataSourceExample</jndi-name>
<connection-url>
jdbc:mysql://localhost:3306/DataSourceExample
</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>root</user-name>
<password>my password</password>
</local-tx-datasource>
</datasources>
When I run I get this error message.
Here is the whole jsp file.
07:08:23,802 INFO [org.jboss.as.deployment] (DeploymentScanner-threads - 2) Found 07-exp1.war in deployment directory. To trigger deployment create a file called 07-exp1.war.dodeploy
07:08:23,824 INFO [org.jboss.as.server.deployment] (MSC service thread 1-4) Starting deployment of "07-exp1.war"
07:08:24,058 INFO [org.jboss.as.server.controller] (DeploymentScanner-threads - 1) Deployment of "07-exp1.war" was rolled back with failure message {"Services with missing/unavailable dependencies" => ["jboss.deployment.unit.\"07-exp1.war\".jndiDependencyService missing [ jboss.naming.context.java.module.07-exp1.07-exp1.env/jdbc/DataSourceExample ]","jboss.naming.context.java.module.07-exp1.07-exp1.env/jdbc/DataSourceExample.jboss.deployment.unit.\"07-exp1.war\".module.07-exp1.07-exp1.0 missing [ jboss.naming.context.java.module.07-exp1.07-exp1.env/jdbc/DataSourceExample ]"]}
07:08:24,064 INFO [org.jboss.as.server.deployment] (MSC service thread 1-3) Stopped deployment 07-exp1.war in 6ms
07:08:24,066 ERROR [org.jboss.as.deployment] (DeploymentScanner-threads - 2) {"Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"Services with missing/unavailable dependencies" => ["jboss.deployment.unit.\"07-exp1.war\".jndiDependencyService missing [ jboss.naming.context.java.module.07-exp1.07-exp1.env/jdbc/DataSourceExample ]","jboss.naming.context.java.module.07-exp1.07-exp1.env/jdbc/DataSourceExample.jboss.deployment.unit.\"07-exp1.war\".module.07-exp1.07-exp1.0 missing [ jboss.naming.context.java.module.07-exp1.07-exp1.env/jdbc/DataSourceExample ]"]}}}
Jeanne