title: Error when deploy web-application on JBoss AS 7
body: <p>I use JBoss AS 7.1.1 final and I've one problem when I try to deploy the application:</p>
  
  <blockquote>
    <p>JBAS014775: New missing/unsatisfied dependencies:
       service jboss.naming.context.java."\n\t\t\tjava:jboss".datasources."carsDS\n\t\t"</p>
    
    <p>(missing) dependents: [service
    jboss.persistenceunit."springTest.war#carsPU"] 
        20:33:58,250 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) {"JBAS014653: Composite operation
    failed and was rolled back. Steps that failed:" => {"Operation step-2"
    => {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.persistenceunit.\"springTest.war#carsPU\"jboss.naming.context.java.\"\n\t\t\tjava:jboss\".datasources.\"carsDS\n\t\t\"Missing[jboss.persistenceunit.\"springTest.war#carsPU\"jboss.naming.context.java.\"\n\t\t\tjava:jboss\".datasources.\"carsDS\n\t\t\"]"]}}}</p>
  </blockquote>
  
  <p>This is my standalone.xml file:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;drivers&gt;
      &lt;driver module="com.h2database.h2" name="h2"&gt;
          &lt;xa-datasource-class&gt;org.h2.jdbcx.JdbcDataSource&lt;/xa-datasource-class&gt;
      &lt;/driver&gt;
      &lt;driver module="com.mysql" name="com.mysql"&gt;
          &lt;xa-datasource-class&gt;com.mysql.jdbc.jdbc2.optional.MysqlXADataSource&lt;/xa-datasource-class&gt;
      &lt;/driver&gt;
  &lt;/drivers&gt;
  &lt;datasource enabled="true" jndi-name="java:jboss/datasources/carsDS"
      pool-name="carsDS"&gt;
      &lt;connection-url&gt;jdbc:mysql://localhost:3306&lt;/connection-url&gt;
  
      &lt;driver&gt;com.mysql&lt;/driver&gt;
  
      &lt;pool&gt;
          &lt;min-pool-size&gt;10&lt;/min-pool-size&gt;
          &lt;max-pool-size&gt;100&lt;/max-pool-size&gt;
          &lt;prefill&gt;true&lt;/prefill&gt;
      &lt;/pool&gt;
      &lt;security&gt;
          &lt;user-name&gt;michal&lt;/user-name&gt;
          &lt;password&gt;michal&lt;/password&gt;
      &lt;/security&gt;
      &lt;statement&gt;
          &lt;prepared-statement-cache-size&gt;32&lt;/prepared-statement-cache-size&gt;
          &lt;share-prepared-statements /&gt;
      &lt;/statement&gt;
  &lt;/datasource&gt;
  </code></pre>
  
  <p>and persistence.xml:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;persistence 
      xmlns="http://java.sun.com/xml/ns/persistence"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/persistence 
      http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
      version="1.0"&gt;
      &lt;persistence-unit name="carsPU" transaction-type="JTA" &gt;
          &lt;provider&gt;org.hibernate.ejb.HibernatePersistence&lt;/provider&gt;
          &lt;jta-data-source&gt;
              java:jboss/datasources/carsDS
          &lt;/jta-data-source&gt;
          &lt;class&gt;pl.springtest.carEntity&lt;/class&gt;
          &lt;properties&gt;
              &lt;property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5Dialect"/&gt;
              &lt;property name="hibernate.hbm2ddl.auto" value="create-drop" /&gt;
          &lt;/properties&gt;
      &lt;/persistence-unit&gt;
  &lt;/persistence&gt;
  </code></pre>
  
  <p>Please tell me what is wrong.</p>