title: Migration Apache Tomcat 6 project with context.xml to GlassFish
body: <p>I have application originally developed for Tomcat. There is context.xml file in META-INF using for creating datasource. As was mentioned <a href="http://weblogs.java.net/blog/amyroh/archive/2007/05/context_webapp_1.html" rel="nofollow noreferrer">here</a> glassfish has support of context.xml file from Tomcat. I tried to migrate this app to Glassfishv3. But I still, my app (actually Hibernate) can't find jdbc datasource resource via jndi.
  There is code of context.xml from tomcat</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;Context privileged="true" antiResourceLocking="false"
  antiJARLocking="false" reloadable="true"&gt;
  &lt;!-- JOTM --&gt;
  
  &lt;Transaction factory="org.objectweb.jotm.UserTransactionFactory"
      jotm.timeout="60" /&gt;
  &lt;Resource name="jdbc/companydb" type="javax.sql.DataSource"
      driverClassName="org.hsqldb.jdbcDriver" maxIdle="2" maxWait="5000"
      url="jdbc:hsqldb:hsql://localhost:9002/companydb" username="sa"
      password="" maxActive="4" /&gt;
  
  &lt;/Context&gt;
  </code></pre>
  
  <p>I redeployed app from tomcat without any changes to Glassfish.
  There is exception from Glassfish</p>
  
  <blockquote>
    <p>java.lang.RuntimeException : org.hibernate.HibernateException: Could not find datasource jdbc/companydb</p>
  </blockquote>
  
  <p>Have someone successfully switched to Glassfish from tomcat? 
  Thanks</p>