title: How to Migrate a web project running on resin server to tomcat
body: <p>I have a web project which is already running on resin but I want to deploy the whole project in tomcat server (i.e., I want to migrate the server)</p>
  
  <p>I think only web.xml should be changed so I tried following changes</p>
  
  <p>I have web.xml in resin as</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;web-app xmlns:resin="urn:java:com.caucho.resin"
           xmlns:gemini="urn:java:com.techempower.gemini"&gt;
    &lt;multipart-form enable="true" upload-max="50M" /&gt;
  
    &lt;!-- These lines will force assets to be served be resin --&gt;
    &lt;servlet-mapping url-pattern="/css/*" servlet-name="resin-file" /&gt;
    &lt;servlet-mapping url-pattern="/js/*" servlet-name="resin-file" /&gt;
    &lt;servlet-mapping url-pattern="/images/*" servlet-name="resin-file" /&gt;
    &lt;servlet-mapping url-pattern="/html/*" servlet-name="resin-file" /&gt;
    &lt;servlet-mapping url-pattern="favicon.ico" servlet-name="resin-file" /&gt;
  
    &lt;servlet-mapping url-pattern="/content/*" servlet-name="resin-file" /&gt;
  
    &lt;!-- Assets located in "/static/" are files that should be cached forever, by
         convention. --&gt;
    &lt;servlet-mapping url-pattern="/static/*" servlet-name="resin-file" /&gt;
    &lt;resin:Forward regexp="^/static/([\d|-]+)/(css|js|images|html)/(.*)$" target="/$2/$3"&gt;
      &lt;gemini:filter.ExpiresFilter&gt;
        &lt;expirationDelta&gt;31556926000&lt;/expirationDelta&gt;
      &lt;/gemini:filter.ExpiresFilter&gt;
    &lt;/resin:Forward&gt;
  
    &lt;!-- Disallow Resin 4 from compiling PHP or JSP pages directly. --&gt;
    &lt;mime-mapping extension=".php" mime-type="text/plain" /&gt;
    &lt;mime-mapping extension=".jsp" mime-type="text/plain" /&gt;
    &lt;mime-mapping extension=".jspf" mime-type="text/plain" /&gt;
    &lt;mime-mapping extension=".jspx" mime-type="text/plain" /&gt;
    &lt;servlet-mapping url-pattern="*.php" servlet-name="resin-file" /&gt;
    &lt;servlet-mapping url-pattern="*.jsp" servlet-name="resin-file" /&gt;
    &lt;servlet-mapping url-pattern="*.jspf" servlet-name="resin-file" /&gt;
    &lt;servlet-mapping url-pattern="*.jspx" servlet-name="resin-file" /&gt;
    &lt;servlet-mapping url-pattern="/WEB-INF/*.jsp" servlet-name="resin-jsp" /&gt;
    &lt;servlet-mapping url-pattern="/WEB-INF/*.jspf" servlet-name="resin-jsp" /&gt;
    &lt;servlet-mapping url-pattern="/WEB-INF/*.jspx" servlet-name="resin-jspx" /&gt;
  
    &lt;!-- Disallow URL rewriting for sessions.--&gt;
    &lt;session-config enable-url-rewriting="false" /&gt;
  
    &lt;!-- Use UTF-8 for everything. --&gt;
    &lt;character-encoding&gt;UTF-8&lt;/character-encoding&gt;
  
    &lt;!-- Uncomment and modify the directives below to enable network
         configuration, wherein each application instance contacts the
         cluster master to receive its configuration. --&gt;
  
  
    &lt;!-- Enable GZIP compression. --&gt;
    &lt;filter filter-name="gzip" filter-class="com.caucho.filters.GzipFilter"&gt;
      &lt;init&gt;
        &lt;use-vary&gt;true&lt;/use-vary&gt;
      &lt;/init&gt;
    &lt;/filter&gt;
    &lt;filter-mapping url-pattern='*' filter-name="gzip" /&gt;
  
  
      &lt;listener&gt;
          &lt;display-name&gt;Cron Job Scheduler Manager&lt;/display-name&gt;
          &lt;listener-class&gt;com.leonardo.email.CronJobHandler&lt;/listener-class&gt;
      &lt;/listener&gt;
  
      &lt;servlet&gt;
          &lt;servlet-name&gt;PrintActionItems&lt;/servlet-name&gt;
          &lt;servlet-class&gt;com.leonardo.PrintActionItems&lt;/servlet-class&gt;
      &lt;/servlet&gt;
  
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;PrintActionItems&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/PrintActionItems&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  
      &lt;servlet&gt;
          &lt;servlet-name&gt;DeleteActionItemFile&lt;/servlet-name&gt;
          &lt;servlet-class&gt;com.leonardo.DeleteActionItemFile&lt;/servlet-class&gt;
      &lt;/servlet&gt;
  
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;DeleteActionItemFile&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/DeleteActionItemFile&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  
  
  &lt;/web-app&gt;
  </code></pre>
  
  <p>I want to change this web.xml according to Tomcat</p>
  
  <p>I changed it as below:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;web-app xmlns:resin="urn:java:com.caucho.resin"
           xmlns:gemini="urn:java:com.techempower.gemini"&gt;
    &lt;multipart-form enable="true" upload-max="50M" /&gt;
  
   &lt;servlet-mapping&gt;
    &lt;servlet-name&gt;default&lt;/servlet-name&gt;&lt;url-pattern&gt;/css/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  &lt;servlet-mapping&gt;
    &lt;servlet-name&gt;default&lt;/servlet-name&gt;&lt;url-pattern&gt;/js/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  &lt;servlet-mapping&gt;
    &lt;servlet-name&gt;default&lt;/servlet-name&gt;&lt;url-pattern&gt;/html/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  &lt;servlet-mapping&gt;
    &lt;servlet-name&gt;default&lt;/servlet-name&gt;&lt;url-pattern&gt;/images/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  
  
    &lt;servlet-mapping&gt;
    &lt;servlet-name&gt;default&lt;/servlet-name&gt;&lt;url-pattern&gt;/static/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  
  
  &lt;servlet-mapping&gt;
    &lt;servlet-name&gt;default&lt;/servlet-name&gt;&lt;url-pattern&gt;*.php&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
   &lt;servlet-mapping&gt;
    &lt;servlet-name&gt;default&lt;/servlet-name&gt;&lt;url-pattern&gt;*.jsp&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
   &lt;servlet-mapping&gt;
    &lt;servlet-name&gt;default&lt;/servlet-name&gt;&lt;url-pattern&gt;*.jspf&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
   &lt;servlet-mapping&gt;
    &lt;servlet-name&gt;default&lt;/servlet-name&gt;&lt;url-pattern&gt;*.jspx&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
   &lt;servlet-mapping&gt;
    &lt;servlet-name&gt;default&lt;/servlet-name&gt;&lt;url-pattern&gt;/WEB-INF/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  
  
    &lt;!-- Disallow URL rewriting for sessions.--&gt;
    &lt;session-config enable-url-rewriting="false" /&gt;
  
    &lt;!-- Use UTF-8 for everything. --&gt;
    &lt;character-encoding&gt;UTF-8&lt;/character-encoding&gt;
  
  
    &lt;!-- Enable GZIP compression. --&gt;
    &lt;filter filter-name="gzip" filter-class="com.caucho.filters.GzipFilter"&gt;
      &lt;init&gt;
        &lt;use-vary&gt;true&lt;/use-vary&gt;
      &lt;/init&gt;
    &lt;/filter&gt;
  
      &lt;listener&gt;
          &lt;display-name&gt;Cron Job Scheduler Manager&lt;/display-name&gt;
          &lt;listener-class&gt;com.leonardo.email.CronJobHandler&lt;/listener-class&gt;
      &lt;/listener&gt;
  
      &lt;servlet&gt;
          &lt;servlet-name&gt;PrintActionItems&lt;/servlet-name&gt;
          &lt;servlet-class&gt;com.leonardo.PrintActionItems&lt;/servlet-class&gt;
      &lt;/servlet&gt;
  
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;PrintActionItems&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/PrintActionItems&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  
      &lt;servlet&gt;
          &lt;servlet-name&gt;DeleteActionItemFile&lt;/servlet-name&gt;
          &lt;servlet-class&gt;com.leonardo.DeleteActionItemFile&lt;/servlet-class&gt;
      &lt;/servlet&gt;
  
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;DeleteActionItemFile&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/DeleteActionItemFile&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  
  &lt;/web-app&gt;
  </code></pre>
  
  <p>But, while running tomcat it gives following errors </p>
  
  <pre><code>org.apache.tomcat.util.modeler.Registry registerComponent
  SEVERE: Null component Catalina:type=JspMonitor,name=jsp,WebModule=//localhost/,
  J2EEApplication=none,J2EEServer=none
  org.apache.catalina.startup.HostConfig deployDirectory
  SEVERE: Error deploying web application directory ROOT
  java.lang.NullPointerException
  </code></pre>
  
  <p>Is this a right way to migrate to tomcat server?<br>
  If so only web.xml must be changed?
  then what should be contain in web.xml of tomcat?</p>
  
  <p>Please advice 
  Thanks</p>