title: Not able to run a Vaadin application on remote server
body: <p>I am building a Vaadin application with Java. Here is the folder structure.</p>
  
  <pre><code>- com
  -- my
  --- WebTool
  ---- ToolUI.java
  ---- View_1.java
  ---- View_2.java
  </code></pre>
  
  <p>The entry point to the application is <em>ToolUI.java</em> and has the method <em>init()</em> that takes <em>VaadinRequest</em> as a parameter. It is this file where I add the views <em>Views_1</em> and <em>View_2</em> as views of the application and add navigations among them. Everything runs great when I run the application via the Eclipse IDE.</p>
  
  <p>Now I have a requirement that I have to deploy this application on a remote server. So I created a war of the project and deployed on the server by the name 
  MyWebTool.war.</p>
  
  <p>Now when I try running the war with the command </p>
  
  <pre><code>java -jar MyWebTool.war
  </code></pre>
  
  <p>it gives me the error: <em>Can't execute war no main manifest attribute, in MyWebTool.war</em></p>
  
  <p>I am not sure what to add the main class as since the init method gets invoked and sets the app running. So I put a blank main function inside the MyWebToolUI.java and added this dependency in the pom.xml file.</p>
  
  <pre><code>&lt;plugin&gt;
      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
      &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
      &lt;version&gt;2.6&lt;/version&gt;
      &lt;configuration&gt;
          &lt;archive&gt;
              &lt;manifest&gt;
                  &lt;addClasspath&gt;true&lt;/addClasspath&gt;
                  &lt;mainClass&gt;com.my.WebTool.ToolUI&lt;/mainClass&gt;
              &lt;/manifest&gt;
          &lt;/archive&gt;
        &lt;failOnMissingWebXml&gt;false&lt;/failOnMissingWebXml&gt;
        &lt;!-- Exclude an unnecessary file generated by the GWT compiler. --&gt;
        &lt;packagingExcludes&gt;WEB-INF/classes/VAADIN/widgetsets/WEB-INF/**&lt;/packagingExcludes&gt;
      &lt;/configuration&gt;
  &lt;/plugin&gt;
  </code></pre>
  
  <p>But now when trying to run the application it says <em>Could not find or load main class com.my.WebTool.ToolUI</em></p>
  
  <p>Can please somebody shed light on this? I don't know if I am missing something simple here but at this point, I am stuck. Thanks a lot.</p>