Skip to content
Advertisement

java.lang.NoClassDefFoundError: javax/el/ELManager

I’m working on a webapp in Spring using Spring Tool Suite. If I build and deploy the application there using the IDE onto the provided Pivotal tc Server, it works just fine. However, if I do a manual “mvn clean package” build and attempt to deploy it to a standalone Tomcat server (using newest Tomcat 7), it throws the following exception:

JavaScript

Upon further inspection, it does complain few lines higher above about not loading jars:

JavaScript

My pom.xml:

JavaScript

What’s the reason for this behavior and how can I solve this?

EDIT More information:

Adding <scope>provided</scope> to javax.servlet-api seems to fix the warning about javax.servlet-api not being loaded at the start. Problem with el-api still remains.

I’ve checked the tomcat/lib directory and it already contains el-api.jar in it, which is likely why it tells me it’s not going to load the one I list in pom.xml. The thing is, adding <scope>provided</scope> doesn’t fix it either. Whatever I do, it still complains gives me the same java.lang.NoClassDefFoundError: javax/el/ELManager error.

SOLUTION

In addition to the part in the edit above regarding javax.servlet-api the problem with el-api was that I was running a Tomcat 7 with provided el-api jar in version 2.2. The missing class was introduced in el-api 3.0. Running the same webapp in Tomcat 8 (with el-api 3.0 jar) works properly.

Advertisement

Answer

You miss the javax.el-api as dependency. Add:

JavaScript

to your pom.xml

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement