Skip to content
Advertisement

java.lang.NoClassDefFoundError: javax/servlet/ServletContext

I just upgraded to IntelliJ 15.0 from 14.1 (I was in a hurry and enter image description here forgot to save the previous plug state for 14.1) and I’m attempting to configure general run/debug configuration settings with Spring Boot in Intellij using Gradle. In the configuration tab I have added 1) the Main class, 2) JRE, and 3) class path of module in IntelliJ. I use Spring Boot as the selected configuration. However, when select Run I get this error:

JavaScript

Advertisement

Answer

OK here is what I had to do to solve this specific issue:

  1. IntelliJ needed to have a definition for Gradle Task called bootRun within the Debug/Run Configuration. This allows me to now run back-end code or debug back-end code updates in IntelliJ.
  1. Next I had to restructure my IntelliJ directories because IntelliJ 15 had installed both a parent and a child JRE folder which is incorrect so therefore IntelliJ displayed and exception stating that it could not find the a) java.exec nor the b) jvm.cfg files under it’s JRE/Lib sub-directory.

Once I fixed these two issues both builds and debugging seemed to work for Java Spring back end. I followed up with IntelliJ about the quirky JRE installation.

Advertisement