title: Vaadin 7 problem after deployment: NoClassDefFoundError
body: <p>I am running Vaadin 7 with IntelliJ. I am unable to develop my company's project because I am stuck at a problem that occurs after deployment.</p>
  <p>The Server tab in IntelliJ says that starting the server and deploying the artifact is successful</p>
  <pre><code>Connected to the target VM, address: '127.0.0.1:9009', transport: 'socket'
  Connected to server
  [2020-01-03 01:33:16,250] Artifact CO:war exploded: Artifact is being deployed, please wait...
  [2020-01-03 01:33:18,006] Artifact CO:war exploded: Artifact is deployed successfully
  [2020-01-03 01:33:18,006] Artifact CO:war exploded: Deploy took 1,756 milliseconds
  </code></pre>
  <p>After that IntelliJ navigates to http://localhost:8080/company on the browser. It displays a 'HTTP Status 404 - Not Found' error. The console says:</p>
  <pre><code>  Error in annotation processing: {0}.
  java.lang.NoClassDefFoundError: com/vaadin/server/VaadinServlet
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
      at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
      at org.glassfish.web.loader.WebappClassLoader.findClass(WebappClassLoader.java:1089)
      at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1620)
      at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1501)
      at com.sun.enterprise.deployment.annotation.impl.ModuleScanner.getElements(ModuleScanner.java:295)
      at com.sun.enterprise.deployment.archivist.Archivist.processAnnotations(Archivist.java:592)
      at com.sun.enterprise.deployment.archivist.Archivist.readAnnotations(Archivist.java:461)
      at com.sun.enterprise.deployment.archivist.Archivist.readAnnotations(Archivist.java:445)
      at com.sun.enterprise.deployment.archivist.Archivist.readRestDeploymentDescriptors(Archivist.java:417)
      at com.sun.enterprise.deployment.archivist.Archivist.readDeploymentDescriptors(Archivist.java:394)
      at com.sun.enterprise.deployment.archivist.Archivist.open(Archivist.java:269)
      at com.sun.enterprise.deployment.archivist.Archivist.open(Archivist.java:278)
      at com.sun.enterprise.deployment.archivist.Archivist.open(Archivist.java:239)
      at com.sun.enterprise.deployment.archivist.ApplicationFactory.openArchive(ApplicationFactory.java:161)
      at org.glassfish.javaee.core.deployment.DolProvider.processDOL(DolProvider.java:199)
      at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:223)
      at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:91)
      at com.sun.enterprise.v3.server.ApplicationLifecycle.loadDeployer(ApplicationLifecycle.java:882)
  </code></pre>
  <p>Our company hasn't upgraded to higher Vaadin versions yet, and upgrading Vaadin isn't an option for fixing my problem. I can show you some excerpts of files that might be important, such as pom.xml.</p>
  <p>Information recap:</p>
  <pre><code>Vaadin 7.7.10
  Payara Server 4.1.2.174 on local computer
  
  IntelliJ IDEA 2019.3.1 (Ultimate Edition)
  Build #IU-193.5662.53, built on December 18, 2019
  Runtime version: 11.0.5+10-b520.17 amd64
  VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
  Windows 10 10.0
  
  java version &quot;1.8.0_231&quot;
  Java(TM) SE Runtime Environment (build 1.8.0_231-b11)
  Java HotSpot(TM) 64-Bit Server VM (build 25.231-b11, mixed mode)
  </code></pre>
  <p>If you have any idea on what might cause this error, please offer suggestions. I am grateful for your help.</p>
  <hr />
  <p>Nine months later the problem started happening on my computer again. My error message starts with</p>
  <pre><code>  Error in annotation processing: {0}.
  java.lang.NoClassDefFoundError: com/vaadin/server/VaadinServlet
  </code></pre>
  <p>Notice how the error <code>Error in annotation processing</code> has a message of <code>{0}</code>. The message for the error is missing.</p>
  <p>I looked at numerous articles from the internet. None of the potential causes of NoClassDefFoundError applied to this case I had. My jar-files were generated after the build.</p>
  <p>Last time I solved the problem by reinstalling Windows. This time I tried a less severe fix by reinstalling IntelliJ and my Payara server. Also I deleted and re-downloaded my company's GitHub project. <strong>After I did these, my builds started working again.</strong></p>
  <p>Re-installing IntelliJ could be enough, but I did all of these just in case since I was not certain which piece of software caused the problem.</p>
  <p>I am not fully satisfied with this fix as I still do not understand the cause of the problem.</p>