2

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.

Miettine
  • 21
  • 2
  • 2
    Have you seen [this post](https://stackoverflow.com/questions/19626808/getting-a-noclassdeffounderror-after-installing-vaadin)? Verify your artifact configuration and that the needed library is present there. There must be `vaadin-server-X.X.X.jar` library where this class is defined. – Andrey Jan 03 '20 at 14:38
  • 1
    is the Vaadin library bundled with your Payara server or is it part of your `.war` file? Can please add your `pom.xml` file in addition? – rieckpil Jan 06 '20 at 06:32
  • Thank you for your suggestions. I will continue looking into solutions. Here is my pom.xml: https://pastebin.com/xutwFhzp It seems to me that the Vaadin library is not bundled with the server, but it should be a part of my `.war`-file – Miettine Jan 07 '20 at 07:57
  • There was a point when I looked at the jars in the folder `WEB-INF/lib` and I remember that I did not see `vaadin-server-X.X.X.jar` in there! Unfortunately, many days of frustration must have taken its toll and this detail slipped from my mind. I hastily decided to reinstall windows. I began the configuration process all over again, I have encountered new problems that I have not seen before, but I am now progressing none the less. Hopefully I can continue working soon. Thank you. – Miettine Jan 09 '20 at 06:27
  • Problem started happening again 9 months after making the original post. Added more information to the original post. – Miettine Oct 05 '20 at 09:18

0 Answers0