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.
The Server tab in IntelliJ says that starting the server and deploying the artifact is successful
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
After that IntelliJ navigates to http://localhost:8080/company on the browser. It displays a 'HTTP Status 404 - Not Found' error. The console says:
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)
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.
Information recap:
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 "1.8.0_231"
Java(TM) SE Runtime Environment (build 1.8.0_231-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.231-b11, mixed mode)
If you have any idea on what might cause this error, please offer suggestions. I am grateful for your help.
Nine months later the problem started happening on my computer again. My error message starts with
Error in annotation processing: {0}.
java.lang.NoClassDefFoundError: com/vaadin/server/VaadinServlet
Notice how the error Error in annotation processing
has a message of {0}
. The message for the error is missing.
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.
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. After I did these, my builds started working again.
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.
I am not fully satisfied with this fix as I still do not understand the cause of the problem.