Error running Tomcat java.lang.NullPointerException

Answered

I use the Smart Tomcat plugin in IntelliJ IDEA 2018.1.6 (Community Edition) on Windows 10, and it worked well for many months.

Today, when I run Debug or Run on this project, instead of running - I get a small pink pop-up window at the left bottom corner of the IDE saying:

Error running 'Run Tomcat Server' java.lang.NullPointerException:

The expression 'Run Tomcat Server' in this message is the name of the configuration that I am trying to run.

I upgraded to the latest version: IntelliJ IDEA 2018.2.1 (Community Edition) Build #IC-182.3911.36 64-bit, but to no avail.

Here is the the Run configuration:

I would appreciate any help on this.

1
6 comments

When I modified the Deployment and Context Path fields contents in the above config to different values - it started working normally. This is still a mystery, and the error message is too laconic to be helpful in determining the cause of the problem and fixing it.

2

Please submit a bug to the plug-in developer.

0
Avatar
Permanently deleted user

Hello!

I had 100% the exact same issue. The solution is to change a value (literally any value) in the Ron configuration and save it, then things work as expected.

 

It's not clear to me if this is an issue with the plugin or with the IDE its self, but modifying and saving the config does in fact make things work again.

I'm only adding this message so that when people Google the error message they hopefully reach this page with a successful workaround.

5
Avatar
Permanently deleted user

Reproducing the error

This problem can be reproduced as follows:

If we close the IntelliJ IDEA project without stopping the Tomcat server. we get a message box asking us to Terminate or Disconnect the Tomcat process. Whether we terminate or we disconnect, in both case, next time we open the project and try to run Tomcat, we get the error.

 

The abnormal termination of Tomcat process result in following error in IntelliJ IDEA:

 

Solution

Follow the solution suggested above by Maurice Williams

Change any settings, such as Name from Tomcat to Tomcat9 or Server port 8080 to 8081 and try to run Tomcat server. Hopefully it will work (at least in my case)

 

To avoid this problem in future, please gracefully close Apache Tomcat web server:

0

Issue is related to third-party plugin. Please report plugin vendor.

0

Solution

The name "Tomcat" in the configuration is the issue.

you have to mention the name with exactly what you downloaded version name.

Eg: Tomcat 9.0.65

It works...!!

0

Please sign in to leave a comment.