java.lang.LinkageError: javax.servlet.jsp.JspApplicationContext.getExpressionFactory

别说谁变了你拦得住时间么 提交于 2019-11-26 11:52:53
BalusC

That will happen when you include server-specific libraries of a different server make/version in the /WEB-INF/lib of your web application, such as jsp-api.jar, el-api.jar, servlet-api.jar, etc. You need to remove them all. The /WEB-INF/lib should not contain any server-specific libraries. They belongs in the specific server itself (Tomcat has them in its /lib folder already).

This is by the way a pretty common beginner's mistake whenever they encounter compilation errors on the JSP/Servlet API in their IDE project. This should have been solved differently, namely by integrating the server in the IDE and adding the server as "Target runtime" to the project.

See also:

You have two options for adding to your projects libraries, such as jsp-api.jar, el-api.jar, servlet-api.jar, etc:

  1. Add these libraries as external jars in your Java Build Path;
  2. Add them as maven dependencies, setting the provided scope for each of them, for example:
<dependency>
    <groupId>javax.servlet.jsp</groupId>
    <artifactId>jsp-api</artifactId>
    <version>2.1</version>
    <scope>provided</scope>
</dependency>

Check this page

http://www.jarfinder.com/index.php/java/info/org.apache.jasper.runtime.HttpJspBase

Find which are the jars you have used in this. Removeone if you find two.:)

I was stuck with this error for a very long time and this thread saved quite bit of my time. Adding some research I did before resolving this issue. Yes we need to remove libraries like jsp-api.jar, el-api.jar, servlet-api.jar from /WEB-INF/lib folder. But how?

In my case I am using Apache Ivy as a dependency manger and used Spring MVC. It downloads all dependencies along with the libraries mentioned above. At runtime these conflicts with the APIs provided by Tomcat libraries. Simple solution would be to exclude these jars from dependencies or create configurations and include these libraries in compile time configuration only. What worked for me quickly is excluding these libraries.

    <dependency org="org.springframework" name="spring-webmvc"
        rev="4.0.4.RELEASE">
        <exclude org="javax.servlet" name="javax.servlet-api" />
        <exclude org="javax.servlet.jsp" name="jsp-api" />
        <exclude org="javax.el" name="javax.el-api" />
    </dependency>
Hasnain Ali Bohra

This is weird ERROR i got ever

After reserach i found this Causes and solution

I am using Spring so in my @spring libraries i already have the jar like

Servlet-api.jar or javax-servlet-api.jar jsp-api.jar or javax-servlet-jsp.jar

But this is not compatible wid my TOMCAT server So simply i remove these two jars from my built path and deployment assembly Now i goto my "E:\Locker\Software\apache-tomcat-6.0.44\lib" where are my Tomcat server and add these two jars to my project

servlet-api.jar
jsp-api.jar
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!